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

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

[elpa] externals/corfu 0e325d32e4: README: Document how Corfu can be use


From: ELPA Syncer
Subject: [elpa] externals/corfu 0e325d32e4: README: Document how Corfu can be used in the minibuffer
Date: Tue, 18 Jan 2022 17:57:22 -0500 (EST)

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

    README: Document how Corfu can be used in the minibuffer
    
    See #81 and the discussion in 
https://gitlab.com/protesilaos/mct/-/issues/16.
---
 README.org | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/README.org b/README.org
index eea42eb506..b7ea6585bc 100644
--- a/README.org
+++ b/README.org
@@ -134,6 +134,24 @@
   want to create your own Capfs, you can find documentation about completion in
   the 
[[https://www.gnu.org/software/emacs/manual/html_node/elisp/Completion.html][Elisp
 manual]].
 
+** Using Corfu in the minibuffer
+
+Corfu can be used in the minibuffer, since it relies on child frames to display
+the candidates. By default, ~corfu-global-mode~ does not activate ~corfu-mode~ 
in
+the minibuffer, to avoid interference with specialised minibuffer completion 
UIs
+like Vertico or Mct. However you may still want to enable Corfu completion for
+commands like ~M-:~ (~eval-expression~) or ~M-!~ (~shell-command~), which read 
from the
+minibuffer, or more generally for all minibuffer inputs, as long as no other
+completion UI is active. If you use Vertico as your main minibuffer completion
+UI, you can use the following code snippet.
+
+#+begin_src emacs-lisp
+  (defun corfu-enable-in-minibuffer ()
+    "Enable Corfu in the minibuffer only if Vertico is not active."
+    (unless (bound-and-true-p vertico--input) (corfu-mode 1)))
+  (add-hook 'minibuffer-setup-hook #'corfu-enable-in-minibuffer 1)
+#+end_src
+
 ** TAB-and-Go completion
 
 You may be interested in configuring Corfu in TAB-and-Go style. Pressing TAB



reply via email to

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