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

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

[nongnu] elpa/flx 9200e27309 083/182: use "flex" filtering when collecti


From: ELPA Syncer
Subject: [nongnu] elpa/flx 9200e27309 083/182: use "flex" filtering when collection too large
Date: Tue, 13 Dec 2022 03:59:32 -0500 (EST)

branch: elpa/flx
commit 9200e2730956272c693738e52a2095ffc87cb363
Author: Le Wang <le.wang@agworld.com.au>
Commit: Le Wang <le.wang@agworld.com.au>

    use "flex" filtering when collection too large
    
    #44
---
 flx-ido.el | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/flx-ido.el b/flx-ido.el
index f9c69aa3e7..d8fa437544 100644
--- a/flx-ido.el
+++ b/flx-ido.el
@@ -150,12 +150,7 @@ item, in which case, the ending items are deleted."
         (flx-ido-decorate (ido-delete-runs
                            (sort matches
                                  (lambda (x y) (> (cadr x) (cadr y)))))))
-    (let ((regexp (mapconcat 'identity (split-string query "" t) ".*")))
-      (cl-loop for item in items
-            if (string-match regexp (if (consp item) (car item) item))
-            collect item
-            into matches
-            finally return matches))))
+    (throw :too-big :too-big)))
 
 (defun flx-ido-key-for-query (query)
   (concat ido-current-directory query))
@@ -197,8 +192,10 @@ item, in which case, the ending items are deleted."
 
 (defadvice ido-set-matches-1 (around flx-ido-set-matches-1 activate)
   "Choose between the regular ido-set-matches-1 and flx-ido-match"
-  (if flx-ido-mode
-      (setq ad-return-value (flx-ido-match ido-text (ad-get-arg 0)))
+  (when (or (not flx-ido-mode)
+            (eq :too-big
+                (catch :too-big
+                  (setq ad-return-value (flx-ido-match ido-text (ad-get-arg 
0))))))
     ad-do-it))
 
 ;;;###autoload



reply via email to

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