branch: externals/transient commit f4517086053dea6eb56103061fabbe636ffe5aa4 Author: Jonas Bernoulli <jo...@bernoul.li> Commit: Jonas Bernoulli <jo...@bernoul.li>
Use completion-predicate symbol property instead of command-modes It is a more natural fit but didn't exist yet when I first learned about this feature. Both properties were introduced in Emacs 28.1. --- lisp/transient.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lisp/transient.el b/lisp/transient.el index f618564cf7..5e7d2759f5 100644 --- a/lisp/transient.el +++ b/lisp/transient.el @@ -1007,7 +1007,7 @@ keyword. `(progn (defalias ',name #'transient--default-infix-command) (put ',name 'interactive-only t) - (put ',name 'command-modes (list 'not-a-mode)) + (put ',name 'completion-predicate #'ignore) (put ',name 'function-documentation ,docstr) (put ',name 'transient--suffix (,(or class 'transient-switch) :command ',name ,@slots))))) @@ -1037,7 +1037,7 @@ this case, because the `man-page' slot was not set in this case." (transient-infix-set obj (transient-infix-read obj))) (transient--show)) (put 'transient--default-infix-command 'interactive-only t) -(put 'transient--default-infix-command 'command-modes (list 'not-a-mode)) +(put 'transient--default-infix-command 'command-predicate #'ignore) (eval-and-compile (defun transient--expand-define-args (args &optional arglist) @@ -1148,7 +1148,7 @@ this case, because the `man-page' slot was not set in this case." args :command `(prog1 ',sym (put ',sym 'interactive-only t) - (put ',sym 'command-modes (list 'not-a-mode)) + (put ',sym 'command-predicate #'ignore) (defalias ',sym ,(if (eq (car-safe cmd) 'lambda) cmd @@ -1171,7 +1171,7 @@ this case, because the `man-page' slot was not set in this case." args :command `(prog1 ',sym (put ',sym 'interactive-only t) - (put ',sym 'command-modes (list 'not-a-mode)) + (put ',sym 'command-predicate #'ignore) (defalias ',sym #'transient--default-infix-command)))) (cond ((and car (not (keywordp car))) (setq class 'transient-option)