* lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Optimize away trivial

uses of `funcall'.
This commit is contained in:
Stefan Monnier 2014-11-05 22:16:41 -05:00
parent 9e48a95cf2
commit 4d5468e529
2 changed files with 11 additions and 2 deletions

View file

@ -251,6 +251,10 @@ Assumes the caller has bound `macroexpand-all-environment'."
(format "%s quoted with ' rather than with #'"
(list 'lambda (nth 1 f) '...))
(macroexp--expand-all `(,fun ,arg1 ,f . ,args))))
(`(funcall (,(or 'quote 'function) ,(and f (pred symbolp) . ,_)) . ,args)
;; Rewrite (funcall #'foo bar) to (foo bar), in case `foo'
;; has a compiler-macro.
(macroexp--expand-all `(,f . ,args)))
(`(,func . ,_)
;; Macro expand compiler macros. This cannot be delayed to
;; byte-optimize-form because the output of the compiler-macro can