GNU bug report logs - #78995
[PATCH] ;;;autoload-expand for special macros

Previous Next

Package: emacs;

Reported by: JD Smith <jdtsmith <at> gmail.com>

Date: Fri, 11 Jul 2025 19:29:02 UTC

Severity: normal

Tags: patch

Fixed in version 31

Done: "J.D. Smith" <jdtsmith <at> gmail.com>

Full log


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

From: JD Smith <jdtsmith <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] ;;;autoload-expand for special macros
Date: Fri, 11 Jul 2025 15:28:03 -0400
[Message part 1 (text/plain, inline)]
As mentioned over on emacs-devel, it's sometimes a problem that `loaddefs-gen' hard-codes the list of special macros it is willing to expand:

(memq car '(easy-mmode-define-global-mode define-global-minor-mode
			    define-globalized-minor-mode defun defmacro
			    easy-mmode-define-minor-mode define-minor-mode
			    define-inline cl-defun cl-defmacro cl-defgeneric
			    cl-defstruct pcase-defmacro iter-defun cl-iter-defun))

This makes it challenging to wrap things like `define-minor-mode' into a new macro, and autoload the resulting forms.  This small patch adds a new variant of the autoload cookie:

;;;autoload-expand
(my-autoloadable-macro-to-expand ...)

which allows package authors to "opt-in" to macro expansion of the following form during autoload generation.  It would be useful primarily for special macros that are not in the hard-coded list above, but which expand to other special macros that are.

Docs can be added if this looks good.

[autoload-expand.patch (application/octet-stream, attachment)]
[Message part 3 (text/plain, inline)]


This bug report was last modified 27 days ago.

Previous Next


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