unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#47775: First line length and GNU coding standards....
@ 2021-04-14 14:46 Marco Antoniotti
  2021-04-18 16:59 ` Stefan Kangas
  0 siblings, 1 reply; 9+ messages in thread
From: Marco Antoniotti @ 2021-04-14 14:46 UTC (permalink / raw)
  To: 47775

[-- Attachment #1: Type: text/plain, Size: 1730 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 6528 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#47775: First line length and GNU coding standards....
  2021-04-14 14:46 bug#47775: First line length and GNU coding standards Marco Antoniotti
@ 2021-04-18 16:59 ` Stefan Kangas
  2021-04-19 12:18   ` Filipp Gunbin
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Kangas @ 2021-04-18 16:59 UTC (permalink / raw)
  To: Marco Antoniotti; +Cc: 47775

Marco Antoniotti <marco.antoniotti@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?)





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#47775: First line length and GNU coding standards....
  2021-04-18 16:59 ` Stefan Kangas
@ 2021-04-19 12:18   ` Filipp Gunbin
  2021-04-19 12:32     ` Marco Antoniotti
  2021-04-19 13:18     ` Stefan Kangas
  0 siblings, 2 replies; 9+ messages in thread
From: Filipp Gunbin @ 2021-04-19 12:18 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Marco Antoniotti, 47775

On 18/04/2021 11:59 -0500, Stefan Kangas wrote:

> Marco Antoniotti <marco.antoniotti@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?





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#47775: First line length and GNU coding standards....
  2021-04-19 12:18   ` Filipp Gunbin
@ 2021-04-19 12:32     ` Marco Antoniotti
  2021-04-19 13:18       ` Stefan Kangas
  2021-04-19 13:18     ` Stefan Kangas
  1 sibling, 1 reply; 9+ messages in thread
From: Marco Antoniotti @ 2021-04-19 12:32 UTC (permalink / raw)
  To: Filipp Gunbin; +Cc: Stefan Kangas, 47775

[-- Attachment #1: Type: text/plain, Size: 2345 bytes --]

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@fastmail.fm> wrote:

> On 18/04/2021 11:59 -0500, Stefan Kangas wrote:
>
> > Marco Antoniotti <marco.antoniotti@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

[-- Attachment #2: Type: text/html, Size: 7742 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#47775: First line length and GNU coding standards....
  2021-04-19 12:32     ` Marco Antoniotti
@ 2021-04-19 13:18       ` Stefan Kangas
  0 siblings, 0 replies; 9+ messages in thread
From: Stefan Kangas @ 2021-04-19 13:18 UTC (permalink / raw)
  To: Marco Antoniotti, Filipp Gunbin; +Cc: 47775

Marco Antoniotti <marco.antoniotti@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.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#47775: First line length and GNU coding standards....
  2021-04-19 12:18   ` Filipp Gunbin
  2021-04-19 12:32     ` Marco Antoniotti
@ 2021-04-19 13:18     ` Stefan Kangas
  2021-04-19 14:11       ` Marco Antoniotti
  1 sibling, 1 reply; 9+ messages in thread
From: Stefan Kangas @ 2021-04-19 13:18 UTC (permalink / raw)
  To: Filipp Gunbin; +Cc: Marco Antoniotti, 47775

Filipp Gunbin <fgunbin@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.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#47775: First line length and GNU coding standards....
  2021-04-19 13:18     ` Stefan Kangas
@ 2021-04-19 14:11       ` Marco Antoniotti
  2021-05-05 13:20         ` Lars Ingebrigtsen
  0 siblings, 1 reply; 9+ messages in thread
From: Marco Antoniotti @ 2021-04-19 14:11 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Filipp Gunbin, 47775

[-- Attachment #1: Type: text/plain, Size: 1319 bytes --]

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@marxist.se> wrote:

> Filipp Gunbin <fgunbin@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

[-- Attachment #2: Type: text/html, Size: 6436 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#47775: First line length and GNU coding standards....
  2021-04-19 14:11       ` Marco Antoniotti
@ 2021-05-05 13:20         ` Lars Ingebrigtsen
  2021-05-05 13:40           ` Marco Antoniotti
  0 siblings, 1 reply; 9+ messages in thread
From: Lars Ingebrigtsen @ 2021-05-05 13:20 UTC (permalink / raw)
  To: Marco Antoniotti; +Cc: Stefan Kangas, Filipp Gunbin, 47775

Marco Antoniotti <marco.antoniotti@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





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#47775: First line length and GNU coding standards....
  2021-05-05 13:20         ` Lars Ingebrigtsen
@ 2021-05-05 13:40           ` Marco Antoniotti
  0 siblings, 0 replies; 9+ messages in thread
From: Marco Antoniotti @ 2021-05-05 13:40 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Stefan Kangas, Filipp Gunbin, 47775

[-- Attachment #1: Type: text/plain, Size: 2174 bytes --]

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@gnus.org> wrote:

> Marco Antoniotti <marco.antoniotti@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

[-- Attachment #2: Type: text/html, Size: 7150 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-05-05 13:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-14 14:46 bug#47775: First line length and GNU coding standards Marco Antoniotti
2021-04-18 16:59 ` Stefan Kangas
2021-04-19 12:18   ` Filipp Gunbin
2021-04-19 12:32     ` Marco Antoniotti
2021-04-19 13:18       ` Stefan Kangas
2021-04-19 13:18     ` Stefan Kangas
2021-04-19 14:11       ` Marco Antoniotti
2021-05-05 13:20         ` Lars Ingebrigtsen
2021-05-05 13:40           ` Marco Antoniotti

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).