Subject: bug#60027: closed (Re: bug#60027: 30.0.50; Suggestions for (info "(elisp) Local Variables"))

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 14 Dec 2022 15:48:02 +0000

Your bug report

#60027: 30.0.50; Suggestions for (info "(elisp) Local Variables")

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
60027: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=60027
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#60027: 30.0.50; Suggestions for (info "(elisp) Local Variables")
From: Eli Zaretskii <[email-masked]>
To: Michael Heerdegen <[email-masked]>
Cc: [email-masked]
Date: Wed, 14 Dec 2022 17:47:42 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Michael Heerdegen <[email-masked]>
> Date: Tue, 13 Dec 2022 04:33:59 +0100
> 
> two thoughts about (info "(elisp) Local Variables"):

[...]

Thanks, I made the changes you proposed on the emacs-29 branch, and
I'm therefore closing this bug.

Subject: 30.0.50; Suggestions for (info "(elisp) Local Variables")
From: Michael Heerdegen <[email-masked]>
To: [email-masked]
Date: Tue, 13 Dec 2022 04:33:59 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello,

two thoughts about (info "(elisp) Local Variables"):

(1) About saying that dynamical binding is the "default":

| The default scoping rule in Emacs Lisp is called “dynamic scoping”,
| which simply states that the current binding at any given point in the
| execution of a program is the most recently-created binding for that
| variable that still exists.  For details about dynamic scoping, and an
| alternative scoping rule called “lexical scoping”, *note Variable
| Scoping::.

Likewise (info "(elisp) Variable Scoping"):

| By default, the local bindings that Emacs creates are “dynamic
| bindings”.

I think saying this gets more and more confusing to newbies, now that
nearly all sources are in lexical binding, and *scratch* also is.  It's
opt-in so technically is not strictly wrong, but it is confusing
nonetheless.

I suggest to say something like that the default was dynamical binding
for a long time but Emacs is moving towards using lexical binding as
default.  People must be prepared that they will see both dialects, and
this will be the case for another 20 or 30 years at least, so it's not
wrong to tell it's an intermediate state.

But lexical binding is also not the exception any more, it is very
present.

(2) I want to suggest that in (info "(elisp) Local Variables") we add
that

(let* (BINDING1 BINDING2 ...) BODY...)

is equivalent to

(let (BINDING1)
  (let (BINDING2)
    (let ...
      BODY...)))

This would help people to understand, offering a different description,
and would also answer a question I often hear in emacs-help: If it is
legal to specify the same symbol multiple times in `let*'.  That node
describes shadowing of bindings so this is a good place to address this
question.

Michael.