]> git.eshelyaron.com Git - emacs.git/commitdiff
Silence macro expansion during completion at point
authorJens Schmidt <jschmidt4gnu@vodafonemail.de>
Tue, 26 Sep 2023 20:26:15 +0000 (22:26 +0200)
committerStefan Monnier <monnier@iro.umontreal.ca>
Thu, 5 Oct 2023 18:00:20 +0000 (14:00 -0400)
To keep risk in the current release branch low, do not avoid compiler
macros as suggested by Stefan in the bug, but rather suppress all errors.

* lisp/progmodes/elisp-mode.el (elisp--local-variables): Silence
messages.  Suppress all errors during macro expansion.  (Bug#58148)

Do not merge to master.

lisp/progmodes/elisp-mode.el

index bd3916ce108486f04ac821fa6bb3d684d7ded4a9..354d98c50dc7e5615288897628302bc03124cffa 100644 (file)
@@ -447,9 +447,14 @@ be used instead.
                                      (error form))))
              (sexp
               (unwind-protect
-                  (let ((warning-minimum-log-level :emergency))
+                  ;; Silence any macro expansion errors when
+                  ;; attempting completion at point (bug#58148).
+                  (let ((inhibit-message t)
+                        (warning-minimum-log-level :emergency))
                     (advice-add 'macroexpand :around macroexpand-advice)
-                    (macroexpand-all sexp))
+                    (condition-case nil
+                        (macroexpand-all sexp)
+                      (error sexp)))
                 (advice-remove 'macroexpand macroexpand-advice)))
              (vars (elisp--local-variables-1 nil sexp)))
         (delq nil