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

From: "J.D. Smith" <[email-masked]>
Date: Sun, 10 Aug 2025 17:23:29 -0400

Stefan Monnier <[email-masked]> writes:

>> 1. It's somewhat arbitrary which macros request expansion
>>
>> Eventually, I think for all builtin macros, the question should be
>> asked: "Will calls to this macro likely be marked ;;;###autoload"?
>> If the answer is yes, the macro should declare
>> `autoload-macro=expand', so that these calls get recursively expanded
>> down to their most basic forms — `defalias', `put', and so on.
>
> It's a judgment call: will it be more common to *preload* or to
> *autoload*?

I suppose an argument for preloading a macro's definition and copying in
;;;###autoload calls to it is if it 1) is very long and involved and
cannot be reduced to a small number of expanded forms, and 2) is
autoloaded many times, thus bloating the autoload file.

The only other scenario I can imagine is if it relies on information
that is not yet known at compile time, but which is known reliably at
load time (network address on emacs start?).  But I'm not aware of any
such builtin macros.  What other preload uses am I missing?

Unless there are any more thoughts on this patch I'll give it a last
look over and apply to master.  I'll patch TRAMP in a separate commit.