all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#60027: 30.0.50; Suggestions for (info "(elisp) Local Variables")
@ 2022-12-13  3:33 Michael Heerdegen
  2022-12-14 15:47 ` Eli Zaretskii
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Heerdegen @ 2022-12-13  3:33 UTC (permalink / raw)
  To: 60027


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.







^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#60027: 30.0.50; Suggestions for (info "(elisp) Local Variables")
  2022-12-13  3:33 bug#60027: 30.0.50; Suggestions for (info "(elisp) Local Variables") Michael Heerdegen
@ 2022-12-14 15:47 ` Eli Zaretskii
  0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2022-12-14 15:47 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: 60027-done

> From: Michael Heerdegen <michael_heerdegen@web.de>
> 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.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-12-14 15:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-13  3:33 bug#60027: 30.0.50; Suggestions for (info "(elisp) Local Variables") Michael Heerdegen
2022-12-14 15:47 ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.