summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/macroexp.el
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-06-13 11:29:06 -0600
committerTom Tromey <tromey@redhat.com>2013-06-13 11:29:06 -0600
commit5ccb7e7b1ea2ca7f6e45d00d839e19f22cc961da (patch)
treeaf9b79246f0b18d748c3e1c33b1bb1b33cf1fbe0 /lisp/emacs-lisp/macroexp.el
parent313dfb6277b3e1ef28c7bb76e776f10168e3f0a3 (diff)
parent94fa6ec7b306b47c251f7b8b67662598027a7ff3 (diff)
downloademacs-5ccb7e7b1ea2ca7f6e45d00d839e19f22cc961da.tar.gz
emacs-5ccb7e7b1ea2ca7f6e45d00d839e19f22cc961da.tar.bz2
emacs-5ccb7e7b1ea2ca7f6e45d00d839e19f22cc961da.zip
merge from trunk
Diffstat (limited to 'lisp/emacs-lisp/macroexp.el')
-rw-r--r--lisp/emacs-lisp/macroexp.el15
1 files changed, 10 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el
index 6bb796434fd..e8b513fcd3e 100644
--- a/lisp/emacs-lisp/macroexp.el
+++ b/lisp/emacs-lisp/macroexp.el
@@ -111,15 +111,20 @@ and also to avoid outputting the warning during normal execution."
(funcall (eval (cadr form)))
(byte-compile-constant nil)))
+(defun macroexp--compiling-p ()
+ "Return non-nil if we're macroexpanding for the compiler."
+ ;; FIXME: ¡¡Major Ugly Hack!! To determine whether the output of this
+ ;; macro-expansion will be processed by the byte-compiler, we check
+ ;; circumstantial evidence.
+ (member '(declare-function . byte-compile-macroexpand-declare-function)
+ macroexpand-all-environment))
+
+
(defun macroexp--warn-and-return (msg form)
(let ((when-compiled (lambda () (byte-compile-log-warning msg t))))
(cond
((null msg) form)
- ;; FIXME: ¡¡Major Ugly Hack!! To determine whether the output of this
- ;; macro-expansion will be processed by the byte-compiler, we check
- ;; circumstantial evidence.
- ((member '(declare-function . byte-compile-macroexpand-declare-function)
- macroexpand-all-environment)
+ ((macroexp--compiling-p)
`(progn
(macroexp--funcall-if-compiled ',when-compiled)
,form))