[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/corfu 5b7a40b006 2/2: README: Simplify configuration
From: |
ELPA Syncer |
Subject: |
[elpa] externals/corfu 5b7a40b006 2/2: README: Simplify configuration |
Date: |
Sat, 13 Jul 2024 09:57:47 -0400 (EDT) |
branch: externals/corfu
commit 5b7a40b006cc93d502b2ffd48368ff35fb596b3f
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
README: Simplify configuration
---
README.org | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/README.org b/README.org
index ceb284f51d..68488a3656 100644
--- a/README.org
+++ b/README.org
@@ -415,7 +415,7 @@ open. This can feel intrusive, in particular in combination
with auto
completion. ~RET~ may accidentally commit an automatically selected candidate,
while you actually wanted to start a new line. As an alternative we can unbind
the ~RET~ key completely from ~corfu-map~ or reserve the ~RET~ key only in
shell
-modes.
+modes using a menu-item filter.
#+begin_src emacs-lisp
;; TAB-only configuration
@@ -430,15 +430,14 @@ modes.
;; Option 1: Unbind RET completely
;;; ("RET" . nil)
;; Option 2: Use RET only in shell modes
- ("RET" . (menu-item "" nil :filter corfu-send-filter)))
+ ("RET" . (menu-item
+ "" nil :filter
+ (lambda (&optional _)
+ (and (or (derived-mode-p 'eshell-mode) (derived-mode-p
'comint-mode))
+ #'corfu-send)))))
:init
(global-corfu-mode))
-
-(defun corfu-send-filter (&optional _)
- "Insert completion candidate and send when inside comint/eshell."
- (when (or (derived-mode-p 'eshell-mode) (derived-mode-p 'comint-mode))
- #'corfu-send))
#+end_src
** TAB-and-Go completion