Function: transient-define-infix
transient-define-infix is a macro defined in transient.el.
Signature
(transient-define-infix NAME ARGLIST [DOCSTRING] KEYWORD VALUE [KEYWORD VALUE]...)
Documentation
Define NAME as a transient infix command.
ARGLIST is always ignored and reserved for future use. DOCSTRING is the documentation string and is optional.
At least one key-value pair is required. All transient infix
commands are equal to each other (but not eq). It is meaning-
less to define an infix command, without providing at least one
keyword argument (usually :argument or :variable, depending
on the class). The suffix class defaults to transient-switch(var)/transient-switch(fun)
and can be set using the :class keyword.
The function definitions is always:
(lambda ()
(interactive)
(let ((obj (transient-suffix-object)))
(transient-infix-set obj (transient-infix-read obj)))
(transient--show))
transient-infix-read and transient-infix-set are generic
functions. Different infix commands behave differently because
the concrete methods are different for different infix command
classes. In rare case the above command function might not be
suitable, even if you define your own infix command class. In
that case you have to use transient-define-suffix to define
the infix command and use t as the value of the :transient
keyword.
Aliases
Source Code
;; Defined in ~/.emacs.d/elpa/transient-20260414.1009/transient.el
(defmacro transient-define-infix (name arglist &rest args)
"Define NAME as a transient infix command.
ARGLIST is always ignored and reserved for future use.
DOCSTRING is the documentation string and is optional.
At least one key-value pair is required. All transient infix
commands are equal to each other (but not eq). It is meaning-
less to define an infix command, without providing at least one
keyword argument (usually `:argument' or `:variable', depending
on the class). The suffix class defaults to `transient-switch'
and can be set using the `:class' keyword.
The function definitions is always:
(lambda ()
(interactive)
(let ((obj (transient-suffix-object)))
(transient-infix-set obj (transient-infix-read obj)))
(transient--show))
`transient-infix-read' and `transient-infix-set' are generic
functions. Different infix commands behave differently because
the concrete methods are different for different infix command
classes. In rare case the above command function might not be
suitable, even if you define your own infix command class. In
that case you have to use `transient-define-suffix' to define
the infix command and use t as the value of the `:transient'
keyword.
\(fn NAME ARGLIST [DOCSTRING] KEYWORD VALUE [KEYWORD VALUE]...)"
(declare (debug ( &define name lambda-list
[&optional lambda-doc]
keywordp sexp
[&rest keywordp sexp]))
(indent defun)
(doc-string 3))
(pcase-let
((`(,class ,slots ,_ ,docstr ,_ ,interactive-only)
(transient--expand-define-args args arglist 'transient-define-infix t)))
`(progn
(defalias ',name #'transient--default-infix-command)
(put ',name 'interactive-only ,interactive-only)
(put ',name 'completion-predicate #'transient--suffix-only)
(put ',name 'function-documentation ,docstr)
(put ',name 'transient--suffix
(,(or class 'transient-switch) :command ',name ,@slots)))))