Function: transient-setup
transient-setup is a byte-compiled function defined in transient.el.
Signature
(transient-setup &optional NAME LAYOUT EDIT &rest PARAMS)
Documentation
Setup the transient specified by NAME.
This function is called by transient prefix commands to setup the
transient. In that case NAME is mandatory, LAYOUT and EDIT must
be nil and PARAMS may be (but usually is not) used to set, e.g.,
the "scope" of the transient (see transient-define-prefix).
This function is also called internally, in which case LAYOUT and EDIT may be non-nil.
Source Code
;; Defined in ~/.emacs.d/elpa/transient-20260414.1009/transient.el
;;; Setup
(defun transient-setup (&optional name layout edit &rest params)
"Setup the transient specified by NAME.
This function is called by transient prefix commands to setup the
transient. In that case NAME is mandatory, LAYOUT and EDIT must
be nil and PARAMS may be (but usually is not) used to set, e.g.,
the \"scope\" of the transient (see `transient-define-prefix').
This function is also called internally, in which case LAYOUT and
EDIT may be non-nil."
(transient--debug 'setup)
(transient--with-emergency-exit :setup
(cond
((not name)
;; Switching between regular and edit mode.
(transient--pop-keymap 'transient--transient-map)
(transient--pop-keymap 'transient--redisplay-map)
(setq name (oref transient--prefix command))
(setq params (list :scope (oref transient--prefix scope))))
(transient--prefix
;; Invoked as a ":transient-non-suffix 'transient--do-{stay,call}"
;; of an outer prefix. Unlike the usual `transient--do-stack',
;; these predicates fail to clean up after the outer prefix.
(transient--pop-keymap 'transient--transient-map)
(transient--pop-keymap 'transient--redisplay-map))
((not (or layout ; resuming parent/suspended prefix
transient-current-command)) ; entering child prefix
(transient--stack-zap)) ; replace suspended prefix, if any
(edit
;; Returning from help to edit.
(setq transient--editp t)))
(transient--env-apply
(lambda ()
(transient--init-transient name layout params)
(transient--history-init transient--prefix)
(setq transient--original-window (selected-window))
(setq transient--original-buffer (current-buffer))
(setq transient--minibuffer-depth (minibuffer-depth))
(transient--redisplay))
(get name 'transient--prefix))
(transient--suspend-text-conversion-style)
(transient--setup-transient)
(transient--suspend-which-key-mode)))