Function: transient--advise-this-command

transient--advise-this-command is a byte-compiled function defined in transient.el.

Signature

(transient--advise-this-command ADVICE)

Documentation

Add ADVICE around this-command.

If possible add the advice to the value of this-command instead of the symbol directly, so the command's identity does not get obfuscated. For primitive and anonymous functions that isn't possible, so fall back to advising via the symbol in those cases.

Source Code

;; Defined in ~/.emacs.d/elpa/transient-20260414.1009/transient.el
(defun transient--advise-this-command (advice)
  "Add ADVICE around `this-command'.
If possible add the advice to the value of `this-command' instead of
the symbol directly, so the command's identity does not get obfuscated.
For primitive and anonymous functions that isn't possible, so fall back
to advising via the symbol in those cases."
  (add-function
   :around (if (and (symbolp this-command)
                    (not (subr-primitive-p (symbol-function this-command))))
               (symbol-function this-command)
             this-command)
   advice '((depth . -99))))