1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-05 22:20:24 -08:00

The --script option now enforces lexical binding (bug#79760)

* etc/NEWS: Document the change.
* lisp/startup.el (command-line--load-script): Set 'lexical-binding';
if we delete the first line, insert a new line to preserve line
numbers.
(command-line--eval-script): Set 'lexical-binding'.
This commit is contained in:
Pip Cet 2025-11-07 09:12:55 +00:00
parent e2799739a5
commit e5130bdecc
2 changed files with 14 additions and 1 deletions

View file

@ -3168,6 +3168,16 @@ and blocks Emacs, or does not provide ways to limit how often it runs.
* Incompatible Lisp Changes in Emacs 31.1
** Files loaded from '-x' and '--script' now use lexical binding.
If you don't have time to adapt your script's code to the lexical
binding dialect (see (info "(elisp)Converting to Lexical Binding")),
you can wrap your code in:
#!/usr/bin/env -S emacs --batch --script
(eval
'(progn
YOUR CODE HERE))
+++
** String mutation has been restricted further.
'aset' on unibyte strings now requires the new character to be a single