GNU bug report logs - #48694
28.0.50; Suboptimal autoload cookie for `transient-define-prefix'

Previous Next

Package: emacs;

Reported by: Philipp Stephani <p.stephani2 <at> gmail.com>

Date: Thu, 27 May 2021 10:57:02 UTC

Severity: normal

Tags: moreinfo

Found in version 28.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Philipp Stephani <p.stephani2 <at> gmail.com>
Cc: 48694 <at> debbugs.gnu.org
Subject: Re: bug#48694: 28.0.50; Suboptimal autoload cookie for
 `transient-define-prefix'
Date: Fri, 15 Jul 2022 13:08:45 +0200
Philipp Stephani <p.stephani2 <at> gmail.com> writes:

> 2. Moreover, this is needlessly heavyweight in that it requires
>    `transient' to be loaded just for the autoload.  This should rather
>    be
>
>    (autoload 'f () "test" "test" t)
>
>    or so.  It's possible to add such an autoload cookie manually, but it
>    would be better if Emacs did the right thing automatically.
>
> I think this can be rectified by adding `transient-define-prefix' to the
> big list of special/complex cases in `make-autoload'.

I've now done this in Emacs 29.

> However, that in turn wouldn't be the best solution, because it
> prevents libraries not shipped with Emacs from the autoload
> optimization for defun-like macros like this.  It would be better to
> create a macro declaration specifier that would allow arbitrary
> defun-like macros to optimize their autoload behavior.

We could have the packages put a symbol on the macro to trigger this,
but then the question is -- how do we tell the Emacs that'd doing the
loaddefs generation about that?  That Emacs usually doesn't load
anything in particular, so it'd have to be told in some other way.

We could introduce some new syntax here, for instance

;;;###autoload-expand-macro

to signal that the macro should be expanded, but then we have the same
problem -- that Emacs has to load the file to get the definition of the
macro.  And in that case, we could just use the symbol property
anyway.

So I'm not sure anything can be done here practically, because
package.el doesn't do "emacs ... -l package -f loaddefs-gen", after all.

Anybody have any opinions here?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 2 years and 286 days ago.

Previous Next


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