GNU bug report logs - #74145
31.0.50; Default lexical-binding to t

Previous Next

Package: emacs;

Reported by: Stefan Monnier <monnier <at> iro.umontreal.ca>

Date: Thu, 31 Oct 2024 20:59:02 UTC

Severity: wishlist

Tags: patch

Found in version 31.0.50

Full log


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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Andrea Corallo <acorallo <at> gnu.org>,
 74145 <at> debbugs.gnu.org
Subject: Re: bug#74145: 31.0.50; Default lexical-binding to t
Date: Thu, 31 Oct 2024 21:20:41 -0400
Hi Stefan,

>> @@ -392,7 +392,7 @@ Void Variables
>>  to evaluate the variable signals a @code{void-variable} error, instead
>>  of returning a value.
>>
>> -  Under the optional lexical scoping rule, the value cell only holds
>> +  Under the optional lexical scoping rule, the value cell holds only
>>  the variable's global value---the value outside of any lexical binding
>>  construct.  When a variable is lexically bound, the local value is
>>  determined by the lexical environment; hence, variables can have local
>
> I think this section might need more work.  It's a bit confusing to talk
> about "default dynamic scoping" and "optional lexical scoping" now.
> Shouldn't we talk about "normal variables with lexical scoping" and
> "special variables with dynamic scoping" or something along those lines?

Very good point, will take a closer look.

>> +                    (lexical-binding (default-toplevel-value 'lexical-binding)))
> Why not just use `t` here instead of its `default-toplevel-value`?

I "fixed" the code such that the default is set at exactly one place,
i.e. in `syms_of_lread`, but indeed it's not indispensable.

It's not super important, but it seemed cleaner.
It also makes it easy for users to "go back" to the nil default,
e.g. for testing purposes, or as a quick fix until you can track down
the `.el` files that need to be adjusted.


        Stefan





This bug report was last modified 68 days ago.

Previous Next


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