Function: transient-active-prefix

transient-active-prefix is a byte-compiled function defined in transient.el.

Signature

(transient-active-prefix &optional PREFIXES)

Documentation

Return the active transient object.

Return nil if there is no active transient, if the transient buffer isn't shown, and while the active transient is suspended (e.g., while the minibuffer is in use).

Unlike transient-current-prefix, which is only ever non-nil in code that is run directly by a command that is invoked while a transient is current, this function is also suitable for use in asynchronous code, such as timers and callbacks (this function's main use-case).

If optional PREFIXES is non-nil, it must be a prefix command symbol or a list of symbols, in which case the active transient object is only returned if it matches one of PREFIXES.

Source Code

;; Defined in ~/.emacs.d/elpa/transient-20260414.1009/transient.el
;;; Identities

(defun transient-active-prefix (&optional prefixes)
  "Return the active transient object.

Return nil if there is no active transient, if the transient buffer
isn't shown, and while the active transient is suspended (e.g., while
the minibuffer is in use).

Unlike `transient-current-prefix', which is only ever non-nil in code
that is run directly by a command that is invoked while a transient
is current, this function is also suitable for use in asynchronous
code, such as timers and callbacks (this function's main use-case).

If optional PREFIXES is non-nil, it must be a prefix command symbol
or a list of symbols, in which case the active transient object is
only returned if it matches one of PREFIXES."
  (and transient--showp
       transient--prefix
       (or (not prefixes)
           (memq (oref transient--prefix command) (ensure-list prefixes)))
       (or (memq 'transient--pre-command pre-command-hook)
           (and (memq t pre-command-hook)
                (memq 'transient--pre-command
                      (default-value 'pre-command-hook))))
       transient--prefix))