* bug#58148: 29.0.50; Wrong number of arguments in keymap-set--anon-cmacro
@ 2022-09-28 18:03 Juri Linkov
2022-09-28 18:24 ` Lars Ingebrigtsen
0 siblings, 1 reply; 9+ messages in thread
From: Juri Linkov @ 2022-09-28 18:03 UTC (permalink / raw)
To: 58148
0. emacs -Q
1. Type in the *scratch*:
(keymap-set g
2. Then 'completion-at-point' with 'M-C-i'.
Debugger entered--Lisp error: (wrong-number-of-arguments (4 . 4) 2)
keymap-set--anon-cmacro((keymap-set elisp--witness--lisp) elisp--witness--lisp)
apply(keymap-set--anon-cmacro (keymap-set elisp--witness--lisp) elisp--witness--lisp)
macroexp--compiler-macro(keymap-set--anon-cmacro (keymap-set elisp--witness--lisp))
#f(compiled-function (form func) #<bytecode -0x1997929cc4a97ca0>)(((keymap-set elisp--witness--lisp)) keymap-set)
macroexp--expand-all((keymap-set elisp--witness--lisp))
macroexpand-all((keymap-set elisp--witness--lisp))
elisp--local-variables()
#f(compiled-function (string) #<bytecode -0x5dd040ab2d900d4>)(#("g" 0 1 (fontified t rear-nonsticky t)))
#f(compiled-function (string pred action) #<bytecode -0x131cb872953b2efd>)(#("g" 0 1 (fontified t rear-nonsticky t)) nil nil)
try-completion(#("g" 0 1 (fontified t rear-nonsticky t)) #f(compiled-function (string pred action) #<bytecode -0x131cb872953b2efd>) nil)
#f(compiled-function (table) #<bytecode 0x1635acab3bc82542>)(#f(compiled-function (string pred action) #<bytecode -0x131cb872953b2efd>))
mapcar(#f(compiled-function (table) #<bytecode 0x1635acab3bc82542>) (#f(compiled-function (string pred action) #<bytecode -0x131cb872953b2efd>) #f(compiled-function (&rest args2) #<bytecode -0x12a9d92cb5a883a4>)))
#f(compiled-function (string pred action) #<bytecode 0x59c9db15e8e1ece>)(#("g" 0 1 (fontified t rear-nonsticky t)) nil nil)
try-completion(#("g" 0 1 (fontified t rear-nonsticky t)) #f(compiled-function (string pred action) #<bytecode 0x59c9db15e8e1ece>) nil)
completion-basic-try-completion(#("g" 0 1 (rear-nonsticky t fontified t)) #f(compiled-function (string pred action) #<bytecode 0x59c9db15e8e1ece>) nil 1)
#f(compiled-function (style) #<bytecode 0x178271f9e5e4c041>)(basic)
completion--some(#f(compiled-function (style) #<bytecode 0x178271f9e5e4c041>) (basic partial-completion emacs22))
completion--nth-completion(1 #("g" 0 1 (rear-nonsticky t fontified t)) #f(compiled-function (string pred action) #<bytecode 0x59c9db15e8e1ece>) nil 1 (metadata))
completion-try-completion(#("g" 0 1 (rear-nonsticky t fontified t)) #f(compiled-function (string pred action) #<bytecode 0x59c9db15e8e1ece>) nil 1 (metadata))
completion--do-completion(#<marker at 158 in *scratch*> 159)
completion--in-region-1(#<marker at 158 in *scratch*> 159)
#f(compiled-function (start end collection predicate) #<bytecode -0xceba54d1e8420a4>)(#<marker at 158 in *scratch*> 159 #f(compiled-function (string pred action) #<bytecode 0x59c9db15e8e1ece>) nil)
apply(#f(compiled-function (start end collection predicate) #<bytecode -0xceba54d1e8420a4>) (#<marker at 158 in *scratch*> 159 #f(compiled-function (string pred action) #<bytecode 0x59c9db15e8e1ece>) nil))
#f(compiled-function (funs global args) #<bytecode -0xf63b519da3ae62>)(nil nil (#<marker at 158 in *scratch*> 159 #f(compiled-function (string pred action) #<bytecode 0x59c9db15e8e1ece>) nil))
completion--in-region(#<marker at 158 in *scratch*> 159 #f(compiled-function (string pred action) #<bytecode 0x59c9db15e8e1ece>) nil)
completion-in-region(#<marker at 158 in *scratch*> 159 #f(compiled-function (string pred action) #<bytecode 0x59c9db15e8e1ece>) nil)
completion-at-point()
funcall-interactively(completion-at-point)
command-execute(completion-at-point)
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#58148: 29.0.50; Wrong number of arguments in keymap-set--anon-cmacro
2022-09-28 18:03 bug#58148: 29.0.50; Wrong number of arguments in keymap-set--anon-cmacro Juri Linkov
@ 2022-09-28 18:24 ` Lars Ingebrigtsen
2022-09-28 19:34 ` Juri Linkov
0 siblings, 1 reply; 9+ messages in thread
From: Lars Ingebrigtsen @ 2022-09-28 18:24 UTC (permalink / raw)
To: Juri Linkov; +Cc: 58148
Juri Linkov <juri@linkov.net> writes:
> 1. Type in the *scratch*:
>
> (keymap-set g
>
> 2. Then 'completion-at-point' with 'M-C-i'.
>
> Debugger entered--Lisp error: (wrong-number-of-arguments (4 . 4) 2)
I'm unable to reproduce the problem. Do you still see it after a "make
bootstrap"?
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#58148: 29.0.50; Wrong number of arguments in keymap-set--anon-cmacro
2022-09-28 18:24 ` Lars Ingebrigtsen
@ 2022-09-28 19:34 ` Juri Linkov
2022-09-29 10:34 ` Lars Ingebrigtsen
0 siblings, 1 reply; 9+ messages in thread
From: Juri Linkov @ 2022-09-28 19:34 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: 58148
>> 1. Type in the *scratch*:
>>
>> (keymap-set g
>>
>> 2. Then 'completion-at-point' with 'M-C-i'.
>>
>> Debugger entered--Lisp error: (wrong-number-of-arguments (4 . 4) 2)
>
> I'm unable to reproduce the problem. Do you still see it after a "make
> bootstrap"?
Hmm, still fails after bootstrap in the latest master:
Debugger entered--Lisp error: (wrong-number-of-arguments #<subr keymap-set--anon-cmacro> 2)
keymap-set--anon-cmacro((keymap-set elisp--witness--lisp) elisp--witness--lisp)
In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo
version 1.16.0, Xaw3d scroll bars) of 2022-09-28
Repository revision: b6a163ba7cdf57eff5542b4cb6956780ebb2880f
Repository branch: master
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#58148: 29.0.50; Wrong number of arguments in keymap-set--anon-cmacro
2022-09-28 19:34 ` Juri Linkov
@ 2022-09-29 10:34 ` Lars Ingebrigtsen
2022-09-29 15:30 ` Juri Linkov
0 siblings, 1 reply; 9+ messages in thread
From: Lars Ingebrigtsen @ 2022-09-29 10:34 UTC (permalink / raw)
To: Juri Linkov; +Cc: 58148
Juri Linkov <juri@linkov.net> writes:
> Hmm, still fails after bootstrap in the latest master:
>
> Debugger entered--Lisp error: (wrong-number-of-arguments #<subr keymap-set--anon-cmacro> 2)
> keymap-set--anon-cmacro((keymap-set elisp--witness--lisp) elisp--witness--lisp)
There was another report of something similar, but that seemed to have
something to do with previously compiled packages, which is why I
thought this might be a stale .elc problem.
I'm wondering why I'm not seeing the issue then -- I tried a "make
bootstrap" and then "emacs -Q" and the recipe, and didn't get any errors.
> In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo
> version 1.16.0, Xaw3d scroll bars) of 2022-09-28
> Repository revision: b6a163ba7cdf57eff5542b4cb6956780ebb2880f
> Repository branch: master
I've got:
In GNU Emacs 29.0.50 (build 41, x86_64-pc-linux-gnu, GTK+ Version
3.24.33, cairo version 1.16.0) of 2022-09-28 built on joga
Repository revision: 1254d9a3ae89697b591343de2ddf55c5879bc937
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101003
System Description: Ubuntu 22.04.1 LTS
Could possibly a toolkit version make any difference here? That would
be really weird.
Hm... anybody have any ideas?
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#58148: 29.0.50; Wrong number of arguments in keymap-set--anon-cmacro
2022-09-29 10:34 ` Lars Ingebrigtsen
@ 2022-09-29 15:30 ` Juri Linkov
2022-09-30 12:37 ` Lars Ingebrigtsen
0 siblings, 1 reply; 9+ messages in thread
From: Juri Linkov @ 2022-09-29 15:30 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: 58148
>> Hmm, still fails after bootstrap in the latest master:
>>
>> Debugger entered--Lisp error: (wrong-number-of-arguments #<subr keymap-set--anon-cmacro> 2)
>> keymap-set--anon-cmacro((keymap-set elisp--witness--lisp) elisp--witness--lisp)
>
> There was another report of something similar, but that seemed to have
> something to do with previously compiled packages, which is why I
> thought this might be a stale .elc problem.
>
> I'm wondering why I'm not seeing the issue then -- I tried a "make
> bootstrap" and then "emacs -Q" and the recipe, and didn't get any errors.
Sorry, I had an additional setting more than -Q:
(setq debug-on-error t)
I thought it's required to see errors in -Q, because without
debug-on-error, the errors are hidden in *Messages*. And
indeed in this case without debug-on-error *Messages* contains:
Warning: Optimization failure for keymap-set: Handler: keymap-set--anon-cmacro
(wrong-number-of-arguments #<subr keymap-set--anon-cmacro> 2)
Making completion list...
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#58148: 29.0.50; Wrong number of arguments in keymap-set--anon-cmacro
2022-09-29 15:30 ` Juri Linkov
@ 2022-09-30 12:37 ` Lars Ingebrigtsen
2022-10-01 19:17 ` Juri Linkov
0 siblings, 1 reply; 9+ messages in thread
From: Lars Ingebrigtsen @ 2022-09-30 12:37 UTC (permalink / raw)
To: Juri Linkov; +Cc: 58148
Juri Linkov <juri@linkov.net> writes:
> Sorry, I had an additional setting more than -Q:
>
> (setq debug-on-error t)
>
> I thought it's required to see errors in -Q, because without
> debug-on-error, the errors are hidden in *Messages*. And
> indeed in this case without debug-on-error *Messages* contains:
>
> Warning: Optimization failure for keymap-set: Handler: keymap-set--anon-cmacro
> (wrong-number-of-arguments #<subr keymap-set--anon-cmacro> 2)
> Making completion list...
Still not seeing the problem, unfortunately --
emacs -Q
M-: (setq debug-on-error t)
(keymap-set d `C-M-i'
No errors, and nothing in *Messages*, with or without debug-on-error.
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#58148: 29.0.50; Wrong number of arguments in keymap-set--anon-cmacro
2022-09-30 12:37 ` Lars Ingebrigtsen
@ 2022-10-01 19:17 ` Juri Linkov
0 siblings, 0 replies; 9+ messages in thread
From: Juri Linkov @ 2022-10-01 19:17 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: 58148
>> Warning: Optimization failure for keymap-set: Handler: keymap-set--anon-cmacro
>> (wrong-number-of-arguments #<subr keymap-set--anon-cmacro> 2)
>
> Still not seeing the problem, unfortunately --
>
> emacs -Q
> M-: (setq debug-on-error t)
>
> (keymap-set d `C-M-i'
>
> No errors, and nothing in *Messages*, with or without debug-on-error.
I tried again to bootstrap with extra clean, but still the same error.
We need someone to try this out too that could help to clarify
where is the problem 🧐
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#58396: 29.0.50; Optimization failure for add-to-list
@ 2022-10-09 16:20 German Pacenza
2022-10-10 8:25 ` Lars Ingebrigtsen
0 siblings, 1 reply; 9+ messages in thread
From: German Pacenza @ 2022-10-09 16:20 UTC (permalink / raw)
To: 58396
emacs -Q
(setq tab-always-indent 'complete)
(add-to-list pac ;; without the quote. Press TAB after the 'c'
Result:
Completion succeeds but I get the following in the echo area:
Warning: Optimization failure for add-to-list: Handler: add-to-list--anon-cmacro
(wrong-number-of-arguments #<subr add-to-list--anon-cmacro> 2)
With toggle-debug-on-error:
Debugger entered--Lisp error: (wrong-number-of-arguments #<subr add-to-list--anon-cmacro> 2)
add-to-list--anon-cmacro((add-to-list elisp--witness--lisp) elisp--witness--lisp)
apply(add-to-list--anon-cmacro (add-to-list elisp--witness--lisp) elisp--witness--lisp)
macroexp--compiler-macro(add-to-list--anon-cmacro (add-to-list elisp--witness--lisp))
macroexp--expand-all((add-to-list elisp--witness--lisp))
macroexpand-all((add-to-list elisp--witness--lisp))
elisp--local-variables()
#f(compiled-function (string) #<bytecode -0x5fa893eaaf40814>)(#("pac" 0 3 (fontified t)))
#f(compiled-function (string pred action) #<bytecode -0x14ed6e54e1050bfd>)(#("pac" 0 3 (fontified t)) nil nil)
try-completion(#("pac" 0 3 (fontified t)) #f(compiled-function (string pred action) #<bytecode -0x14ed6e54e1050bfd>) nil)
#f(compiled-function (table) #<bytecode 0x163689b2ac80c2c2>)(#f(compiled-function (string pred action) #<bytecode -0x14ed6e54e1050bfd>))
mapcar(#f(compiled-function (table) #<bytecode 0x163689b2ac80c2c2>) (#f(compiled-function (string pred action) #<bytecode -0x14ed6e54e1050bfd>) #f(compiled-function (&rest args2) #<bytecode -0x8019f0ea8564a64>)))
#f(compiled-function (string pred action) #<bytecode -0x18f4dd5c4c465f31>)(#("pac" 0 3 (fontified t)) nil nil)
completion-basic-try-completion(#("pac" 0 3 (fontified t)) #f(compiled-function (string pred action) #<bytecode -0x18f4dd5c4c465f31>) nil 3)
#f(compiled-function (style) #<bytecode 0x178204c4fc0cae41>)(basic)
completion--some(#f(compiled-function (style) #<bytecode 0x178204c4fc0cae41>) (basic partial-completion emacs22))
completion--nth-completion(1 #("pac" 0 3 (fontified t)) #f(compiled-function (string pred action) #<bytecode -0x18f4dd5c4c465f31>) nil 3 (metadata))
completion-try-completion(#("pac" 0 3 (fontified t)) #f(compiled-function (string pred action) #<bytecode -0x18f4dd5c4c465f31>) nil 3 (metadata))
completion--do-completion(#<marker at 194 in *scratch*> 197)
completion--in-region-1(#<marker at 194 in *scratch*> 197)
#f(compiled-function (start end collection predicate) #<bytecode 0x3790782fa7b3d68>)(#<marker at 194 in *scratch*> 197 #f(compiled-function (string pred action) #<bytecode -0x18f4dd5c4c465f31>) nil)
apply(#f(compiled-function (start end collection predicate) #<bytecode 0x3790782fa7b3d68>) (#<marker at 194 in *scratch*> 197 #f(compiled-function (string pred action) #<bytecode -0x18f4dd5c4c465f31>) nil))
#f(compiled-function (funs global args) #<bytecode -0xf600c7e743d322>)(nil nil (#<marker at 194 in *scratch*> 197 #f(compiled-function (string pred action) #<bytecode -0x18f4dd5c4c465f31>) nil))
completion--in-region(#<marker at 194 in *scratch*> 197 #f(compiled-function (string pred action) #<bytecode -0x18f4dd5c4c465f31>) nil)
completion-in-region(#<marker at 194 in *scratch*> 197 #f(compiled-function (string pred action) #<bytecode -0x18f4dd5c4c465f31>) nil)
completion-at-point()
indent-for-tab-command(nil)
funcall-interactively(indent-for-tab-command nil)
command-execute(indent-for-tab-command)
In GNU Emacs 29.0.50 (build 15, x86_64-pc-linux-gnu, GTK+ Version
3.24.34, cairo version 1.17.6) of 2022-10-08 built on KRONOS
Repository revision: 84945e86be6b8dc8237983de901eb677bee3ae8b
Repository branch: master
System Description: Manjaro Linux
Configured using:
'configure --without-modules --without-libotf --without-m17n-flt
--without-gconf --with-pgtk --with-sound=no --without-gpm
--with-native-compilation --without-gsettings --without-libsystemd
--without-sqlite3 --without-xim --without-compress-install
--prefix=/home/german/.local/emacs'
Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS HARFBUZZ JPEG JSON LCMS2
LIBXML2 NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP THREADS
TIFF TOOLKIT_SCROLL_BARS WEBP XIM GTK3 ZLIB
Important settings:
value of $LC_MONETARY: es_AR.UTF-8
value of $LC_NUMERIC: es_AR.UTF-8
value of $LC_TIME: es_AR.UTF-8
value of $LANG: en_US.UTF-8
locale-coding-system: utf-8-unix
Major mode: Lisp Interaction
Minor modes in effect:
savehist-mode: t
electric-pair-mode: t
vertico-multiform-mode: t
vertico-mode: t
popper-mode: t
minibuffer-depth-indicate-mode: t
delete-selection-mode: t
straight-use-package-mode: t
straight-package-neutering-mode: t
straight-live-modifications-mode: t
global-so-long-mode: t
tooltip-mode: t
global-eldoc-mode: t
eldoc-mode: t
show-paren-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
line-number-mode: t
transient-mark-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
Load-path shadows:
/home/german/.emacs.d/straight/build/transient/transient hides /home/german/.local/emacs/share/emacs/29.0.50/lisp/transient
Features:
(shadow sort mail-extr emacsbug smerge-mode diff face-remap mm-archive
mule-util edmacro kmacro notmuch notmuch-tree notmuch-jump notmuch-hello
wid-edit notmuch-show notmuch-print notmuch-crypto notmuch-mua
notmuch-message notmuch-draft notmuch-maildir-fcc notmuch-address
notmuch-company notmuch-parser format-spec notmuch-wash diff-mode coolj
goto-addr thingatpt icalendar diary-lib diary-loaddefs cal-menu calendar
cal-loaddefs notmuch-tag crm notmuch-lib notmuch-version notmuch-compat
hl-line message sendmail yank-media dired dired-loaddefs rfc822 mml
mailabbrev mail-utils gmm-utils mailheader mm-view mml-smime mml-sec epa
derived epg rfc6068 epg-config gnus-util text-property-search time-date
smime password-cache gnutls puny dig mm-decode mm-bodies mm-encode
mailcap mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr
savehist comp comp-cstr warnings icons rx elec-pair vertico-flat
vertico-grid vertico-multiform pcase vertico helpful-autoloads
elisp-refs-autoloads f-autoloads s-autoloads popper popper-autoloads
magit-autoloads magit-section-autoloads git-commit-autoloads
with-editor-autoloads transient-autoloads dash-autoloads
agitate-autoloads elfeed-autoloads vertico-autoloads embark-autoloads
consult-autoloads compat-autoloads mb-depth orderless-autoloads info
delsel xah-fly-keys easy-mmode xah-fly-keys-autoloads
rainbow-mode-autoloads g3r-dark-theme straight-autoloads cl-seq cl-extra
help-mode straight subr-x cl-macs gv bytecomp byte-compile cconv so-long
cl-loaddefs cl-lib rmc iso-transl tooltip eldoc paren electric uniquify
ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/pgtk-win
pgtk-win term/common-win pgtk-dnd tool-bar dnd fontset image regexp-opt
fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode
register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice seq simple cl-generic indonesian philippine
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs faces cus-face macroexp files window
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget keymap hashtable-print-readable backquote threads dbusbind
inotify dynamic-setting font-render-setting cairo gtk pgtk lcms2
multi-tty make-network-process native-compile emacs)
Memory information:
((conses 16 149476 70469)
(symbols 48 12413 2)
(strings 32 37772 11828)
(string-bytes 1 1409276)
(vectors 16 22922)
(vector-slots 8 456664 164114)
(floats 8 64 237)
(intervals 56 354 80)
(buffers 1000 11))
--
German Pacenza
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#58396: 29.0.50; Optimization failure for add-to-list
2022-10-09 16:20 bug#58396: 29.0.50; Optimization failure for add-to-list German Pacenza
@ 2022-10-10 8:25 ` Lars Ingebrigtsen
2022-10-10 8:34 ` Lars Ingebrigtsen
0 siblings, 1 reply; 9+ messages in thread
From: Lars Ingebrigtsen @ 2022-10-10 8:25 UTC (permalink / raw)
To: German Pacenza; +Cc: 58396
German Pacenza <germanp82@hotmail.com> writes:
> emacs -Q
> (setq tab-always-indent 'complete)
> (add-to-list pac ;; without the quote. Press TAB after the 'c'
>
> Result:
> Completion succeeds but I get the following in the echo area:
> Warning: Optimization failure for add-to-list: Handler: add-to-list--anon-cmacro
> (wrong-number-of-arguments #<subr add-to-list--anon-cmacro> 2)
>
> With toggle-debug-on-error:
>
> Debugger entered--Lisp error: (wrong-number-of-arguments #<subr add-to-list--anon-cmacro> 2)
This seems like it's the same problem as reported in bug#58148 (so I'm
merging the two reports).
(And now I'm able to reproduce the problem.)
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#58396: 29.0.50; Optimization failure for add-to-list
2022-10-10 8:25 ` Lars Ingebrigtsen
@ 2022-10-10 8:34 ` Lars Ingebrigtsen
2022-10-10 14:59 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 9+ messages in thread
From: Lars Ingebrigtsen @ 2022-10-10 8:34 UTC (permalink / raw)
To: German Pacenza; +Cc: 58396, Stefan Monnier
Lars Ingebrigtsen <larsi@gnus.org> writes:
>> emacs -Q
>> (setq tab-always-indent 'complete)
>> (add-to-list pac ;; without the quote. Press TAB after the 'c'
>>
>> Result:
>> Completion succeeds but I get the following in the echo area:
>> Warning: Optimization failure for add-to-list: Handler:
>> add-to-list--anon-cmacro
>> (wrong-number-of-arguments #<subr add-to-list--anon-cmacro> 2)
>>
>> With toggle-debug-on-error:
>>
>> Debugger entered--Lisp error: (wrong-number-of-arguments #<subr
>> add-to-list--anon-cmacro> 2)
>
> This seems like it's the same problem as reported in bug#58148 (so I'm
> merging the two reports).
I don't quite understand the calling sequence how we end up here; I've
added Stefan to the CCs -- he wrote `elisp--local-variables' back in
2014:
Debugger entered--Lisp error: (wrong-number-of-arguments ((t) (form keymap key definition) (ignore keymap key definition) (keymap--compile-check key) form) 2)
keymap-set--anon-cmacro((keymap-set elisp--witness--lisp) elisp--witness--lisp)
apply(keymap-set--anon-cmacro (keymap-set elisp--witness--lisp) elisp--witness--lisp)
macroexp--compiler-macro(keymap-set--anon-cmacro (keymap-set elisp--witness--lisp))
#f(compiled-function (form func) #<bytecode -0x18f8a3887af7552>)(((keymap-set elisp--witness--lisp)) keymap-set)
macroexp--expand-all((keymap-set elisp--witness--lisp))
macroexpand-all((keymap-set elisp--witness--lisp))
elisp--local-variables()
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#58396: 29.0.50; Optimization failure for add-to-list
2022-10-10 8:34 ` Lars Ingebrigtsen
@ 2022-10-10 14:59 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-11 0:28 ` Lars Ingebrigtsen
0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-10-10 14:59 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: German Pacenza, 58396
Lars Ingebrigtsen [2022-10-10 10:34:15] wrote:
> Lars Ingebrigtsen <larsi@gnus.org> writes:
>
>>> emacs -Q
>>> (setq tab-always-indent 'complete)
>>> (add-to-list pac ;; without the quote. Press TAB after the 'c'
>>>
>>> Result:
>>> Completion succeeds but I get the following in the echo area:
>>> Warning: Optimization failure for add-to-list: Handler:
>>> add-to-list--anon-cmacro
>>> (wrong-number-of-arguments #<subr add-to-list--anon-cmacro> 2)
>>>
>>> With toggle-debug-on-error:
>>>
>>> Debugger entered--Lisp error: (wrong-number-of-arguments #<subr
>>> add-to-list--anon-cmacro> 2)
>>
>> This seems like it's the same problem as reported in bug#58148 (so I'm
>> merging the two reports).
>
> I don't quite understand the calling sequence how we end up here; I've
> added Stefan to the CCs -- he wrote `elisp--local-variables' back in
> 2014:
>
> Debugger entered--Lisp error: (wrong-number-of-arguments ((t) (form keymap
> key definition) (ignore keymap key definition) (keymap--compile-check key)
> form) 2)
> keymap-set--anon-cmacro((keymap-set elisp--witness--lisp) elisp--witness--lisp)
> apply(keymap-set--anon-cmacro (keymap-set elisp--witness--lisp) elisp--witness--lisp)
> macroexp--compiler-macro(keymap-set--anon-cmacro (keymap-set elisp--witness--lisp))
> #f(compiled-function (form func)
> #<bytecode -0x18f8a3887af7552>)(((keymap-set elisp--witness--lisp))
> keymap-set)
> macroexp--expand-all((keymap-set elisp--witness--lisp))
> macroexpand-all((keymap-set elisp--witness--lisp))
> elisp--local-variables()
Hmm... we should arrange for this `macroexpand-all` call not to emit any
messages (and it should arguably also skip the compiler-macros) since we
know it'll often be used on code that's not (yet) valid.
I'm not sure which part you don't understand above, so I'll only explain
the general situation: to allow completion of local variable names, we
analyze the surrounding code, but in order to do that without having to
write ad-hoc code that knows about all the macros out there that can
introduce new vars, we take the "surrounding code" and macroexpand the
hell out of it so that we can then traverse the result looking only for
`let/let*/lambda/condition-case`.
Stefan
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#58396: 29.0.50; Optimization failure for add-to-list
2022-10-10 14:59 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-10-11 0:28 ` Lars Ingebrigtsen
2022-10-11 3:46 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 9+ messages in thread
From: Lars Ingebrigtsen @ 2022-10-11 0:28 UTC (permalink / raw)
To: Stefan Monnier; +Cc: German Pacenza, 58396
Stefan Monnier <monnier@iro.umontreal.ca> writes:
> I'm not sure which part you don't understand above, so I'll only explain
> the general situation: to allow completion of local variable names, we
> analyze the surrounding code, but in order to do that without having to
> write ad-hoc code that knows about all the macros out there that can
> introduce new vars, we take the "surrounding code" and macroexpand the
> hell out of it so that we can then traverse the result looking only for
> `let/let*/lambda/condition-case`.
But why is it calling add-to-list--anon-cmacro with the wrong number of
parameters?
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#58396: 29.0.50; Optimization failure for add-to-list
2022-10-11 0:28 ` Lars Ingebrigtsen
@ 2022-10-11 3:46 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-11 18:27 ` Lars Ingebrigtsen
0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-10-11 3:46 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: German Pacenza, 58396
Lars Ingebrigtsen [2022-10-11 02:28:40] wrote:
> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> I'm not sure which part you don't understand above, so I'll only explain
>> the general situation: to allow completion of local variable names, we
>> analyze the surrounding code, but in order to do that without having to
>> write ad-hoc code that knows about all the macros out there that can
>> introduce new vars, we take the "surrounding code" and macroexpand the
>> hell out of it so that we can then traverse the result looking only for
>> `let/let*/lambda/condition-case`.
>
> But why is it calling add-to-list--anon-cmacro with the wrong number of
> parameters?
Because that's the sort of error you can get if you try to macro-expand
code that's syntactically invalid. E.g. try to compile a file with
(add-to-list x)
and you should see a similar error. For `elisp--local-variables`,
syntactically invalid code is the normal case (more or less) both
because it's used when we're in the middle of writing the code, and also
because of how it works (it takes the code from beginning-of-defun up
to point and throws away whatever follows, just adding enough closing
parens that the resutling string is `read`able).
Stefan
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#58396: 29.0.50; Optimization failure for add-to-list
2022-10-11 3:46 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-10-11 18:27 ` Lars Ingebrigtsen
2022-10-11 19:13 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 9+ messages in thread
From: Lars Ingebrigtsen @ 2022-10-11 18:27 UTC (permalink / raw)
To: Stefan Monnier; +Cc: German Pacenza, 58396
Stefan Monnier <monnier@iro.umontreal.ca> writes:
> Because that's the sort of error you can get if you try to macro-expand
> code that's syntactically invalid. E.g. try to compile a file with
>
> (add-to-list x)
>
> and you should see a similar error. For `elisp--local-variables`,
> syntactically invalid code is the normal case (more or less) both
> because it's used when we're in the middle of writing the code, and also
> because of how it works (it takes the code from beginning-of-defun up
> to point and throws away whatever follows, just adding enough closing
> parens that the resutling string is `read`able).
I see.
Shouldn't this function then be suppressing all errors while it's doing
this exploratory macro-expansion stuff?
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#58396: 29.0.50; Optimization failure for add-to-list
2022-10-11 18:27 ` Lars Ingebrigtsen
@ 2022-10-11 19:13 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-12 10:54 ` Lars Ingebrigtsen
0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-10-11 19:13 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: German Pacenza, 58396
Lars Ingebrigtsen [2022-10-11 20:27:42] wrote:
> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> Because that's the sort of error you can get if you try to macro-expand
>> code that's syntactically invalid. E.g. try to compile a file with
>>
>> (add-to-list x)
>>
>> and you should see a similar error. For `elisp--local-variables`,
>> syntactically invalid code is the normal case (more or less) both
>> because it's used when we're in the middle of writing the code, and also
>> because of how it works (it takes the code from beginning-of-defun up
>> to point and throws away whatever follows, just adding enough closing
>> parens that the resutling string is `read`able).
>
> I see.
>
> Shouldn't this function then be suppressing all errors while it's doing
> this exploratory macro-expansion stuff?
Yes (plus silence the messages plus avoid compiler macros).
Stefan
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#58396: 29.0.50; Optimization failure for add-to-list
2022-10-11 19:13 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-10-12 10:54 ` Lars Ingebrigtsen
2023-09-26 20:30 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 9+ messages in thread
From: Lars Ingebrigtsen @ 2022-10-12 10:54 UTC (permalink / raw)
To: Stefan Monnier; +Cc: German Pacenza, 58396
Stefan Monnier <monnier@iro.umontreal.ca> writes:
> Yes (plus silence the messages plus avoid compiler macros).
Any chance that... someone... will do that? 😇
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#58396: 29.0.50; Optimization failure for add-to-list
2022-10-12 10:54 ` Lars Ingebrigtsen
@ 2023-09-26 20:30 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-26 21:32 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 9+ messages in thread
From: Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-26 20:30 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: German Pacenza, 58396, Stefan Monnier
[-- Attachment #1: Type: text/plain, Size: 415 bytes --]
Lars Ingebrigtsen <larsi@gnus.org> writes:
> Stefan Monnier <monnier@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.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Silence-macro-expansion-during-completion-at-point.patch --]
[-- Type: text/x-diff, Size: 2112 bytes --]
From 83387466cfb7fe859b227fb00148ee7f6cd288a5 Mon Sep 17 00:00:00 2001
From: Jens Schmidt <jschmidt4gnu@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
^ permalink raw reply related [flat|nested] 9+ messages in thread
* bug#58396: 29.0.50; Optimization failure for add-to-list
2023-09-26 20:30 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-26 21:32 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-26 21:48 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-26 21:32 UTC (permalink / raw)
To: Jens Schmidt; +Cc: German Pacenza, 58396, Lars Ingebrigtsen
> From 83387466cfb7fe859b227fb00148ee7f6cd288a5 Mon Sep 17 00:00:00 2001
> From: Jens Schmidt <jschmidt4gnu@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)
Thanks. I think it would be cleaner to introduce a variable in
`macroexp.el` which `elisp--local-variables` can bind and which
`macroexp.el` can check so we avoid (ab)using advice.
Stefan
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#58396: 29.0.50; Optimization failure for add-to-list
2023-09-26 21:32 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-26 21:48 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-26 22:06 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 9+ messages in thread
From: Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-26 21:48 UTC (permalink / raw)
To: Stefan Monnier; +Cc: German Pacenza, 58396, Lars Ingebrigtsen
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> From 83387466cfb7fe859b227fb00148ee7f6cd288a5 Mon Sep 17 00:00:00 2001
>> From: Jens Schmidt <jschmidt4gnu@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)
>
> Thanks. I think it would be cleaner to introduce a variable in
> `macroexp.el` which `elisp--local-variables` can bind and which
> `macroexp.el` can check so we avoid (ab)using advice.
What about naming it `macroexp-inhibit-compiler-macros´?
I also wanted to ask whether to extend that approach to the other advice
installed in `elisp--local-variables´ but then noticed that
`macroexpand´ is actually a built-in. Which would be a bit over my head
...
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#58396: 29.0.50; Optimization failure for add-to-list
2023-09-26 21:48 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-26 22:06 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-30 10:39 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-26 22:06 UTC (permalink / raw)
To: Jens Schmidt; +Cc: German Pacenza, 58396, Lars Ingebrigtsen
> What about naming it `macroexp-inhibit-compiler-macros´?
Perfect!
> I also wanted to ask whether to extend that approach to the other advice
> installed in `elisp--local-variables´
That would be nice, but...
> but then noticed that `macroexpand´ is actually a built-in.
`elisp--local-variables´ doesn't use that built-in any more, it uses
`macroexpand-1` instead, which is implemented in `macroexp.el` :-)
But the problem is that the advice wraps the call within
a `condition-case` and that's inconvenient to do in a way which
doesn't interfere too much with "normal use" (e.g. doesn't hide/catch
errors when we don't want to, and doesn't impose too much of
a performance cost either).
Then again, maybe I'm worrying about nothing.
Stefan
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#58396: 29.0.50; Optimization failure for add-to-list
2023-09-26 22:06 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-30 10:39 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-30 14:26 ` Eli Zaretskii
0 siblings, 1 reply; 9+ messages in thread
From: Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-30 10:39 UTC (permalink / raw)
To: Stefan Monnier; +Cc: German Pacenza, 58396, Lars Ingebrigtsen
[-- Attachment #1: Type: text/plain, Size: 1100 bytes --]
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> I also wanted to ask whether to extend that approach to the other advice
>> installed in `elisp--local-variables´
>
> That would be nice, but...
>
>> but then noticed that `macroexpand´ is actually a built-in.
>
> `elisp--local-variables´ doesn't use that built-in any more, it uses
> `macroexpand-1` instead, which is implemented in `macroexp.el` :-)
>
> But the problem is that the advice wraps the call within
> a `condition-case` and that's inconvenient to do in a way which
> doesn't interfere too much with "normal use" (e.g. doesn't hide/catch
> errors when we don't want to, and doesn't impose too much of
> a performance cost either).
Agreed.
Anyway, here are two patches: One for Emacs 29 and one for master.
The patch for Emacs 29:
- does not contain the rather non-local change for avoiding compiler
macros. But it fixes this bug, anyway, by just ignoring all errors
during the `macroexpand-all' call.
- contains a "don't merge to master" maker in the commit message.
What do you think?
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-29-Silence-macro-expansion-during-completion-at-point.patch --]
[-- Type: text/x-diff, Size: 1854 bytes --]
From cc663ccb14f3fae361733fe9742d7c7d07274d54 Mon Sep 17 00:00:00 2001
From: Jens Schmidt <jschmidt4gnu@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. Suppress all errors during macro expansion. (Bug#58396)
Do not merge to master.
---
lisp/progmodes/elisp-mode.el | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index bd3916ce108..bc01058ff3c 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -445,11 +445,19 @@ elisp--local-variables
(condition-case nil
(apply expander form args)
(error form))))
+ ;; Avoid any macro expansion errors when attempting
+ ;; completion at point (bug#58148). As Stefan suggested
+ ;; there: Silence messages [1] and suppress all errors
+ ;; [3]. (Not avoiding compiler macros in the current
+ ;; release branch, though.)
(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))
+ (condition-case nil ;[3]
+ (macroexpand-all sexp)
+ (t sexp)))
(advice-remove 'macroexpand macroexpand-advice)))
(vars (elisp--local-variables-1 nil sexp)))
(delq nil
--
2.30.2
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0001-30-Silence-macro-expansion-during-completion-at-point.patch --]
[-- Type: text/x-diff, Size: 3341 bytes --]
From feb9906cece4a1fbce6417e9225a937aa7e8c830 Mon Sep 17 00:00:00 2001
From: Jens Schmidt <jschmidt4gnu@vodafonemail.de>
Date: Fri, 29 Sep 2023 22:04:43 +0200
Subject: [PATCH] Silence macro expansion during completion-at-point
* lisp/emacs-lisp/macroexp.el (macroexp-inhibit-compiler-macros): Add
variable.
(macroexp--compiler-macro): Inspect that new variable and, if it is
non-nil, return the input form unchanged.
* lisp/progmodes/elisp-mode.el (elisp--local-variables): Silence
messages. Avoid compiler macros. Suppress all errors during macro
expansion. (Bug#58396)
---
lisp/emacs-lisp/macroexp.el | 20 ++++++++++++++------
lisp/progmodes/elisp-mode.el | 12 ++++++++++--
2 files changed, 24 insertions(+), 8 deletions(-)
diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el
index 3ef924a5c73..6eb670d6dc1 100644
--- a/lisp/emacs-lisp/macroexp.el
+++ b/lisp/emacs-lisp/macroexp.el
@@ -105,13 +105,21 @@ macroexp--all-clauses
(macroexp--all-forms clause skip)
clause)))
+(defvar macroexp-inhibit-compiler-macros nil
+ "Inhibit application of compiler macros if non-nil.")
+
(defun macroexp--compiler-macro (handler form)
- (condition-case-unless-debug err
- (apply handler form (cdr form))
- (error
- (message "Warning: Optimization failure for %S: Handler: %S\n%S"
- (car form) handler err)
- form)))
+ "Apply compiler macro HANDLER to FORM and return the result.
+Unless `macroexp-inhibit-compiler-macros' is non-nil, in which
+case return FORM unchanged."
+ (if macroexp-inhibit-compiler-macros
+ form
+ (condition-case-unless-debug err
+ (apply handler form (cdr form))
+ (error
+ (message "Warning: Optimization failure for %S: Handler: %S\n%S"
+ (car form) handler err)
+ form))))
(defun macroexp--funcall-if-compiled (_form)
"Pseudo function used internally by macroexp to delay warnings.
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index 664299df288..434b493ed55 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -458,11 +458,19 @@ elisp--local-variables
(apply expander form args)
((debug error)
(message "Ignoring macroexpansion error: %S" err) 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]
+ (macroexp-inhibit-compiler-macros t) ;[2]
+ (warning-minimum-log-level :emergency))
(advice-add 'macroexpand-1 :around macroexpand-advice)
- (macroexpand-all sexp elisp--local-macroenv))
+ (condition-case nil ;[3]
+ (macroexpand-all sexp elisp--local-macroenv)
+ (t sexp)))
(advice-remove 'macroexpand-1 macroexpand-advice)))
(vars (elisp--local-variables-1 nil sexp)))
(delq nil
--
2.30.2
^ permalink raw reply related [flat|nested] 9+ messages in thread
* bug#58396: 29.0.50; Optimization failure for add-to-list
2023-09-30 10:39 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-30 14:26 ` Eli Zaretskii
2023-09-30 18:51 ` bug#58148: 29.0.50; Wrong number of arguments in keymap-set--anon-cmacro Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2023-09-30 14:26 UTC (permalink / raw)
To: Jens Schmidt; +Cc: germanp82, 58396, larsi, monnier
> Cc: German Pacenza <germanp82@hotmail.com>, 58396@debbugs.gnu.org,
> Lars Ingebrigtsen <larsi@gnus.org>
> Date: Sat, 30 Sep 2023 12:39:57 +0200
> From: Jens Schmidt via "Bug reports for GNU Emacs,
> the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>
> >From cc663ccb14f3fae361733fe9742d7c7d07274d54 Mon Sep 17 00:00:00 2001
> From: Jens Schmidt <jschmidt4gnu@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. Suppress all errors during macro expansion. (Bug#58396)
>
> Do not merge to master.
> ---
> lisp/progmodes/elisp-mode.el | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
> index bd3916ce108..bc01058ff3c 100644
> --- a/lisp/progmodes/elisp-mode.el
> +++ b/lisp/progmodes/elisp-mode.el
> @@ -445,11 +445,19 @@ elisp--local-variables
> (condition-case nil
> (apply expander form args)
> (error form))))
> + ;; Avoid any macro expansion errors when attempting
> + ;; completion at point (bug#58148). As Stefan suggested
> + ;; there: Silence messages [1] and suppress all errors
> + ;; [3]. (Not avoiding compiler macros in the current
> + ;; release branch, though.)
Most of this comment should be in the commit log message, I think, and
the [1] and [3] markers should be replaced with text telling what that
does. Otherwise, the first patch is okay for the emacs-29 branch.
Regarding the second patch: if Stefan Monnier and Stefan Kangas are
okay with it, so am I.
Thanks.
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#58148: 29.0.50; Wrong number of arguments in keymap-set--anon-cmacro
2023-09-30 14:26 ` Eli Zaretskii
@ 2023-09-30 18:51 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-30 18:54 ` Eli Zaretskii
0 siblings, 1 reply; 9+ messages in thread
From: Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-30 18:51 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: germanp82, 58396, larsi, monnier, 58148
Eli Zaretskii <eliz@gnu.org> writes:
> Most of this comment should be in the commit log message, I think, and
> the [1] and [3] markers should be replaced with text telling what that
> does. Otherwise, the first patch is okay for the emacs-29 branch.
Updated the patch accordingly and sent it on that other branch of this
thread, please review. However, I removed the [1] and [3] markers
without replacement: I don't think that there is much need to separately
comment on a `condition-case' or a let-binding of `inhibit-message'.
> Regarding the second patch: if Stefan Monnier and Stefan Kangas are
> okay with it, so am I.
Does that mean that I should explicitly draw Stefan Kangas' attention to
this bug? Or would he notice somehow otherwise?
Thanks.
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#58148: 29.0.50; Wrong number of arguments in keymap-set--anon-cmacro
2023-09-30 18:51 ` bug#58148: 29.0.50; Wrong number of arguments in keymap-set--anon-cmacro Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-30 18:54 ` Eli Zaretskii
0 siblings, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2023-09-30 18:54 UTC (permalink / raw)
To: Jens Schmidt; +Cc: germanp82, 58396, larsi, monnier, 58148
> From: Jens Schmidt <jschmidt4gnu@vodafonemail.de>
> Cc: 58148@debbugs.gnu.org, germanp82@hotmail.com, 58396@debbugs.gnu.org,
> larsi@gnus.org, monnier@iro.umontreal.ca
> Date: Sat, 30 Sep 2023 20:51:25 +0200
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> > Most of this comment should be in the commit log message, I think, and
> > the [1] and [3] markers should be replaced with text telling what that
> > does. Otherwise, the first patch is okay for the emacs-29 branch.
>
> Updated the patch accordingly and sent it on that other branch of this
> thread, please review.
It's fine, thanks.
> > Regarding the second patch: if Stefan Monnier and Stefan Kangas are
> > okay with it, so am I.
>
> Does that mean that I should explicitly draw Stefan Kangas' attention to
> this bug? Or would he notice somehow otherwise?
Just wait for him to chime in, which will happen soon enough.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2023-09-30 18:54 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-28 18:03 bug#58148: 29.0.50; Wrong number of arguments in keymap-set--anon-cmacro Juri Linkov
2022-09-28 18:24 ` Lars Ingebrigtsen
2022-09-28 19:34 ` Juri Linkov
2022-09-29 10:34 ` Lars Ingebrigtsen
2022-09-29 15:30 ` Juri Linkov
2022-09-30 12:37 ` Lars Ingebrigtsen
2022-10-01 19:17 ` Juri Linkov
-- strict thread matches above, loose matches on Subject: below --
2022-10-09 16:20 bug#58396: 29.0.50; Optimization failure for add-to-list German Pacenza
2022-10-10 8:25 ` Lars Ingebrigtsen
2022-10-10 8:34 ` Lars Ingebrigtsen
2022-10-10 14:59 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-11 0:28 ` Lars Ingebrigtsen
2022-10-11 3:46 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-11 18:27 ` Lars Ingebrigtsen
2022-10-11 19:13 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-12 10:54 ` Lars Ingebrigtsen
2023-09-26 20:30 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-26 21:32 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-26 21:48 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-26 22:06 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-30 10:39 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-30 14:26 ` Eli Zaretskii
2023-09-30 18:51 ` bug#58148: 29.0.50; Wrong number of arguments in keymap-set--anon-cmacro Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-30 18:54 ` Eli Zaretskii
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.