GNU bug report logs -
#58396
29.0.50; Optimization failure for add-to-list
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
>
>> Yes (plus silence the messages plus avoid compiler macros).
>
> Any chance that... someone... will do that? 😇
>
Hit this issue today. How about the attached patch, which seems to fix
it? I hope I understood Stefan's directions correctly.
BTW, bug#60081 could also be merged with this one.
[0001-Silence-macro-expansion-during-completion-at-point.patch (text/x-diff, inline)]
From 83387466cfb7fe859b227fb00148ee7f6cd288a5 Mon Sep 17 00:00:00 2001
From: Jens Schmidt <jschmidt4gnu <at> vodafonemail.de>
Date: Tue, 26 Sep 2023 22:26:15 +0200
Subject: [PATCH] Silence macro expansion during completion-at-point
* lisp/progmodes/elisp-mode.el (elisp--local-variables): Silence
messages. Avoid compiler macros. Suppress all errors during macro
expansion. (Bug#58396)
---
lisp/progmodes/elisp-mode.el | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index bd3916ce108..809df64a536 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -445,11 +445,23 @@ elisp--local-variables
(condition-case nil
(apply expander form args)
(error form))))
+ (macroexp--c-m-advice (lambda (_handler form) form))
+ ;; Avoid any macro expansion errors when attempting
+ ;; completion at point (bug#58148). As Stefan suggested
+ ;; there: Silence messages [1], avoid compiler macros
+ ;; [2], and suppress all errors [3].
(sexp
(unwind-protect
- (let ((warning-minimum-log-level :emergency))
+ (let ((inhibit-message t) ;[1]
+ (warning-minimum-log-level :emergency))
(advice-add 'macroexpand :around macroexpand-advice)
- (macroexpand-all sexp))
+ (advice-add 'macroexp--compiler-macro :override
+ macroexp--c-m-advice) ;[2]
+ (condition-case nil
+ (macroexpand-all sexp)
+ (t sexp))) ;[3]
+ (advice-remove 'macroexp--compiler-macro
+ macroexp--c-m-advice)
(advice-remove 'macroexpand macroexpand-advice)))
(vars (elisp--local-variables-1 nil sexp)))
(delq nil
--
2.30.2
This bug report was last modified 1 year and 320 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.