GNU bug report logs - #29573
26.0.90; Suppress warnings during elisp completion macroexpansion

Previous Next

Package: emacs;

Reported by: Noam Postavsky <npostavs <at> users.sourceforge.net>

Date: Tue, 5 Dec 2017 01:24:02 UTC

Severity: normal

Tags: fixed, patch

Found in version 26.0.90

Fixed in version 26.1

Done: Noam Postavsky <npostavs <at> users.sourceforge.net>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.0.90; Suppress warnings during elisp completion macroexpansion
Date: Mon, 04 Dec 2017 20:23:42 -0500
[Message part 1 (text/plain, inline)]
Tags: patch

Motivating example is use-package showing an error when given the
`elisp--witness-lisp' symbol by completion [1].

[1]: https://github.com/jwiegley/use-package/issues/524

[0001-Suppress-warnings-during-elisp-completion-macroexpan.patch (text/x-diff, inline)]
From d73b0094c205e8b5762dc5e5833abdfb5841348f Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs <at> gmail.com>
Date: Mon, 4 Dec 2017 20:01:40 -0500
Subject: [PATCH] Suppress warnings during elisp completion macroexpansion

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 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index 5ba0978909..4207edb8af 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -307,6 +307,8 @@ elisp--local-variables-1
           (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 @@ elisp--local-variables
                                      (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)))
-- 
2.11.0


This bug report was last modified 7 years and 166 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.