]> git.eshelyaron.com Git - emacs.git/commit
Don't rewrite `set` to `setq` of lexical variables
authorMattias Engdegård <mattiase@acm.org>
Thu, 22 Sep 2022 12:15:56 +0000 (14:15 +0200)
committerMattias Engdegård <mattiase@acm.org>
Thu, 22 Sep 2022 12:54:15 +0000 (14:54 +0200)
commite4964de952a8246307faaf9875d2c278f42c53fc
treeabed0eca68ab4e72954e39d52bb791491d80519d
parente9f42b1cba08c3a20db86d8a98f7e9cfe22569d7
Don't rewrite `set` to `setq` of lexical variables

Only perform the rewrite

   (set 'VAR X) -> (setq VAR X)

for dynamic variables, as `set` isn't supposed to affect
lexical vars (and never does so when interpreted).

* lisp/emacs-lisp/byte-opt.el (byte-optimize-set):
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--xx): New.
(bytecomp-tests--test-cases): Add test cases.
* test/lisp/emacs-lisp/bytecomp-resources/warn-variable-set-nonvariable.el:
Remove obsolete test.
lisp/emacs-lisp/byte-opt.el
test/lisp/emacs-lisp/bytecomp-resources/warn-variable-set-nonvariable.el [deleted file]
test/lisp/emacs-lisp/bytecomp-tests.el