mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 06:20:55 -08:00
(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.
This commit is contained in:
parent
f559bd1248
commit
e85ebb3d82
5 changed files with 95 additions and 113 deletions
|
|
@ -251,10 +251,8 @@ The name is made by appending a number to PREFIX, default \"T\"."
|
|||
(if (macroexp--dynamic-variable-p (car binding)) (setq dyn t)))
|
||||
(cond
|
||||
(dyn
|
||||
;; FIXME: We use `identity' to obfuscate the code enough to
|
||||
;; circumvent the known bug in `macroexp--unfold-lambda' :-(
|
||||
`(funcall (identity (lambda (,@(mapcar #'car bindings))
|
||||
,@(macroexp-unprogn body)))
|
||||
`(funcall (lambda (,@(mapcar #'car bindings))
|
||||
,@(macroexp-unprogn body))
|
||||
,@(mapcar #'cadr bindings)))
|
||||
((null (cdr bindings))
|
||||
(macroexp-let* bindings body))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue