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:
parent
e2799739a5
commit
e5130bdecc
2 changed files with 14 additions and 1 deletions
10
etc/NEWS
10
etc/NEWS
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue