Skip to content

Commit

Permalink
Use define-advice instead of advice-add
Browse files Browse the repository at this point in the history
  • Loading branch information
tarsius committed Jun 9, 2024
1 parent 2fd3ea1 commit 5cbe967
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lisp/transient.el
Original file line number Diff line number Diff line change
Expand Up @@ -1067,16 +1067,15 @@ falling back to that of the same aliased command."
(put 'transient--default-infix-command 'completion-predicate
#'transient--suffix-only)

(defun transient--find-function-advised-original (fn func)
(define-advice find-function-advised-original
(:around (fn func) transient-default-infix)
"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 ;transient--expand-define-args
(defun transient--expand-define-args (args arglist form &optional nobody)
Expand Down

0 comments on commit 5cbe967

Please sign in to comment.