From 63f907237d248681c876eff59d624bff9c936876 Mon Sep 17 00:00:00 2001 From: Jonas Bernoulli Date: Tue, 24 Mar 2026 14:04:39 +0100 Subject: transient--wrap-command: Advise built-in commands via this-command The advise is ineffective otherwise, as can be observed using (transient-define-prefix demo () [("g" "goto" goto-char :transient t)]) --- lisp/transient.el | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lisp/transient.el b/lisp/transient.el index cea49bb..c13cac2 100644 --- a/lisp/transient.el +++ b/lisp/transient.el @@ -3050,9 +3050,11 @@ value. Otherwise return CHILDREN as is.") (when (symbolp command) (remove-function (symbol-function command) advice)) (oset prefix unwind-suffix nil))))) - (add-function :around (if (symbolp this-command) - (symbol-function this-command) - this-command) + (add-function :around + (if (and (symbolp this-command) + (not (subrp (symbol-function this-command)))) + (symbol-function this-command) + this-command) advice '((depth . -99))) (cl-assert (>= emacs-major-version 30) nil @@ -3103,9 +3105,11 @@ value. Otherwise return CHILDREN as is.") (setq advice `(lambda (fn &rest args) (interactive ,advice-interactive) (apply ',advice-body fn args))) - (add-function :around (if (symbolp this-command) - (symbol-function this-command) - this-command) + (add-function :around + (if (and (symbolp this-command) + (not (subrp (symbol-function this-command)))) + (symbol-function this-command) + this-command) advice '((depth . -99)))))) (defun transient--premature-post-command () -- cgit v1.0