]> git.eshelyaron.com Git - emacs.git/commitdiff
Suppress warnings during elisp completion macroexpansion
authorNoam Postavsky <npostavs@gmail.com>
Tue, 5 Dec 2017 01:01:40 +0000 (20:01 -0500)
committerNoam Postavsky <npostavs@gmail.com>
Mon, 11 Dec 2017 22:38:28 +0000 (17:38 -0500)
Errors are already suppressed, therefore it is logical to suppress
warnings as well.  Some macros (e.g., use-package) may produce
warnings when given the `elisp--witness--lisp' symbol.
* lisp/progmodes/elisp-mode.el (elisp--local-variables): Let-bind
warning-minimum-log-level to :emergency.

lisp/progmodes/elisp-mode.el

index 5ba097890974e03dd20a6cdd47c5cc63ecdfcec3..4207edb8af5440f9e0643d60df7a0fe58e61e79f 100644 (file)
@@ -307,6 +307,8 @@ Blank lines separate paragraphs.  Semicolons start comments.
           (setq sexp (ignore-errors (butlast sexp)))))
     res))
 
+(defvar warning-minimum-log-level)
+
 (defun elisp--local-variables ()
   "Return a list of locally let-bound variables at point."
   (save-excursion
@@ -328,7 +330,7 @@ Blank lines separate paragraphs.  Semicolons start comments.
                                      (error form))))
              (sexp
               (unwind-protect
-                  (progn
+                  (let ((warning-minimum-log-level :emergency))
                     (advice-add 'macroexpand :around macroexpand-advice)
                     (macroexpand-all sexp))
                 (advice-remove 'macroexpand macroexpand-advice)))