Skip to content

Commit

Permalink
Hide suffix-only commands from read-extended-command
Browse files Browse the repository at this point in the history
  • Loading branch information
tarsius committed Jan 21, 2024
1 parent f451708 commit a678d61
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lisp/transient.el
Original file line number Diff line number Diff line change
Expand Up @@ -1209,6 +1209,17 @@ this case, because the `man-page' slot was not set in this case."
(and (string-match "\\`\\(-[a-zA-Z]\\)\\(\\'\\|=\\)" arg)
(match-string 1 arg))))

(defun transient-command-completion-not-ignored-p (symbol _buffer)
"Say whether SYMBOL should be offered as a completion.
If the value of SYMBOL's `completion-predicate' property is
`ignore', then return nil, otherwise return t."
(not (eq (get symbol 'completion-predicate) 'ignore)))

(static-if (and (boundp 'read-extended-command-predicate) ; since Emacs 28.1
(not read-extended-command-predicate))
(setq read-extended-command-predicate
'transient-command-completion-not-ignored-p))

(defun transient-parse-suffix (prefix suffix)
"Parse SUFFIX, to be added to PREFIX.
PREFIX is a prefix command, a symbol.
Expand Down

0 comments on commit a678d61

Please sign in to comment.