summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/macroexp.el
diff options
context:
space:
mode:
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))