branch: externals/bufferlo
commit f2c670b7592ce0703143dfb452a49e03ed690de1
Author: shipmints <shipmi...@gmail.com>
Commit: shipmints <shipmi...@gmail.com>

    Expand multiple matches in bufferlo--bookmark-completing-read-multiple
    
    This allows CRM completions such as:
    
    todo$, foobar, f[0-9]
    
    Useful for users that want to open many bookmarks by matching names
    with regexps, for example.
---
 bufferlo.el | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/bufferlo.el b/bufferlo.el
index 736844bdde..aedeba7663 100644
--- a/bufferlo.el
+++ b/bufferlo.el
@@ -2513,11 +2513,20 @@ When non-nil, NO-SORT uses the natural order of the 
CANDIDATES list."
 PROMPT is the prompt text ending with a space.
 CANDIDATES are the prompt options to select.
 When non-nil, NO-SORT uses the natural order of the CANDIDATES list."
-  (let* ((comps
+  (let* ((raw-comps
           (completing-read-multiple
            prompt
            (bufferlo--bookmark-completion-table candidates no-sort)
            nil 'require-match nil 'bufferlo-bookmark-history))
+         (comps (mapcan (lambda (raw-comp)
+                          (let ((tmp-comps
+                                 (completion-all-completions
+                                  raw-comp
+                                  candidates nil nil)))
+                            (when (cdr (last tmp-comps))
+                              (setcdr (last tmp-comps) nil))
+                            tmp-comps))
+                        raw-comps))
          (comps (seq-uniq (mapcar (lambda (x) (substring-no-properties x)) 
comps))))
     comps))
 

Reply via email to