1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

Merge branch 'master' into scratch/correct-warning-pos

Merge branch:
commit d29291d665 (HEAD -> master,
origin/master, origin/HEAD)
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Date:   Fri Jan 14 12:26:30 2022 -0500

    (macroexp--expand-all): Fix bug#53227 and bug#46636
This commit is contained in:
Alan Mackenzie 2022-01-14 19:28:07 +00:00
commit d87a34597c
73 changed files with 3248 additions and 311 deletions

View file

@ -382,14 +382,17 @@ Assumes the caller has bound `macroexpand-all-environment'."
(macroexp--all-forms args)
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)))
@ -430,7 +433,6 @@ Assumes the caller has bound `macroexpand-all-environment'."
newform
(macroexp--expand-all newform)))
(macroexp--expand-all newform))))))
(_ form)))
(pop byte-compile-form-stack)))