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

From: Stefan Monnier <[email-masked]>
Date: Wed, 30 Jul 2025 11:38:55 -0400

>>> Good idea.  Michael, if you can try this along with a patch like the one
>>> Stefan proposed for tramp (correcting the declare form name) that would
>>> be useful.  Assuming it all works as expected, you'll notice
>>> `tramp-loaddefs.el' no longer contains the macro and the calls to it,
>>> but rather only the expanded forms it generates.
>>
>> Before doing so, I've tried Stefan's patch with Emacs 28. There are
>> compilation warnings.
>>    ...
>> And also at runtime.
>
> That would seem to make it difficult to add new declare forms and
> simultaneously support older versions of Emacs.  How have such issues
> been dealt with in the past?  Do you have a version or branch of TRAMP
> that is only deployed on master?

I think it's not that bad: just adding the ERROR=t is sufficient.
The `autoload-macro` declaration can be kept for later, once Tramp drops
support for Emacs<31.

I suspect the same will apply for Transient: we'll want to make sure the
new functionality works well for it, but we'll have to keep the old
ad-hoc solution until it drops support for Emacs<31.

        Stefan