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

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

[elpa] externals/corfu 66116be: Add completion-predicate to the Corfu co


From: ELPA Syncer
Subject: [elpa] externals/corfu 66116be: Add completion-predicate to the Corfu commands (Fix #35)
Date: Wed, 14 Jul 2021 14:57:07 -0400 (EDT)

branch: externals/corfu
commit 66116be876dbe92cd1185db04f7c0507cda4e6c3
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Add completion-predicate to the Corfu commands (Fix #35)
---
 README.org | 5 +++++
 corfu.el   | 6 ++++++
 2 files changed, 11 insertions(+)

diff --git a/README.org b/README.org
index fd64b55..dfd3e15 100644
--- a/README.org
+++ b/README.org
@@ -104,6 +104,11 @@
       ;; TAB cycle if there are only few candidates
       (setq completion-cycle-threshold 3)
 
+      ;; Emacs 28: Hide commands in M-x which do not work in the current mode.
+      ;; Corfu commands are hidden, since they are not supposed to be used via 
M-x.
+      ;; (setq read-extended-command-predicate
+      ;;       #'command-completion-default-include-p)
+
       ;; Enable indentation+completion using the TAB key.
       ;; `completion-at-point' is often bound to M-TAB.
       (setq tab-always-indent 'complete))
diff --git a/corfu.el b/corfu.el
index 85b22ff..31b5df5 100644
--- a/corfu.el
+++ b/corfu.el
@@ -833,5 +833,11 @@ filter string with spaces is allowed."
               (memq major-mode corfu-excluded-modes))
     (corfu-mode 1)))
 
+;; Emacs 28: Do not show Corfu commands with M-X
+(dolist (sym '(corfu-next corfu-previous corfu-first corfu-last corfu-quit
+               corfu-complete corfu-insert corfu-scroll-up corfu-scroll-down
+               corfu-show-location corfu-show-documentation))
+  (put sym 'completion-predicate #'ignore))
+
 (provide 'corfu)
 ;;; corfu.el ends here



reply via email to

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