summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/macroexp.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2014-11-05 22:16:41 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2014-11-05 22:16:41 -0500
commit4d5468e5296ce42793a86808c62af8f99f556cba (patch)
treebe214ef06998244d1b8c14693bb0955578fe5f15 /lisp/emacs-lisp/macroexp.el
parent9e48a95cf29f39b30b03e946cdd05c7664053fd7 (diff)
downloademacs-4d5468e5296ce42793a86808c62af8f99f556cba.tar.gz
* lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Optimize away trivial
uses of `funcall'.
Diffstat (limited to 'lisp/emacs-lisp/macroexp.el')
-rw-r--r--lisp/emacs-lisp/macroexp.el4
1 files changed, 4 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el
index a96a7af77e8..fc859e7af09 100644
--- a/lisp/emacs-lisp/macroexp.el
+++ b/lisp/emacs-lisp/macroexp.el
@@ -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