branch: externals/transient commit a30df67b0b0ae0f480b76e582d604a180043f85e Author: Jonas Bernoulli <jo...@bernoul.li> Commit: Jonas Bernoulli <jo...@bernoul.li>
Convince find-function to jump to infix command definitions again --- lisp/transient.el | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lisp/transient.el b/lisp/transient.el index bc6f77c4d7..13e6509d6f 100644 --- a/lisp/transient.el +++ b/lisp/transient.el @@ -1041,6 +1041,17 @@ this case, because the `man-page' slot was not set in this case." (put 'transient--default-infix-command 'completion-predicate #'transient--suffix-only) +(defun transient--find-function-advised-original (fn func) + "Return nil instead of `transient--default-infix-command'. +When using `find-function' to jump to the definition of a transient +infix command/argument, then we want to actually jump to that, not to +the definition of `transient--default-infix-command', which all infix +commands are aliases for." + (let ((val (funcall fn func))) + (and val (not (eq val 'transient--default-infix-command)) val))) +(advice-add 'find-function-advised-original :around + #'transient--find-function-advised-original) + (eval-and-compile (defun transient--expand-define-args (args &optional arglist) (unless (listp arglist)