summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2022-02-08 13:27:04 +0100
committerDaniel Mendler <mail@daniel-mendler.de>2022-02-08 13:27:04 +0100
commit7f84ff41f11dbe7f521f9e4ec02af0a5dc4e9ed4 (patch)
treef7581f7c0080cf7b10bd5a01a7deba4aa11eb720
parente1b9e9a72da63fd6355f129794b08419a1e2f0bc (diff)
README: Document transfer to the minibuffer
-rw-r--r--README.org24
1 files changed, 24 insertions, 0 deletions
diff --git a/README.org b/README.org
index b4127fd..a56b5ea 100644
--- a/README.org
+++ b/README.org
@@ -285,6 +285,30 @@ moves to the next candidate and further input will then commit the selection.
(corfu-global-mode))
#+end_src
+** Transfer completion to the minibuffer
+
+Sometimes it is useful to transfer the Corfu completion session to the
+minibuffer, since the minibuffer offers richer interaction features. In
+particular, [[https://github.com/oantolin/embark][Embark]] is available in the minibuffer, such that you can act on the
+candidates or export/collect the candidates to a separate buffer. Hopefully we
+can also add Corfu-support to Embark in the future, such that at least
+export/collect is possible directly from Corfu. But in my opinion having the
+ability to transfer the Corfu completion to the minibuffer is an even better
+feature, since further completion can be performed there.
+
+The command ~corfu-move-to-minibuffer~ is defined here in terms of
+~consult-completion-in-region~, which uses the minibuffer completion UI via
+~completing-read~.
+
+#+begin_src emacs-lisp
+ (defun corfu-move-to-minibuffer ()
+ (interactive)
+ (let ((completion-extra-properties corfu--extra)
+ completion-cycle-threshold completion-cycling)
+ (apply #'consult-completion-in-region completion-in-region--data)))
+ (define-key corfu-map "\M-m" #'corfu-move-to-minibuffer)
+#+end_src
+
* Key bindings
Corfu uses a transient keymap ~corfu-map~ which is active while the popup is shown.