]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/emacs-lisp/macroexp.el (macroexp--expand-all):
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 26 Oct 2012 15:59:40 +0000 (11:59 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 26 Oct 2012 15:59:40 +0000 (11:59 -0400)
Obey byte-compile-warning-enabled-p.

Fixes: debbugs:12486
lisp/ChangeLog
lisp/emacs-lisp/macroexp.el

index 3c1638fd6f8ef6fe01ea17fb10a38d1696090252..3473dbf6233085a964709d5372ef91b86e32358c 100644 (file)
@@ -1,5 +1,8 @@
 2012-10-26  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+       * emacs-lisp/macroexp.el (macroexp--expand-all):
+       Obey byte-compile-warning-enabled-p (bug#12486).
+
        * vc/diff-mode.el (diff-end-of-hunk): Also skip potential "no LF at eol".
        (diff-refine-hunk): Similarly, handle the "no LF at eol" (bug#12584).
 
index cab693fecac4d95732185e703fbd10b4619e31cb..2a3730745c6a002da9b6af6ccd5d9b824429a57e 100644 (file)
@@ -154,11 +154,16 @@ Assumes the caller has bound `macroexpand-all-environment'."
             (if (and (not (eq form new-form)) ;It was a macro call.
                      (car-safe form)
                      (symbolp (car form))
-                     (get (car form) 'byte-obsolete-info))
+                     (get (car form) 'byte-obsolete-info)
+                     (or (not (fboundp 'byte-compile-warning-enabled-p))
+                         (byte-compile-warning-enabled-p 'obsolete)))
                 (let* ((fun (car form))
                        (obsolete (get fun 'byte-obsolete-info)))
                   (macroexp--warn-and-return
-                   (macroexp--obsolete-warning fun obsolete "macro")
+                   (macroexp--obsolete-warning
+                    fun obsolete
+                    (if (symbolp (symbol-function fun))
+                        "alias" "macro"))
                    new-form))
               new-form)))
     (pcase form