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

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

[elpa] externals/orderless 938c7639ad 006/204: Finish fixing problem wit


From: ELPA Syncer
Subject: [elpa] externals/orderless 938c7639ad 006/204: Finish fixing problem with file completion
Date: Tue, 11 Jan 2022 12:58:12 -0500 (EST)

branch: externals/orderless
commit 938c7639ad420e5c6164b4c883100467e8396330
Author: Omar Antolín <omar.antolin@gmail.com>
Commit: Omar Antolín <omar.antolin@gmail.com>

    Finish fixing problem with file completion
---
 orderless.el | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/orderless.el b/orderless.el
index 087c80eb5f..b324fc75c5 100644
--- a/orderless.el
+++ b/orderless.el
@@ -50,21 +50,23 @@
     (when minibuffer-completing-file-name
       (setq all (completion-pcm--filename-try-filter all)))
     (condition-case err
-        (cl-loop for candidate in all
-                 when (cl-loop for regexp in regexps
-                               always (string-match-p regexp candidate))
-                 collect candidate)
+        (nconc
+         (cl-loop for candidate in all
+                  when (cl-loop for regexp in regexps
+                                always (string-match-p regexp candidate))
+                  collect candidate)
+         (length prefix))
       (invalid-regexp nil))))
 
 (defun orderless-try-completion (string table pred point &optional _metadata)
   (let* ((lim (car (completion-boundaries string table pred "")))
          (prefix (substring string 0 lim))
          (all (orderless-all-completions string table pred point)))
-    (cl-flet ((point-at-end (str) (cons str (length str))))
+    (cl-flet ((measured (string) (cons string (length string))))
       (cond
        ((null all) nil)
-       ((null (cdr all)) (point-at-end (concat prefix (car all))))
-       (t (point-at-end string))))))
+       ((atom (cdr all)) (measured (concat prefix (car all))))
+       (t (measured string))))))
 
 (push '(orderless
         orderless-try-completion orderless-all-completions



reply via email to

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