diff options
author | Tom Tromey <tromey@redhat.com> | 2013-06-13 11:29:06 -0600 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2013-06-13 11:29:06 -0600 |
commit | 5ccb7e7b1ea2ca7f6e45d00d839e19f22cc961da (patch) | |
tree | af9b79246f0b18d748c3e1c33b1bb1b33cf1fbe0 /lisp/emacs-lisp/macroexp.el | |
parent | 313dfb6277b3e1ef28c7bb76e776f10168e3f0a3 (diff) | |
parent | 94fa6ec7b306b47c251f7b8b67662598027a7ff3 (diff) | |
download | emacs-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.el | 15 |
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)) |