]> git.eshelyaron.com Git - emacs.git/commit
(macroexp--unfold-lambda): Obey the lexbind semantics
authorStefan Monnier <monnier@iro.umontreal.ca>
Sat, 24 Jun 2023 21:53:41 +0000 (17:53 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sat, 24 Jun 2023 21:53:41 +0000 (17:53 -0400)
commite85ebb3d82466c5838e9c6836e6d8b5c8d0a7c33
tree8c2f375400a73620d77cedeaa87a80299d66afd3
parentf559bd1248a265662665c462b750eb5fc64dd811
(macroexp--unfold-lambda): Obey the lexbind semantics

While at it, rework the code so as not to rely on an
intermediate rewriting of (funcall (lambda ..) ...)
to ((lambda ..) ...) since that forms is deprecated.

* lisp/emacs-lisp/byte-opt.el (byte-optimize-funcall): Unfold lambdas
instead of turning them into the deprecated ((lambda ..) ..).
(byte-optimize-form-code-walker): Don't unfold ((lambda ..) ..) any more.
(byte-compile-inline-expand): Revert to non-optimized call if the unfolding
can't be optimized.

* lisp/emacs-lisp/bytecomp.el (byte-compile-form): Don't unfold
((lambda ..) ..) any more.

* lisp/emacs-lisp/cl-macs.el (cl--slet): Remove workaround.

* lisp/emacs-lisp/disass.el (disassemble): Make sure the code is
compiled with its own `lexical-binding` value.

* lisp/emacs-lisp/macroexp.el (macroexp--unfold-lambda): Make it work
both for ((lambda ..) ..) and for (funcall #'(lambda ..) ..).
Be careful not to move dynbound vars from `lambda` to `let`.
(macroexp--expand-all): Unfold (funcall #'(lambda ..) ..) instead of
turning it into ((lambda ..) ..).  Don't unfold ((lambda ..) ..) any more.
lisp/emacs-lisp/byte-opt.el
lisp/emacs-lisp/bytecomp.el
lisp/emacs-lisp/cl-macs.el
lisp/emacs-lisp/disass.el
lisp/emacs-lisp/macroexp.el