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

From: JD Smith <[email-masked]>
Date: Sat, 12 Jul 2025 10:59:45 -0400

Thanks, improved doc-strings in the attached.  If this is looking good I can also update the `Autoload' section of the elisp manual, near "If you write a function definition with an unusual macro...".  I also noticed that `:autoload-end' is not mentioned there, and probably should be (this keyword marker halts further processing of forms in the macro expansion).

One question on nesting of macros: I'm wondering whether an ;;;###autoload-expand should result in using `EXPANSION=force' in all recursive calls to `loaddefs-generate--make-autoload'.  I.e. should all macros be _recursively_ expanded with `force'?  This would allow nesting, e.g. a macro wrapping a macro which itself wraps `define-minor-mode'.  But it would also expand all other macros encountered in the expansion, which could be problematic.  My instinct is that one level of such forced macro expansion is all that can be safely supported.