GNU bug report logs - #79416
31.0.50; current value of `macro-declarations-alist' not from definition in byte-run.el

Previous Next

Package: emacs;

Reported by: David Ponce <da_vid <at> orange.fr>

Date: Tue, 9 Sep 2025 20:12:02 UTC

Severity: normal

Found in version 31.0.50

To reply to this bug, email your comments to 79416 AT debbugs.gnu.org.

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#79416; Package emacs. (Tue, 09 Sep 2025 20:12:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to David Ponce <da_vid <at> orange.fr>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 09 Sep 2025 20:12:02 GMT) Full text and rfc822 format available.

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

From: David Ponce <da_vid <at> orange.fr>
To: bug-gnu-emacs <at> gnu.org
Subject: 31.0.50; current value of `macro-declarations-alist' not from
 definition in byte-run.el
Date: Tue, 9 Sep 2025 22:11:10 +0200
[Message part 1 (text/plain, inline)]
Hello,

I found that the value of the variable `macro-declarations-alist', as
defined in byte-run.el, is not the value used in emacs.  To illustrate,
start emacs -Q and evaluate macro-declarations-alist, the result is
something like:

'((cl-optimize cl--optimize)
 (gv-expander gv--expander-defun-declaration)
 (debug byte-run--set-debug)
 (autoload-macro byte-run--set-autoload-macro)
 (no-font-lock-keyword byte-run--set-no-font-lock-keyword)
 (advertised-calling-convention
  byte-run--set-advertised-calling-convention)
 (obsolete byte-run--set-obsolete)
 (interactive-only byte-run--set-interactive-only)
 (pure byte-run--set-pure
       "If non-nil, the compiler can replace calls with their return value.\nThis may shift errors from run-time to compile-time.")
 (side-effect-free byte-run--set-side-effect-free
		   "If non-nil, calls can be ignored if their value is unused.\nIf `error-free', drop calls even if `byte-compile-delete-errors' is nil.")
 (important-return-value byte-run--set-important-return-value
			 "If non-nil, warn about calls not using the returned value.")
 (compiler-macro byte-run--set-compiler-macro)
 (doc-string byte-run--set-doc-string) (indent byte-run--set-indent)
 (speed byte-run--set-speed) (safety byte-run--set-safety)
 (completion byte-run--set-completion) (modes byte-run--set-modes)
 (interactive-args byte-run--set-interactive-args)
 (ftype byte-run--set-function-type))

From the definition in byte-run.el the value is:

((debug byte-run--set-debug)
 (autoload-macro byte-run--set-autoload-macro)
 (no-font-lock-keyword byte-run--set-no-font-lock-keyword)
 (cl-optimize cl--optimize) (gv-setter gv--setter-defun-declaration)
 (gv-expander gv--expander-defun-declaration)
 (advertised-calling-convention
  byte-run--set-advertised-calling-convention)
 (obsolete byte-run--set-obsolete)
 (interactive-only byte-run--set-interactive-only)
 (pure byte-run--set-pure
       "If non-nil, the compiler can replace calls with their return value.\nThis may shift errors from run-time to compile-time.")
 (side-effect-free byte-run--set-side-effect-free
		   "If non-nil, calls can be ignored if their value is unused.\nIf `error-free', drop calls even if `byte-compile-delete-errors' is nil.")
 (important-return-value byte-run--set-important-return-value
			 "If non-nil, warn about calls not using the returned value.")
 (compiler-macro byte-run--set-compiler-macro)
 (doc-string byte-run--set-doc-string) (indent byte-run--set-indent)
 (speed byte-run--set-speed) (safety byte-run--set-safety)
 (completion byte-run--set-completion) (modes byte-run--set-modes)
 (interactive-args byte-run--set-interactive-args)
 (ftype byte-run--set-function-type))

Compared to the version in byte-run.el, the current version is
missing the declaration: '(gv-setter gv--setter-defun-declaration)

This leads to this warning when byte-compiling or loading the attached
test file code.el, after starting emacs -Q: Warning: Unknown macro
property ‘gv-setter’.  And running the small test at the end of
code.el signal the error (void-function \(setf\ my--get-v\)).

If the value of `macro-declarations-alist' is then refreshed from the
definition in byte-run.el, the same file is byte-compiled without
warning, and the small test returns the expected result.

Maybe the issue is in gv.el that doesn't autoload the gv-setter
declaration for macros.  The attached V0 patch seems to have fixed the
problem for me.

Can you please confirm the issue and maybe fix it, if my patch is
correct?

Thanks

In GNU Emacs 31.0.50 (build 8, x86_64-pc-linux-gnu, GTK+ Version
 3.24.49, cairo version 1.18.2) of 2025-09-08
Repository revision: 5be32aa047d18b578412e8b249bb4f128a0dc207
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101018
System Description: Fedora Linux 42 (KDE Plasma Desktop Edition)

Configured using:
 'configure --with-native-compilation=no
 --with-tree-sitter=no'

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

Important settings:
  value of $LC_TIME: fr_FR.utf8
  value of $LANG: fr_FR.UTF-8
  locale-coding-system: utf-8-unix
[gv-fix-macro-decl-alist-autoload-V0.patch (text/x-patch, attachment)]
[code.el (text/x-emacs-lisp, attachment)]

This bug report was last modified 5 days ago.

Previous Next


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