GNU bug report logs - #47775
First line length and GNU coding standards....

Previous Next

Package: emacs;

Reported by: Marco Antoniotti <marco.antoniotti <at> unimib.it>

Date: Wed, 14 Apr 2021 15:01:02 UTC

Severity: wishlist

Tags: wontfix

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 47775 in the body.
You can then email your comments to 47775 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#47775; Package emacs. (Wed, 14 Apr 2021 15:01:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Marco Antoniotti <marco.antoniotti <at> unimib.it>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 14 Apr 2021 15:01:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Marco Antoniotti <marco.antoniotti <at> unimib.it>
To: bug-gnu-emacs <at> gnu.org
Subject: First line length and GNU coding standards....
Date: Wed, 14 Apr 2021 16:46:09 +0200
[Message part 1 (text/plain, inline)]
Hi

Many years ago we had 80 columns and that was a GOOD THING!

It is such a good thing that the GNU Coding Standards (and not only them),
unless I remember incorrectly, ask for 80 columns of code.

Also many years ago, and on this I may be wrong, it was also said that the

-*- Mode: ... -*-

line could appear within the first 10 (am I remembering right?) lines of a
file.

Now, in
https://www.gnu.org/software/emacs/manual/html_node/elisp/Library-Headers.html
it is said that the FIRST line of a elisp file must start like this:

;;; foo.el --- Support for the Foo programming language  -*-
lexical-binding: t; -*-

especially if you want lexical binding, which is NOT turned on if the
setting is NOT in the first line.

Now, this is not exactly a bug, but for many years (I am an old guy), I
wrote code with a separate header line containing only Emacs local buffer
customizations.  And the Lisp-Headers "suggestion" quickly runs afoul of
the 80 column coding standard.  Moreover, things like checkdoc (and
therefore flycheck) become a bit annoying if you do not follow suit.

Bottom line, this is just a bit of a rant, but I really like my (and, I
believe, many other old geezers') style of having something like

;;; -*- Mode: Emacs-Lisp; lexical-binding: t; some-var-with-a-long-name: t
-*-
;;; foo.el --- The foo pkg, which also happens to have description 79 col
long.

I know it's 2021, but I still like the 80 columns.

Anything that can be done about it?

All the best

Marco


-- 
Marco Antoniotti, Associate Professor         tel. +39 - 02 64 48 79 01
DISCo, Università Milano Bicocca U14 2043 http://dcb.disco.unimib.it
Viale Sarca 336
I-20126 Milan (MI) ITALY
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47775; Package emacs. (Sun, 18 Apr 2021 17:00:02 GMT) Full text and rfc822 format available.

Message #8 received at 47775 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Marco Antoniotti <marco.antoniotti <at> unimib.it>
Cc: 47775 <at> debbugs.gnu.org
Subject: Re: bug#47775: First line length and GNU coding standards....
Date: Sun, 18 Apr 2021 11:59:05 -0500
Marco Antoniotti <marco.antoniotti <at> unimib.it> writes:

> Bottom line, this is just a bit of a rant, but I really like my (and,
> I believe, many other old geezers') style of having something like
>
> ;;; -*- Mode: Emacs-Lisp; lexical-binding: t; some-var-with-a-long-name: t -*-
> ;;; foo.el --- The foo pkg, which also happens to have description 79 col long.

Within N years, we will hopefully flip the switch and enable
lexical-binding by default, thereby (mostly) eliminating the problem.
So I would propose living with this wart.  Just my two cents.

(BTW, is there any code out there that relies on the first line being
formatted as before?)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47775; Package emacs. (Mon, 19 Apr 2021 12:19:02 GMT) Full text and rfc822 format available.

Message #11 received at 47775 <at> debbugs.gnu.org (full text, mbox):

From: Filipp Gunbin <fgunbin <at> fastmail.fm>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: Marco Antoniotti <marco.antoniotti <at> unimib.it>, 47775 <at> debbugs.gnu.org
Subject: Re: bug#47775: First line length and GNU coding standards....
Date: Mon, 19 Apr 2021 15:18:18 +0300
On 18/04/2021 11:59 -0500, Stefan Kangas wrote:

> Marco Antoniotti <marco.antoniotti <at> unimib.it> writes:
>
>> Bottom line, this is just a bit of a rant, but I really like my (and,
>> I believe, many other old geezers') style of having something like
>>
>> ;;; -*- Mode: Emacs-Lisp; lexical-binding: t; some-var-with-a-long-name: t -*-
>> ;;; foo.el --- The foo pkg, which also happens to have description 79 col long.
>
> Within N years, we will hopefully flip the switch and enable
> lexical-binding by default, thereby (mostly) eliminating the problem.
> So I would propose living with this wart.  Just my two cents.

Will that be really possible?  What about code in the wild?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47775; Package emacs. (Mon, 19 Apr 2021 12:34:02 GMT) Full text and rfc822 format available.

Message #14 received at 47775 <at> debbugs.gnu.org (full text, mbox):

From: Marco Antoniotti <marco.antoniotti <at> unimib.it>
To: Filipp Gunbin <fgunbin <at> fastmail.fm>
Cc: Stefan Kangas <stefan <at> marxist.se>, 47775 <at> debbugs.gnu.org
Subject: Re: bug#47775: First line length and GNU coding standards....
Date: Mon, 19 Apr 2021 14:32:57 +0200
[Message part 1 (text/plain, inline)]
Hi

thanks for your responses.

Mine is "code in the wild"... and it uses conventions that predate the
"suggestions" made in more recent versions of the Emacs documentation.

Bottom line, the GNU coding standards requiring - rightly so - 80 columns,
conflict with the requirements on the first line.
Put simply, you cannot have the

;;; foo.el -- This file is a baz with a long description, even if this
example is not

With the requirement of having buffer local variables (forget about
lexical-binding!) in the first line.

One of the two has to yield.  Given "older" conventions and "code in the
wild", the first line (or lines!!!) should be reserved for buffer local
variables (and even the Mode: Emacs-Lisp declaration).  The "file content"
documentation can come afterward.

This is just a convention (*,**) in the Emacs documentation, and possibly
only one package (AFAIK, checkdoc) will be affected.

All the best

Marco

(*) Well, the buffer local variables and the Mode: declaration could appear
in the first lines, as I recall, if my memory does not fail me.
(**) Since we are at it, old Lisp geezers like me use ;;;;, ;;; at the top
level, and ;; and ; for "in code" comments; where the ;;; and ;;
conventions for Emacs-Lisp came from, who knows.





On Mon, Apr 19, 2021 at 2:18 PM Filipp Gunbin <fgunbin <at> fastmail.fm> wrote:

> On 18/04/2021 11:59 -0500, Stefan Kangas wrote:
>
> > Marco Antoniotti <marco.antoniotti <at> unimib.it> writes:
> >
> >> Bottom line, this is just a bit of a rant, but I really like my (and,
> >> I believe, many other old geezers') style of having something like
> >>
> >> ;;; -*- Mode: Emacs-Lisp; lexical-binding: t;
> some-var-with-a-long-name: t -*-
> >> ;;; foo.el --- The foo pkg, which also happens to have description 79
> col long.
> >
> > Within N years, we will hopefully flip the switch and enable
> > lexical-binding by default, thereby (mostly) eliminating the problem.
> > So I would propose living with this wart.  Just my two cents.
>
> Will that be really possible?  What about code in the wild?
>


-- 
Marco Antoniotti, Associate Professor         tel. +39 - 02 64 48 79 01
DISCo, Università Milano Bicocca U14 2043 http://dcb.disco.unimib.it
Viale Sarca 336
http://cdac2021.lakecomoschool.org
I-20126 Milan (MI) ITALY
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47775; Package emacs. (Mon, 19 Apr 2021 13:19:02 GMT) Full text and rfc822 format available.

Message #17 received at 47775 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Marco Antoniotti <marco.antoniotti <at> unimib.it>,
 Filipp Gunbin <fgunbin <at> fastmail.fm>
Cc: 47775 <at> debbugs.gnu.org
Subject: Re: bug#47775: First line length and GNU coding standards....
Date: Mon, 19 Apr 2021 08:18:45 -0500
Marco Antoniotti <marco.antoniotti <at> unimib.it> writes:

> This is just a convention (*,**) in the Emacs documentation, and possibly
> only one package (AFAIK, checkdoc) will be affected.

We would need to update all files in our sources, at least.  Third-party
packages will presumably also want to change at some point, as well as
any tools that rely on the current conventions.

I'm not sure the churn is worth it.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47775; Package emacs. (Mon, 19 Apr 2021 13:19:02 GMT) Full text and rfc822 format available.

Message #20 received at 47775 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Filipp Gunbin <fgunbin <at> fastmail.fm>
Cc: Marco Antoniotti <marco.antoniotti <at> unimib.it>, 47775 <at> debbugs.gnu.org
Subject: Re: bug#47775: First line length and GNU coding standards....
Date: Mon, 19 Apr 2021 08:18:51 -0500
Filipp Gunbin <fgunbin <at> fastmail.fm> writes:

>> Within N years, we will hopefully flip the switch and enable
>> lexical-binding by default, thereby (mostly) eliminating the problem.
>
> Will that be really possible?  What about code in the wild?

It's not an immediate proposal obviously, but yes after a long-ish
deprecation period of `lexical-binding:nil' many of us hope that we will
be able to flip the switch.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47775; Package emacs. (Mon, 19 Apr 2021 14:12:02 GMT) Full text and rfc822 format available.

Message #23 received at 47775 <at> debbugs.gnu.org (full text, mbox):

From: Marco Antoniotti <marco.antoniotti <at> unimib.it>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: Filipp Gunbin <fgunbin <at> fastmail.fm>, 47775 <at> debbugs.gnu.org
Subject: Re: bug#47775: First line length and GNU coding standards....
Date: Mon, 19 Apr 2021 16:11:14 +0200
[Message part 1 (text/plain, inline)]
Hi

let me reiterate.  The issue is *not *the lexical-binding t or nil.

The issue is "buffer variables" vs "convention of 'name --- description'.

TRT is to "fix" checkdoc to look for the 'name --- description' within the
first (10) lines, AND/OR to revert to the old convention of having the '-*-
... -*-' line(s) within the first 10.

Once that is done, the documentation can be amended accordingly, *relaxing *the
mandate that the first line MUST start with ;;; foo --- bar. and no extra
update in any files will be needed.

All the best

MA

On Mon, Apr 19, 2021 at 3:18 PM Stefan Kangas <stefan <at> marxist.se> wrote:

> Filipp Gunbin <fgunbin <at> fastmail.fm> writes:
>
> >> Within N years, we will hopefully flip the switch and enable
> >> lexical-binding by default, thereby (mostly) eliminating the problem.
> >
> > Will that be really possible?  What about code in the wild?
>
> It's not an immediate proposal obviously, but yes after a long-ish
> deprecation period of `lexical-binding:nil' many of us hope that we will
> be able to flip the switch.
>


-- 
Marco Antoniotti, Associate Professor         tel. +39 - 02 64 48 79 01
DISCo, Università Milano Bicocca U14 2043 http://dcb.disco.unimib.it
Viale Sarca 336
http://cdac2021.lakecomoschool.org
I-20126 Milan (MI) ITALY
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47775; Package emacs. (Wed, 05 May 2021 13:21:02 GMT) Full text and rfc822 format available.

Message #26 received at 47775 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Marco Antoniotti <marco.antoniotti <at> unimib.it>
Cc: Filipp Gunbin <fgunbin <at> fastmail.fm>, Stefan Kangas <stefan <at> marxist.se>,
 47775 <at> debbugs.gnu.org
Subject: Re: bug#47775: First line length and GNU coding standards....
Date: Wed, 05 May 2021 15:20:41 +0200
Marco Antoniotti <marco.antoniotti <at> unimib.it> writes:

> The issue is "buffer variables" vs "convention of 'name --- description'.
>
> TRT is to "fix" checkdoc to look for the 'name --- description' within the first (10)
> lines, AND/OR to revert to the old convention of having the '-*- ... -*-' line(s) within
> the first 10.
>
> Once that is done, the documentation can be amended accordingly, relaxing the
> mandate that the first line MUST start with ;;; foo --- bar. and no extra update in any
> files will be needed.

If I understand correctly, you want Emacs to recommend the following
style to start .el files:

;;; -*- Mode: Emacs-Lisp; lexical-binding: t; some-var-with-a-long-name: t -*-
;;; foo.el --- The foo pkg, which also happens to have description 79 col long.

This would break a lot of tooling that expects the first line to have
the package name (and description), so that's not a feasible change.

The local variable section is usually put at the end of the file, but
lexical-binding is special, in that it's not "really" a local variable,
but has other effects, and in that we're (at one point in the future)
going to remove all these cookies when we flip the defaults, and then
the first lines will be shorter than 79 characters again.

So I'm closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) wontfix. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 05 May 2021 13:21:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 47775 <at> debbugs.gnu.org and Marco Antoniotti <marco.antoniotti <at> unimib.it> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 05 May 2021 13:21:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47775; Package emacs. (Wed, 05 May 2021 13:41:02 GMT) Full text and rfc822 format available.

Message #33 received at 47775 <at> debbugs.gnu.org (full text, mbox):

From: Marco Antoniotti <marco.antoniotti <at> unimib.it>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Filipp Gunbin <fgunbin <at> fastmail.fm>, Stefan Kangas <stefan <at> marxist.se>,
 47775 <at> debbugs.gnu.org
Subject: Re: bug#47775: First line length and GNU coding standards....
Date: Wed, 5 May 2021 15:40:37 +0200
[Message part 1 (text/plain, inline)]
Yes, exactly.

I understand your reasoning and your decision.   But let me note that it is
the "tooling" that broke, in the mists of time, previous well established
conventions.
Having said that, I would like Emacs to *also accept* the style I propose,
not to mandate it.

In any case, I am just ranting, I know :) :) :)

All the best

Marco


On Wed, May 5, 2021 at 3:20 PM Lars Ingebrigtsen <larsi <at> gnus.org> wrote:

> Marco Antoniotti <marco.antoniotti <at> unimib.it> writes:
>
> > The issue is "buffer variables" vs "convention of 'name --- description'.
> >
> > TRT is to "fix" checkdoc to look for the 'name --- description' within
> the first (10)
> > lines, AND/OR to revert to the old convention of having the '-*- ...
> -*-' line(s) within
> > the first 10.
> >
> > Once that is done, the documentation can be amended accordingly,
> relaxing the
> > mandate that the first line MUST start with ;;; foo --- bar. and no
> extra update in any
> > files will be needed.
>
> If I understand correctly, you want Emacs to recommend the following
> style to start .el files:
>
> ;;; -*- Mode: Emacs-Lisp; lexical-binding: t; some-var-with-a-long-name: t
> -*-
> ;;; foo.el --- The foo pkg, which also happens to have description 79 col
> long.
>
> This would break a lot of tooling that expects the first line to have
> the package name (and description), so that's not a feasible change.
>
> The local variable section is usually put at the end of the file, but
> lexical-binding is special, in that it's not "really" a local variable,
> but has other effects, and in that we're (at one point in the future)
> going to remove all these cookies when we flip the defaults, and then
> the first lines will be shorter than 79 characters again.
>
> So I'm closing this bug report.
>
> --
> (domestic pets only, the antidote for overdose, milk.)
>    bloggy blog: http://lars.ingebrigtsen.no
>


-- 
Marco Antoniotti, Associate Professor         tel. +39 - 02 64 48 79 01
DISCo, Università Milano Bicocca U14 2043 http://dcb.disco.unimib.it
Viale Sarca 336
http://cdac2021.lakecomoschool.org
I-20126 Milan (MI) ITALY
[Message part 2 (text/html, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 03 Jun 2021 11:24:11 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 328 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.