GNU bug report logs - #71985
Lexical directives at start of file

Previous Next

Package: emacs;

Reported by: Heime <heimeborgia <at> protonmail.com>

Date: Sun, 7 Jul 2024 18:46:02 UTC

Severity: normal

Done: Stefan Kangas <stefankangas <at> gmail.com>

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 71985 in the body.
You can then email your comments to 71985 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#71985; Package emacs. (Sun, 07 Jul 2024 18:46:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Heime <heimeborgia <at> protonmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 07 Jul 2024 18:46:02 GMT) Full text and rfc822 format available.

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

From: Heime <heimeborgia <at> protonmail.com>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: Lexical directives at start of file
Date: Sun, 07 Jul 2024 18:45:12 +0000
I was curious whether the -*- lexical-binding: t -*- directive is effective 
when there is an arbitrary number of comment characters before it.

For instance, in file.el:

;;; file.el -*- lexical-binding: t -*-

This is the first line from git-rebase.el in the Magit package:

;;; git-rebase.el --- Edit Git rebase files  -*- lexical-binding:t -*-

This suggests that some characters can precede the variable list. However,
it's unclear if the number of characters can be arbitrary. I couldn't find
a clear explanation in either the Emacs or Elisp manuals. The Emacs manual 
mentions that it can be placed on the second line of a shell script, but 
doesn't provide much detail on the format. The Elisp manual does not describe 
the appearance of this directive at all.



I was wondering whether the "-*- lexical-binding: t -*-" applies when 
there is an arbitrary number of comment characters. 

;;; file.el -*- lexical-binding: t -*-

This is the first line from `git-rebase.el` from magit.

;;; git-rebase.el --- Edit Git rebase files  -*- lexical-binding:t -*-

So one can have some characters in front of the actually var list.  But not 
sure if it's arbitrary.  I don't see it mentioned anywhere in both Emacs and 
Elisp manual.  In Emacs manual, it only mentions that it can be placed on the 
second line of a shell script.  Elisp manual doesn't even mention how it should
look like.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#71985; Package emacs. (Sun, 07 Jul 2024 19:03:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Heime <heimeborgia <at> protonmail.com>
Cc: 71985 <at> debbugs.gnu.org
Subject: Re: bug#71985: Lexical directives at start of file
Date: Sun, 07 Jul 2024 22:02:26 +0300
> Date: Sun, 07 Jul 2024 18:45:12 +0000
> From:  Heime via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> I was curious whether the -*- lexical-binding: t -*- directive is effective 
> when there is an arbitrary number of comment characters before it.

Why do you need to know this detail?

> For instance, in file.el:
> 
> ;;; file.el -*- lexical-binding: t -*-
> 
> This is the first line from git-rebase.el in the Magit package:
> 
> ;;; git-rebase.el --- Edit Git rebase files  -*- lexical-binding:t -*-
> 
> This suggests that some characters can precede the variable list. However,
> it's unclear if the number of characters can be arbitrary.

Above you mention "comment characters".  Here you are talking only
about "characters" in general.  I'm confused by what you are asking
about.

> I couldn't find
> a clear explanation in either the Emacs or Elisp manuals. The Emacs manual 
> mentions that it can be placed on the second line of a shell script, but 
> doesn't provide much detail on the format. The Elisp manual does not describe 
> the appearance of this directive at all.

The above is incorrect.  The ELisp manual shows how this line should
look in the nose "selecting Lisp Dialect".  I think that node answers
your questions.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#71985; Package emacs. (Sun, 07 Jul 2024 19:20:02 GMT) Full text and rfc822 format available.

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

From: Heime <heimeborgia <at> protonmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 71985 <at> debbugs.gnu.org
Subject: Re: bug#71985: Lexical directives at start of file
Date: Sun, 07 Jul 2024 19:19:41 +0000
On Sunday, July 7th, 2024 at 7:02 PM, Eli Zaretskii <eliz <at> gnu.org> wrote:

> > Date: Sun, 07 Jul 2024 18:45:12 +0000
> > From: Heime via "Bug reports for GNU Emacs,
> > the Swiss army knife of text editors" bug-gnu-emacs <at> gnu.org
> > 
> > I was curious whether the -- lexical-binding: t -- directive is effective
> > when there is an arbitrary number of comment characters before it.
> 
> 
> Why do you need to know this detail?

Because I use ;;; as highlight when using outlines.
 
> > For instance, in file.el:
> > 
> > ;;; file.el -- lexical-binding: t --
> > 
> > This is the first line from git-rebase.el in the Magit package:
> > 
> > ;;; git-rebase.el --- Edit Git rebase files -- lexical-binding:t --
> > 
> > This suggests that some characters can precede the variable list. However,
> > it's unclear if the number of characters can be arbitrary.
> 
> 
> Above you mention "comment characters". Here you are talking only
> about "characters" in general. I'm confused by what you are asking
> about.

Yes about the starting ;;;.  But then I have also seen additional non-directive
descriptions before the -*- lexical-binding:t -*- directive.

As the lexical definition will be around a while, it would be good to know what
would be valid.
 
> > I couldn't find
> > a clear explanation in either the Emacs or Elisp manuals. The Emacs manual
> > mentions that it can be placed on the second line of a shell script, but
> > doesn't provide much detail on the format. The Elisp manual does not describe
> > the appearance of this directive at all.
> 
> 
> The above is incorrect. The ELisp manual shows how this line should
> look in the nose "selecting Lisp Dialect". I think that node answers
> your questions.
>




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#71985; Package emacs. (Mon, 08 Jul 2024 02:28:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Heime <heimeborgia <at> protonmail.com>
Cc: 71985 <at> debbugs.gnu.org
Subject: Re: bug#71985: Lexical directives at start of file
Date: Mon, 08 Jul 2024 05:27:18 +0300
> Date: Sun, 07 Jul 2024 19:19:41 +0000
> From: Heime <heimeborgia <at> protonmail.com>
> Cc: 71985 <at> debbugs.gnu.org
> 
> On Sunday, July 7th, 2024 at 7:02 PM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
> > > Date: Sun, 07 Jul 2024 18:45:12 +0000
> > > From: Heime via "Bug reports for GNU Emacs,
> > > the Swiss army knife of text editors" bug-gnu-emacs <at> gnu.org
> > > 
> > > I was curious whether the -- lexical-binding: t -- directive is effective
> > > when there is an arbitrary number of comment characters before it.
> > 
> > 
> > Why do you need to know this detail?
> 
> Because I use ;;; as highlight when using outlines.
>  
> > > For instance, in file.el:
> > > 
> > > ;;; file.el -- lexical-binding: t --
> > > 
> > > This is the first line from git-rebase.el in the Magit package:
> > > 
> > > ;;; git-rebase.el --- Edit Git rebase files -- lexical-binding:t --
> > > 
> > > This suggests that some characters can precede the variable list. However,
> > > it's unclear if the number of characters can be arbitrary.
> > 
> > 
> > Above you mention "comment characters". Here you are talking only
> > about "characters" in general. I'm confused by what you are asking
> > about.
> 
> Yes about the starting ;;;.  But then I have also seen additional non-directive
> descriptions before the -*- lexical-binding:t -*- directive.
> 
> As the lexical definition will be around a while, it would be good to know what
> would be valid.

Then the ELisp manual provides this information, I think.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#71985; Package emacs. (Mon, 08 Jul 2024 12:45:02 GMT) Full text and rfc822 format available.

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

From: Heime <heimeborgia <at> protonmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 71985 <at> debbugs.gnu.org
Subject: Re: bug#71985: Lexical directives at start of file
Date: Mon, 08 Jul 2024 12:44:26 +0000



On Monday, July 8th, 2024 at 2:27 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:

> > Date: Sun, 07 Jul 2024 19:19:41 +0000
> > From: Heime heimeborgia <at> protonmail.com
> > Cc: 71985 <at> debbugs.gnu.org
> >
> > On Sunday, July 7th, 2024 at 7:02 PM, Eli Zaretskii eliz <at> gnu.org wrote:
> >
> > > > Date: Sun, 07 Jul 2024 18:45:12 +0000
> > > > From: Heime via "Bug reports for GNU Emacs,
> > > > the Swiss army knife of text editors" bug-gnu-emacs <at> gnu.org
> > > >
> > > > I was curious whether the -- lexical-binding: t -- directive is effective
> > > > when there is an arbitrary number of comment characters before it.
> > >
> > > Why do you need to know this detail?
> >
> > Because I use ;;; as highlight when using outlines.
> >
> > > > For instance, in file.el:
> > > >
> > > > ;;; file.el -- lexical-binding: t --
> > > >
> > > > This is the first line from git-rebase.el in the Magit package:
> > > >
> > > > ;;; git-rebase.el --- Edit Git rebase files -- lexical-binding:t --
> > > >
> > > > This suggests that some characters can precede the variable list. However,
> > > > it's unclear if the number of characters can be arbitrary.
> > >
> > > Above you mention "comment characters". Here you are talking only
> > > about "characters" in general. I'm confused by what you are asking
> > > about.
> >
> > Yes about the starting ;;;. But then I have also seen additional non-directive
> > descriptions before the -- lexical-binding:t -- directive.
> >
> > As the lexical definition will be around a while, it would be good to know what
> > would be valid.
>
>
> Then the ELisp manual provides this information, I think.

It could be there.  But, where is it ?





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#71985; Package emacs. (Mon, 08 Jul 2024 13:22:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Heime <heimeborgia <at> protonmail.com>
Cc: 71985 <at> debbugs.gnu.org
Subject: Re: bug#71985: Lexical directives at start of file
Date: Mon, 08 Jul 2024 16:21:27 +0300
> Date: Mon, 08 Jul 2024 12:44:26 +0000
> From: Heime <heimeborgia <at> protonmail.com>
> Cc: 71985 <at> debbugs.gnu.org
> 
> > > Yes about the starting ;;;. But then I have also seen additional non-directive
> > > descriptions before the -- lexical-binding:t -- directive.
> > >
> > > As the lexical definition will be around a while, it would be good to know what
> > > would be valid.
> >
> >
> > Then the ELisp manual provides this information, I think.
> 
> It could be there.  But, where is it ?

I told you before: in the node called "Selecting Lisp Dialect".




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#71985; Package emacs. (Mon, 08 Jul 2024 13:37:02 GMT) Full text and rfc822 format available.

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

From: Heime <heimeborgia <at> protonmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 71985 <at> debbugs.gnu.org
Subject: Re: bug#71985: Lexical directives at start of file
Date: Mon, 08 Jul 2024 13:36:36 +0000




Sent with Proton Mail secure email.

On Monday, July 8th, 2024 at 1:21 PM, Eli Zaretskii <eliz <at> gnu.org> wrote:

> > Date: Mon, 08 Jul 2024 12:44:26 +0000
> > From: Heime heimeborgia <at> protonmail.com
> > Cc: 71985 <at> debbugs.gnu.org
> > 
> > > > Yes about the starting ;;;. But then I have also seen additional non-directive
> > > > descriptions before the -- lexical-binding:t -- directive.
> > > > 
> > > > As the lexical definition will be around a while, it would be good to know what
> > > > would be valid.
> > > 
> > > Then the ELisp manual provides this information, I think.
> > 
> > It could be there. But, where is it ?
> 
> 
> I told you before: in the node called "Selecting Lisp Dialect".

Have gone through the GNU Emacs Lisp Reference Manual corresponding to 
Emacs version 29.1.90.  There is no such node.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#71985; Package emacs. (Mon, 08 Jul 2024 14:17:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Heime <heimeborgia <at> protonmail.com>
Cc: 71985 <at> debbugs.gnu.org
Subject: Re: bug#71985: Lexical directives at start of file
Date: Mon, 08 Jul 2024 17:16:17 +0300
> Date: Mon, 08 Jul 2024 13:36:36 +0000
> From: Heime <heimeborgia <at> protonmail.com>
> Cc: 71985 <at> debbugs.gnu.org
> 
> 
> 
> 
> 
> 
> Sent with Proton Mail secure email.
> 
> On Monday, July 8th, 2024 at 1:21 PM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
> > > Date: Mon, 08 Jul 2024 12:44:26 +0000
> > > From: Heime heimeborgia <at> protonmail.com
> > > Cc: 71985 <at> debbugs.gnu.org
> > > 
> > > > > Yes about the starting ;;;. But then I have also seen additional non-directive
> > > > > descriptions before the -- lexical-binding:t -- directive.
> > > > > 
> > > > > As the lexical definition will be around a while, it would be good to know what
> > > > > would be valid.
> > > > 
> > > > Then the ELisp manual provides this information, I think.
> > > 
> > > It could be there. But, where is it ?
> > 
> > 
> > I told you before: in the node called "Selecting Lisp Dialect".
> 
> Have gone through the GNU Emacs Lisp Reference Manual corresponding to 
> Emacs version 29.1.90.  There is no such node.

It was added in the current release branch, and will be in Emacs 30.1.
Meanwhile you can look at it here:

  https://git.savannah.gnu.org/cgit/emacs.git/tree/doc/lispref/variables.texi?h=emacs-30#n1287





Reply sent to Stefan Kangas <stefankangas <at> gmail.com>:
You have taken responsibility. (Mon, 30 Sep 2024 01:45:13 GMT) Full text and rfc822 format available.

Notification sent to Heime <heimeborgia <at> protonmail.com>:
bug acknowledged by developer. (Mon, 30 Sep 2024 01:45:14 GMT) Full text and rfc822 format available.

Message #31 received at 71985-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 71985-done <at> debbugs.gnu.org, Heime <heimeborgia <at> protonmail.com>
Subject: Re: bug#71985: Lexical directives at start of file
Date: Sun, 29 Sep 2024 18:43:02 -0700
Eli Zaretskii <eliz <at> gnu.org> writes:

>> Date: Mon, 08 Jul 2024 13:36:36 +0000
>> From: Heime <heimeborgia <at> protonmail.com>
>> Cc: 71985 <at> debbugs.gnu.org
>>
>>
>>
>>
>>
>>
>> Sent with Proton Mail secure email.
>>
>> On Monday, July 8th, 2024 at 1:21 PM, Eli Zaretskii <eliz <at> gnu.org> wrote:
>>
>> > > Date: Mon, 08 Jul 2024 12:44:26 +0000
>> > > From: Heime heimeborgia <at> protonmail.com
>> > > Cc: 71985 <at> debbugs.gnu.org
>> > >
>> > > > > Yes about the starting ;;;. But then I have also seen additional non-directive
>> > > > > descriptions before the -- lexical-binding:t -- directive.
>> > > > >
>> > > > > As the lexical definition will be around a while, it would be good to know what
>> > > > > would be valid.
>> > > >
>> > > > Then the ELisp manual provides this information, I think.
>> > >
>> > > It could be there. But, where is it ?
>> >
>> >
>> > I told you before: in the node called "Selecting Lisp Dialect".
>>
>> Have gone through the GNU Emacs Lisp Reference Manual corresponding to
>> Emacs version 29.1.90.  There is no such node.
>
> It was added in the current release branch, and will be in Emacs 30.1.
> Meanwhile you can look at it here:
>
>   https://git.savannah.gnu.org/cgit/emacs.git/tree/doc/lispref/variables.texi?h=emacs-30#n1287

I don't see a bug here, so I'm closing this bug report.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 28 Oct 2024 11:24:16 GMT) Full text and rfc822 format available.

This bug report was last modified 136 days ago.

Previous Next


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