GNU bug report logs - #77883
31.0.50; C-c C-e in *scratch* generates a missing lexical binding cookie warning

Previous Next

Package: emacs;

Reported by: Sean Whitton <spwhitton <at> spwhitton.name>

Date: Fri, 18 Apr 2025 02:37:06 UTC

Severity: normal

Merged with 78206

Found in version 31.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: michael_heerdegen <at> web.de, 77883 <at> debbugs.gnu.org, spwhitton <at> spwhitton.name
Subject: bug#77883: 31.0.50; C-c C-e in *scratch* generates a missing lexical binding cookie warning
Date: Fri, 18 Apr 2025 16:45:44 +0300
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: Michael Heerdegen <michael_heerdegen <at> web.de>,  spwhitton <at> spwhitton.name,
>   77883 <at> debbugs.gnu.org
> Date: Fri, 18 Apr 2025 09:16:18 -0400
> 
> >> C-c C-e calls `eval-buffer' which "ignores the current value of the
> >> `lexical-binding' variable.  Instead it will heed any
> >> -*- lexical-binding: t -*- settings in the buffer, and if there is no such
> >> setting, the buffer will be evaluated without lexical binding."
> >> 
> >> Not good in this case.
> >
> > Is it good in any other case?
> >
> > I mean, what's the logic behind ignoring the current value of
> > lexical-binding, but heeding the cookie? let alone defaulting to
> > dynamic binding if there's no cookie?  If the reason is backward
> > compatibility, I think I'd like to see the details: where would
> > changing this cause problems?
> 
> I can't remember how we ended up with this, but I strongly suspect it
> has to do with the use of `eval-buffer` in `load-with-code-conversion`,
> which is the most common use of `eval-buffer` (in dynamic counts, not
> static counts, of course).

If load-with-code-conversion is the only case where this is needed, we
could do that locally in load-with-code-conversion, right?  I mean,
there's no need to "punish" all the users of eval-buffer for that
single use.  Right?




This bug report was last modified 16 days ago.

Previous Next


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