Subject: 30.0.50; [WISHLIST] loaddefs-generate--make-autoload should expose variables which can be added to

From: Nicholas Vollmer <[email-masked]>
Date: Wed, 05 Jun 2024 06:40:26 -0400

When improving EXWM, we wanted to write a macro which expanded to 
a global minor mode definition. However, adding an ;;;###autoload 
cookie did not generate the proper autoloads because 
loaddefs-generate--make-autoload had no way of knowing our macro 
needed to be expanded first. It would be nice if these lists in 
loaddefs-generate--make-autoload  could be moved out into a 
variable, so it can be added to programmatically:

     ;; For complex cases, try again on the macro-expansion.
     ((and (memq car '(easy-mmode-define-global-mode 
     define-global-minor-mode
                       define-globalized-minor-mode defun defmacro
		       easy-mmode-define-minor-mode define-minor-mode
                       define-inline cl-defun cl-defmacro 
                       cl-defgeneric
                       cl-defstruct pcase-defmacro iter-defun 
                       cl-iter-defun))
           (macrop car)

     ;; For special function-like operators, use the `autoload' 
     function.

     ((memq car '(define-skeleton define-derived-mode
                   define-compilation-mode define-generic-mode
		   easy-mmode-define-global-mode define-global-minor-mode
		   define-globalized-minor-mode
		   easy-mmode-define-minor-mode define-minor-mode
		   cl-defun defun* cl-defmacro defmacro*
                   define-overloadable-function
                   transient-define-prefix transient-define-suffix
                   transient-define-infix 
                   transient-define-argument))

That would prevent another package like transient from having to 
patch loaddefs-gen.el directly.