GNU bug report logs - #60081
29.0.60; compiler-macros in keymap.el accept wrong number of arguments

Previous Next

Package: emacs;

Reported by: Zehao Hu <huzehao1998 <at> gmail.com>

Date: Thu, 15 Dec 2022 07:43:01 UTC

Severity: normal

Found in version 29.0.60

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 60081 in the body.
You can then email your comments to 60081 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#60081; Package emacs. (Thu, 15 Dec 2022 07:43:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Zehao Hu <huzehao1998 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 15 Dec 2022 07:43:01 GMT) Full text and rfc822 format available.

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

From: Zehao Hu <huzehao1998 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.60; compiler-macros in keymap.el accept wrong number of arguments
Date: Wed, 14 Dec 2022 23:23:57 +0800
[Message part 1 (text/plain, inline)]
Dear maintainer,

When I was trying the new function `keymap-set', a
"wrong-number-of-arguments" error occurred (see below) when
`company-capf' or `completion-at-point' tried to complete
the arguments.

The compiler macro confused me:
(declare (compiler-macro (lambda (form) (keymap--compile-check key) form)))

If I understand correctly, the compiler macro here should be like:
(lambda (form &optional keymap key definition)
  (keymap--compile-check key)
  form)
Or (lambda (form &rest args) ...) because `elisp--witness--lisp' would
be the argument when completing.

However the current one only accept one argument.
And most of compiler-macros in keymap.el (like keymap-global-*
keymap-local-*)
have similar problems.

Part of the backtrace:
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)
...


In GNU Emacs 29.0.60 (build 5, x86_64-pc-linux-gnu, GTK+ Version
 3.24.35, cairo version 1.17.6) of 2022-12-14 built on legion7
Repository revision: 1d3cbba7dfa26fc74df4d09d40a3cd7ba07279b4
Repository branch: emacs-29
Windowing system distributor 'The X.Org Foundation', version 11.0.12101004
System Description: Arch Linux

Configured using:
 'configure -C --with-xwidgets --with-json --with-tree-sitter
 --with-mailutils --with-small-ja-dic --with-cairo --with-x-toolkit=gtk3
 'CFLAGS=-march=native -mtune=generic -O2 -pipe -fno-plt -fexceptions
 -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security
 -fstack-clash-protection -fcf-protection -flto=auto'
 'LDFLAGS=-Wl,-O2,--sort-common,--as-needed,-z,relro,-z,now -flto=auto''

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY
PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS
TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM XWIDGETS GTK3 ZLIB

Important settings:
  value of $LANG: en_US
  value of $XMODIFIERS: @im=fcitx
  locale-coding-system: iso-latin-1-unix

Major mode: Fundamental

Minor modes in effect:
  zel-keys: t
  global-hl-line-mode: t
  org-roam-db-autosync-mode: t
  electric-pair-mode: t
  auto-insert-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  size-indication-mode: t
  column-number-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:
None found.

Features:
(shadow sort mail-extr emacsbug paredit edmacro kmacro company-oddmuse
company-keywords company-etags etags fileloop company-gtags
company-dabbrev-code company-dabbrev company-files company-clang
company-capf company-cmake company-semantic company-template
company-bbdb company pcase zel-keys xah-fly-keys dired-x finder-inf
org-ref org-ref-core org-ref-glossary org-ref-bibtex avy doi-utils
url-http url-auth url-gw nsm message sendmail yank-media puny dired
dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config
gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047
rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils
mailheader org-ref-utils org-ref-export citeproc citeproc-itemgetters
citeproc-biblatex parse-time citeproc-bibtex ol-bibtex citeproc-cite
citeproc-subbibs citeproc-sort citeproc-name citeproc-formatters
citeproc-number rst compile citeproc-proc citeproc-disamb
citeproc-itemdata citeproc-generic-elements citeproc-macro
citeproc-choose citeproc-date citeproc-context citeproc-prange
citeproc-style citeproc-locale citeproc-term citeproc-rt citeproc-lib
citeproc-s thingatpt queue ox-org ox-odt rng-loc rng-uri rng-parse
rng-match rng-dt rng-util rng-pttrn nxml-parse nxml-ns nxml-enc xmltok
nxml-util ox-latex ox-icalendar org-agenda ox-html table ox-ascii
ox-publish ox org-ref-misc-links org-ref-label-link org-ref-ref-links
org-ref-citation-links xref project org-ref-bibliography-links hydra lv
bibtex-completion filenotify biblio biblio-download biblio-dissemin
biblio-ieee biblio-hal biblio-dblp biblio-crossref biblio-arxiv timezone
biblio-doi biblio-core let-alist url-queue url-file ido hl-line parsebib
bibtex iso8601 f f-shortdoc shortdoc text-property-search s cl-extra
help-mode emacsql-sqlite-builtin sqlite kinsoku zel-scheduled
org-roam-migrate org-roam-log org-roam-mode org-roam-capture org-roam-id
org-roam-node org-roam-db org-roam-utils org-roam-compat org-roam
org-capture org-element org-persist xdg avl-tree generator org-attach
org-id org-refile org ob ob-tangle ob-ref ob-lob ob-table ob-exp
org-macro org-src ob-comint org-pcomplete pcomplete comint ansi-osc
ansi-color ring org-list org-footnote org-faces org-entities time-date
noutline outline icons ob-emacs-lisp ob-core ob-eval org-cycle org-table
ol org-fold org-fold-core org-keys oc org-loaddefs find-func cal-menu
calendar cal-loaddefs org-version org-compat org-macs emacsql-sqlite
advice emacsql emacsql-compiler magit-section format-spec compat-27
compat-26 compat compat-macs rx dash elec-pair autoinsert cus-load
tango-dark-theme loadhist zel-utils zel zel-autoload zel-performance
orderless-autoloads ivy-bibtex-autoloads ivy-avy-autoloads
org-ref-autoloads helpful-autoloads corfu-autoloads
xah-fly-keys-autoloads sudo-edit-autoloads marginalia-autoloads
ebib-autoloads emacsql-sqlite-builtin-autoloads markdown-mode-autoloads
diminish-autoloads paredit-autoloads counsel-autoloads swiper-autoloads
ivy-autoloads exiftool-autoloads async-autoloads elisp-refs-autoloads
major-mode-hydra-autoloads pretty-hydra-autoloads hydra-autoloads
lv-autoloads ace-pinyin-autoloads pinyinlib-autoloads avy-autoloads
rime-autoloads popup-autoloads ox-pandoc-autoloads ht-autoloads
htmlize-autoloads embark-consult-autoloads consult-autoloads
embark-autoloads org-roam-ui-autoloads websocket-autoloads
simple-httpd-autoloads pdf-tools-autoloads tablist-autoloads
nov-autoloads esxml-autoloads kv-autoloads org-roam-bibtex-autoloads
bibtex-completion-autoloads biblio-autoloads biblio-core-autoloads
org-roam-autoloads emacsql-sqlite-autoloads emacsql-autoloads
vertico-autoloads yaml-autoloads org-contrib-autoloads
magit-section-autoloads compat-autoloads citeproc-autoloads
parsebib-autoloads string-inflection-autoloads queue-autoloads
f-autoloads dash-autoloads posframe-autoloads s-autoloads
company-auctex-autoloads auctex-autoloads tex-site info
company-autoloads yasnippet-autoloads package browse-url url url-proxy
url-privacy url-expand url-methods url-history url-cookie
generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse
auth-source cl-seq eieio eieio-core cl-macs password-cache json subr-x
map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc
iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook
vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win
term/common-win x-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 theme-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 xwidget-internal dbusbind inotify lcms2 dynamic-setting
system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit
xinput2 x multi-tty make-network-process emacs)

Memory information:
((conses 16 424057 246088)
 (symbols 48 32234 2)
 (strings 32 156896 32514)
 (string-bytes 1 4311685)
 (vectors 16 55310)
 (vector-slots 8 647804 520395)
 (floats 8 261 1330)
 (intervals 56 1139 601)
 (buffers 984 13))
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#60081; Package emacs. (Thu, 15 Dec 2022 07:44:03 GMT) Full text and rfc822 format available.

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

From: Zehao Hu <huzehao1998 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: 29.0.60;
 compiler-macros in keymap.el accept wrong number of arguments
Date: Thu, 15 Dec 2022 11:45:56 +0800
[Message part 1 (text/plain, inline)]
I guess I was wrong.  There is no problem in the compiler macros, but
`*--anon-cmacro' should not be called with `elisp--witness--lisp'.

I think this bug is equivalent to
bug#50034: 28.0.50; elisp capf error "Wrong type argument: listp,
elisp--witness--lisp"

Zehao Hu <huzehao1998 <at> gmail.com> 于2022年12月14日周三 23:23写道:

> Dear maintainer,
>
> When I was trying the new function `keymap-set', a
> "wrong-number-of-arguments" error occurred (see below) when
> `company-capf' or `completion-at-point' tried to complete
> the arguments.
>
> The compiler macro confused me:
> (declare (compiler-macro (lambda (form) (keymap--compile-check key) form)))
>
> If I understand correctly, the compiler macro here should be like:
> (lambda (form &optional keymap key definition)
>   (keymap--compile-check key)
>   form)
> Or (lambda (form &rest args) ...) because `elisp--witness--lisp' would
> be the argument when completing.
>
> However the current one only accept one argument.
> And most of compiler-macros in keymap.el (like keymap-global-*
> keymap-local-*)
> have similar problems.
>
> Part of the backtrace:
> 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)
> ...
>
>
> In GNU Emacs 29.0.60 (build 5, x86_64-pc-linux-gnu, GTK+ Version
>  3.24.35, cairo version 1.17.6) of 2022-12-14 built on legion7
> Repository revision: 1d3cbba7dfa26fc74df4d09d40a3cd7ba07279b4
> Repository branch: emacs-29
> Windowing system distributor 'The X.Org Foundation', version 11.0.12101004
> System Description: Arch Linux
>
> Configured using:
>  'configure -C --with-xwidgets --with-json --with-tree-sitter
>  --with-mailutils --with-small-ja-dic --with-cairo --with-x-toolkit=gtk3
>  'CFLAGS=-march=native -mtune=generic -O2 -pipe -fno-plt -fexceptions
>  -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security
>  -fstack-clash-protection -fcf-protection -flto=auto'
>  'LDFLAGS=-Wl,-O2,--sort-common,--as-needed,-z,relro,-z,now -flto=auto''
>
> Configured features:
> ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
> JSON LCMS2 LIBOTF LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY
> PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS
> TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM XWIDGETS GTK3 ZLIB
>
> Important settings:
>   value of $LANG: en_US
>   value of $XMODIFIERS: @im=fcitx
>   locale-coding-system: iso-latin-1-unix
>
> Major mode: Fundamental
>
> Minor modes in effect:
>   zel-keys: t
>   global-hl-line-mode: t
>   org-roam-db-autosync-mode: t
>   electric-pair-mode: t
>   auto-insert-mode: t
>   tooltip-mode: t
>   global-eldoc-mode: t
>   show-paren-mode: t
>   electric-indent-mode: t
>   mouse-wheel-mode: t
>   file-name-shadow-mode: t
>   global-font-lock-mode: t
>   font-lock-mode: t
>   blink-cursor-mode: t
>   size-indication-mode: t
>   column-number-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:
> None found.
>
> Features:
> (shadow sort mail-extr emacsbug paredit edmacro kmacro company-oddmuse
> company-keywords company-etags etags fileloop company-gtags
> company-dabbrev-code company-dabbrev company-files company-clang
> company-capf company-cmake company-semantic company-template
> company-bbdb company pcase zel-keys xah-fly-keys dired-x finder-inf
> org-ref org-ref-core org-ref-glossary org-ref-bibtex avy doi-utils
> url-http url-auth url-gw nsm message sendmail yank-media puny dired
> dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config
> gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047
> rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils
> mailheader org-ref-utils org-ref-export citeproc citeproc-itemgetters
> citeproc-biblatex parse-time citeproc-bibtex ol-bibtex citeproc-cite
> citeproc-subbibs citeproc-sort citeproc-name citeproc-formatters
> citeproc-number rst compile citeproc-proc citeproc-disamb
> citeproc-itemdata citeproc-generic-elements citeproc-macro
> citeproc-choose citeproc-date citeproc-context citeproc-prange
> citeproc-style citeproc-locale citeproc-term citeproc-rt citeproc-lib
> citeproc-s thingatpt queue ox-org ox-odt rng-loc rng-uri rng-parse
> rng-match rng-dt rng-util rng-pttrn nxml-parse nxml-ns nxml-enc xmltok
> nxml-util ox-latex ox-icalendar org-agenda ox-html table ox-ascii
> ox-publish ox org-ref-misc-links org-ref-label-link org-ref-ref-links
> org-ref-citation-links xref project org-ref-bibliography-links hydra lv
> bibtex-completion filenotify biblio biblio-download biblio-dissemin
> biblio-ieee biblio-hal biblio-dblp biblio-crossref biblio-arxiv timezone
> biblio-doi biblio-core let-alist url-queue url-file ido hl-line parsebib
> bibtex iso8601 f f-shortdoc shortdoc text-property-search s cl-extra
> help-mode emacsql-sqlite-builtin sqlite kinsoku zel-scheduled
> org-roam-migrate org-roam-log org-roam-mode org-roam-capture org-roam-id
> org-roam-node org-roam-db org-roam-utils org-roam-compat org-roam
> org-capture org-element org-persist xdg avl-tree generator org-attach
> org-id org-refile org ob ob-tangle ob-ref ob-lob ob-table ob-exp
> org-macro org-src ob-comint org-pcomplete pcomplete comint ansi-osc
> ansi-color ring org-list org-footnote org-faces org-entities time-date
> noutline outline icons ob-emacs-lisp ob-core ob-eval org-cycle org-table
> ol org-fold org-fold-core org-keys oc org-loaddefs find-func cal-menu
> calendar cal-loaddefs org-version org-compat org-macs emacsql-sqlite
> advice emacsql emacsql-compiler magit-section format-spec compat-27
> compat-26 compat compat-macs rx dash elec-pair autoinsert cus-load
> tango-dark-theme loadhist zel-utils zel zel-autoload zel-performance
> orderless-autoloads ivy-bibtex-autoloads ivy-avy-autoloads
> org-ref-autoloads helpful-autoloads corfu-autoloads
> xah-fly-keys-autoloads sudo-edit-autoloads marginalia-autoloads
> ebib-autoloads emacsql-sqlite-builtin-autoloads markdown-mode-autoloads
> diminish-autoloads paredit-autoloads counsel-autoloads swiper-autoloads
> ivy-autoloads exiftool-autoloads async-autoloads elisp-refs-autoloads
> major-mode-hydra-autoloads pretty-hydra-autoloads hydra-autoloads
> lv-autoloads ace-pinyin-autoloads pinyinlib-autoloads avy-autoloads
> rime-autoloads popup-autoloads ox-pandoc-autoloads ht-autoloads
> htmlize-autoloads embark-consult-autoloads consult-autoloads
> embark-autoloads org-roam-ui-autoloads websocket-autoloads
> simple-httpd-autoloads pdf-tools-autoloads tablist-autoloads
> nov-autoloads esxml-autoloads kv-autoloads org-roam-bibtex-autoloads
> bibtex-completion-autoloads biblio-autoloads biblio-core-autoloads
> org-roam-autoloads emacsql-sqlite-autoloads emacsql-autoloads
> vertico-autoloads yaml-autoloads org-contrib-autoloads
> magit-section-autoloads compat-autoloads citeproc-autoloads
> parsebib-autoloads string-inflection-autoloads queue-autoloads
> f-autoloads dash-autoloads posframe-autoloads s-autoloads
> company-auctex-autoloads auctex-autoloads tex-site info
> company-autoloads yasnippet-autoloads package browse-url url url-proxy
> url-privacy url-expand url-methods url-history url-cookie
> generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse
> auth-source cl-seq eieio eieio-core cl-macs password-cache json subr-x
> map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc
> iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook
> vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win
> term/common-win x-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 theme-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 xwidget-internal dbusbind inotify lcms2 dynamic-setting
> system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit
> xinput2 x multi-tty make-network-process emacs)
>
> Memory information:
> ((conses 16 424057 246088)
>  (symbols 48 32234 2)
>  (strings 32 156896 32514)
>  (string-bytes 1 4311685)
>  (vectors 16 55310)
>  (vector-slots 8 647804 520395)
>  (floats 8 261 1330)
>  (intervals 56 1139 601)
>  (buffers 984 13))
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#60081; Package emacs. (Thu, 15 Dec 2022 08:55:02 GMT) Full text and rfc822 format available.

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

From: Zehao Hu <huzehao1998 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: 29.0.60;
 compiler-macros in keymap.el accept wrong number of arguments
Date: Thu, 15 Dec 2022 16:54:26 +0800
[Message part 1 (text/plain, inline)]
Hi all,

I'm sure that this is the same bug as bug #50043, #58148, #58396

In bug #58356,
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
>Lars Ingebrigtsen [2022-10-11 20:27:42] wrote:
>> Stefan Monnier <monnier <at> 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).

Here is a simple workaround:

(require 'loadhist)

(defun cmacro-ignore-elisp-witness (oldfn form &rest args)
  "Add this advicing function around compiler macros to ignore
`elisp--witness--lisp'"
  (unless (eq 'elisp--witness--lisp (car args))
    (apply oldfn form args)))

(defun cmacro-add-advice (file-or-entry)
  "Add `cmacro-ignore-elisp-witness' to compiler macros in FILE or in ENTRY
from `load-history'"
  (let ((entry (if (stringp file-or-entry)
                   (file-loadhist-lookup file-or-entry)
                 file-or-entry)))
    (dolist (cell (cdr entry))
      (when-let*
          (((consp cell))
           ((eq 'defun (car cell)))
           (symbol
            (cdr cell))
           ((symbolp symbol))
           (cmacro
            (get symbol 'compiler-macro))
           ((not (advice-member-p #'cmacro-ignore-elisp-witness symbol))))
        (advice-add cmacro :around #'cmacro-ignore-elisp-witness)))))

;; Advicing existing compiler macros
(dolist (entry load-history)
  (cmacro-add-advice entry))

;; And the ones in the future
(add-hook 'after-load-functions #'cmacro-add-advice)
(dolist (entry load-history)
  (cmacro-add-advice entry))

(add-hook 'after-load-functions #'cmacro-add-advice)

Or maybe edit `byte-run--set-compiler-macro', to change the `*--anon-cmacro'
and to advice the `compiler-function'.
[Message part 2 (text/html, inline)]

Reply sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
You have taken responsibility. (Thu, 05 Oct 2023 18:08:03 GMT) Full text and rfc822 format available.

Notification sent to Zehao Hu <huzehao1998 <at> gmail.com>:
bug acknowledged by developer. (Thu, 05 Oct 2023 18:08:04 GMT) Full text and rfc822 format available.

Message #16 received at 60081-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Jens Schmidt <jschmidt4gnu <at> vodafonemail.de>
Cc: 58148-done <at> debbugs.gnu.org, German Pacenza <germanp82 <at> hotmail.com>,
 60081-done <at> debbugs.gnu.org, 58396 <at> debbugs.gnu.org,
 Lars Ingebrigtsen <larsi <at> gnus.org>, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#58148: 29.0.50; Wrong number of arguments in
 keymap-set--anon-cmacro
Date: Thu, 05 Oct 2023 14:07:01 -0400
>> This `t` catches more than errors.  Better replace it with `error`.
> Done plus Eli's comments from that other branch.

Thanks, pushed to `emacs-29`.

> Done.

Thanks, pushed to `master`.

> FWIW, bug#60081 can also be merged into this one. (The other bugs that
> Zehao mentions in her/his last post are either merged already or
> typos/not related to this bug.)

Indeed, hereby closing it as well.

> Technically, I should be able to merge that bug (after having been
> pointed to admin/notes/bugtracker), but is it OK for me (as a "plain
> user") to do so?

Yes (it's easy to undo, in any case if it proves to be a mistake).


        Stefan





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 03 Nov 2023 11:24:17 GMT) Full text and rfc822 format available.

This bug report was last modified 146 days ago.

Previous Next


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