branch: externals/transient
commit bda7c2e0772deaee8e36a217d15c14784e8c6800
Author: Stefan Monnier <[email protected]>
Commit: Jonas Bernoulli <[email protected]>

    Set new autoload-macro property for some macros
    
    This feature was added in Emacs commit [1: 7486e5c3680] using it
    here allows removing these macros from `loaddefs--defining-macros'.
    
    Besides the three macros for which we now set that property,
    `transient-define-group' was listed in that variable, since
    [2: 105ae06031a], but it appears that was not actually needed.
    
    Use `put' instead of `declare', to avoid warnings on Emacs < 31.
    
    1: 2025-08-10 7486e5c3680b41cb58cb6eb1fa5aa3620d4a50bd
       Implement new autoload macro expansion declare form
    
    2: 2025-07-15 105ae06031a548e1afd7b7a992c1da783f498534
       Allow trivially autoloading transient-define-group
---
 lisp/transient.el | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lisp/transient.el b/lisp/transient.el
index 766bffc802..22b8dac6a6 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -1138,6 +1138,7 @@ to the setup function:
             `(lambda ()
                (interactive)
                (transient-setup ',name))))
+       :autoload-end
        (put ',name 'interactive-only ,interactive-only)
        (put ',name 'function-documentation ,docstr)
        (put ',name 'transient--prefix
@@ -1145,6 +1146,7 @@ to the setup function:
        (transient--set-layout
         ',name
         (list ,@(mapcan (lambda (s) (transient--parse-child name s)) 
groups))))))
+(put 'transient-define-prefix 'autoload-macro 'expand)
 
 (defmacro transient-define-group (name &rest groups)
   "Define one or more groups and store them in symbol NAME.
@@ -1190,10 +1192,12 @@ ARGLIST.  The infix arguments are usually accessed by 
using
          ,(if (and (not body) class (oref-default class definition))
               `(oref-default ',class definition)
             `(lambda ,arglist ,@body)))
+       :autoload-end
        (put ',name 'interactive-only ,interactive-only)
        (put ',name 'function-documentation ,docstr)
        (put ',name 'transient--suffix
             (,(or class 'transient-suffix) :command ',name ,@slots)))))
+(put 'transient-define-suffix 'autoload-macro 'expand)
 
 (defmacro transient-augment-suffix (name &rest args)
   "Augment existing command NAME with a new transient suffix object.
@@ -1204,8 +1208,10 @@ Similar to `transient-define-suffix' but define a suffix 
object only.
   (pcase-let
       ((`(,class ,slots)
         (transient--expand-define-args args nil 'transient-augment-suffix t)))
+    :autoload-end
     `(put ',name 'transient--suffix
           (,(or class 'transient-suffix) :command ',name ,@slots))))
+(put 'transient-define-infix 'autoload-macro 'expand)
 
 (defmacro transient-define-infix (name arglist &rest args)
   "Define NAME as a transient infix command.

Reply via email to