emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master d29291d665: (macroexp--expand-all): Fix bug#53227 and bug#46636


From: Stefan Monnier
Subject: master d29291d665: (macroexp--expand-all): Fix bug#53227 and bug#46636
Date: Fri, 14 Jan 2022 12:26:36 -0500 (EST)

branch: master
commit d29291d665e808307126bf52c3e748fef78f0f9c
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    (macroexp--expand-all): Fix bug#53227 and bug#46636
    
    * lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Don't mis-expand
    invalid funcalls.
---
 lisp/emacs-lisp/macroexp.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el
index b44917f7d5..33ce55a3de 100644
--- a/lisp/emacs-lisp/macroexp.el
+++ b/lisp/emacs-lisp/macroexp.el
@@ -366,14 +366,18 @@ Assumes the caller has bound 
`macroexpand-all-environment'."
                              form)
           (macroexp--expand-all newform))))
 
-      (`(funcall . ,(or `(,exp . ,args) pcase--dontcare))
+      (`(funcall ,exp . ,args)
        (let ((eexp (macroexp--expand-all exp))
              (eargs (macroexp--all-forms args)))
          ;; Rewrite (funcall #'foo bar) to (foo bar), in case `foo'
          ;; has a compiler-macro, or to unfold it.
          (pcase eexp
-           (`#',f (macroexp--expand-all `(,f . ,eargs)))
+           ((and `#',f
+                 (guard (not (or (special-form-p f) (macrop f)))));; bug#46636
+            (macroexp--expand-all `(,f . ,eargs)))
            (_ `(funcall ,eexp . ,eargs)))))
+      (`(funcall . ,_) form)            ;bug#53227
+
       (`(,func . ,_)
        (let ((handler (function-get func 'compiler-macro))
              (funargs (function-get func 'funarg-positions)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]