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

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

[elpa] externals/consult a75c6b6 1/3: README: Improve documentation of c


From: ELPA Syncer
Subject: [elpa] externals/consult a75c6b6 1/3: README: Improve documentation of consult-completing-read-multiple
Date: Wed, 7 Jul 2021 17:57:07 -0400 (EDT)

branch: externals/consult
commit a75c6b619045e777d2122e4dc802fc9cd8da8fd4
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    README: Improve documentation of consult-completing-read-multiple
---
 README.org | 8 ++++++--
 consult.el | 6 +++---
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/README.org b/README.org
index ed08b1a..8d80492 100644
--- a/README.org
+++ b/README.org
@@ -385,8 +385,12 @@ their descriptions.
    buffer to the minibuffer, the server does not receive the updated input. Lsp
    completion should work with Corfu or Company though, which perform the
    completion directly in the original buffer.
-  - =consult-completing-read-multiple=: Enhanced drop-in replacement for
-    =completing-read-multiple= which works better for long candidates.
+ - =consult-completing-read-multiple=: Enhanced drop-in replacement for
+   =completing-read-multiple= which works better for long candidates. Multiple
+   candidates can be selected/deselected by pressing ~RET~ in the default
+   completions UI. In the end the selections are confirmed by pressing ~RET~
+   again. In Vertico and Selectrum, candidates are selected/deselected by
+   pressing ~TAB~, while ~RET~ selects/deselects and exits immediately.
 
 * Special features
   :properties:
diff --git a/consult.el b/consult.el
index acc6479..2ca29db 100644
--- a/consult.el
+++ b/consult.el
@@ -2197,6 +2197,7 @@ See `completing-read-multiple' for the documentation of 
the arguments."
                                        (seq-remove (lambda (x) (member x 
selected))
                                                    orig-candidates))))))
          (orig-md (and (functionp table) (cdr (funcall table "" nil 
'metadata))))
+         (group-fun (alist-get 'group-function orig-md))
          (sort-fun
           (lambda (sort)
             (pcase (alist-get sort orig-md)
@@ -2213,9 +2214,8 @@ See `completing-read-multiple' for the documentation of 
the arguments."
              . ,(lambda (cand transform)
                   (if (get-text-property 0 'consult--crm-selected cand)
                       (if transform cand "Selected")
-                    (or (when-let (group-fun (alist-get 'group-function 
orig-md))
-                          (funcall group-fun cand transform))
-                        (if transform cand "Select multiple")))))
+                    (or (and group-fun (funcall group-fun cand transform)))
+                        (if transform cand "Select multiple"))))
             ,@(funcall sort-fun 'cycle-sort-function)
             ,@(funcall sort-fun 'display-sort-function)
             ,@(seq-filter (lambda (x) (memq (car x) '(annotation-function



reply via email to

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