Subject: bug#78995: [PATCH] ;;;autoload-expand for special macros

From: "J.D. Smith" <[email-masked]>
Date: Sun, 13 Jul 2025 20:05:07 -0400

Stefan Monnier <[email-masked]> writes:

> I don't see `cl-defstruct` in list 2 (same for several others), so
> I think the above list isn't right.

Oops, wrong set function.  It's:

   ;; Expand and treat as function op:
   (easy-mmode-define-global-mode
     define-global-minor-mode
     define-globalized-minor-mode
     easy-mmode-define-minor-mode
     define-minor-mode cl-defun
     cl-defmacro)

> some are in both lists and it's mostly "historical accidents".

Makes sense.

> But I think your trick of evaluating the file (to cause the macros
> to be defined) should allow us to focus on list 1 and leave only the
> strict minimum in list 2.

I will work up a patch using this approach unless you'd like to (will be
a few days min).  I think we are in agreement that a simple (autoload
macroexpand) will suffice.  We could leave list 2 as-is for now, with a
note that it can be trimmed once `declare' for list 1 is fully
operational.

Probably would also need to loop in package authors, e.g. for transient,
to ensure they are aware of the change.