emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: missing lexical-binding cookie warning when loading .el files


From: Eli Zaretskii
Subject: Re: missing lexical-binding cookie warning when loading .el files
Date: Sat, 04 May 2024 15:59:24 +0300

> From: Mattias Engdegård <mattias.engdegard@gmail.com>
> Date: Sat, 4 May 2024 12:31:38 +0200
> Cc: luangruo@yahoo.com,
>  emacs-devel@gnu.org
> 
> 4 maj 2024 kl. 11.24 skrev Eli Zaretskii <eliz@gnu.org>:
> 
> >  . it hard-codes ".emacs" as the file for which we don't warn, thus
> >    leaving the warning in effect for early-init files
> >  . the init file can be named init.el or _emacs (with or without
> >    .el), and the change doesn't handle that
> 
> Actually it hard-codes .emacs as a file for which we do warn, but I didn't 
> think of _emacs -- sorry.
> 
> Anyway, my assumption was that we should warn about the user init file(s) and 
> you seem to disagree. Here is my reasoning:
> 
> + Init files often contain substantial amounts of hand-written code for which 
> lexical-binding matters.
> + New Emacs-generated init files always include a lexical cookie.
> - Old Emacs-generated init files did not include a lexical cookie when 
> created.
> - Some init files don't contain much actual Lisp code.
> 
> Not sure what the balance is. Which would you prefer, and why? I'm not deeply 
> invested in either choice.

I'd like to hear from others as well, so let's give them some time to
chime in.

My current personal opinion is that we should move in small steps
here: first warn only about Lisp packages, which means exempt all the
user init files, as well as files not ending in ".el".

Not sure what this means for files that user init files load via an
explicit 'load' call -- how many people split their init files into
several portions, and also call those portions SOMETHING.el?  If in
doubt, we could suppress the warning for the entire duration of
startup--load-user-init-file.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]