emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/transient a678d61406 6/7: Hide suffix-only commands fro


From: Jonas Bernoulli
Subject: [elpa] externals/transient a678d61406 6/7: Hide suffix-only commands from read-extended-command
Date: Tue, 23 Jan 2024 09:23:46 -0500 (EST)

branch: externals/transient
commit a678d61406265100c7ab4d2bb8d040c4bc61de8b
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    Hide suffix-only commands from read-extended-command
---
 lisp/transient.el | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/lisp/transient.el b/lisp/transient.el
index 5e7d2759f5..c84ac8f65d 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]