[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/flx 9440288782 086/182: Refactor to make prefix match clea
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/flx 9440288782 086/182: Refactor to make prefix match clear. |
Date: |
Tue, 13 Dec 2022 03:59:32 -0500 (EST) |
branch: elpa/flx
commit 9440288782aa90f95d0c97162076d1f866100f5e
Author: Le Wang <le.wang@agworld.com.au>
Commit: Le Wang <le.wang@agworld.com.au>
Refactor to make prefix match clear.
---
flx-ido.el | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/flx-ido.el b/flx-ido.el
index 45e39a6997..ee97efd6ea 100644
--- a/flx-ido.el
+++ b/flx-ido.el
@@ -91,6 +91,12 @@ item, in which case, the ending items are deleted."
(defvar flx-ido-narrowed-matches-hash (make-hash-table :test 'equal)
"Key is a query string. Value is a list of narrowed matches.")
+(defun flx-ido-is-prefix-match (a b)
+ (let ((min-len (min (length a)
+ (length b))))
+ (eq t (compare-strings b 0 min-len
+ a 0 min-len))))
+
(defun flx-ido-narrowed (query items)
"Get the value from `flx-ido-narrowed-matches-hash' with the
longest prefix match."
@@ -102,10 +108,7 @@ item, in which case, the ending items are deleted."
res)
(cl-loop for key being the hash-key of flx-ido-narrowed-matches-hash
do (when (and (>= (length query-key) (length key))
- (eq t
- (compare-strings query-key 0 (min (length
query-key)
- (length key))
- key 0 nil))
+ (flx-ido-is-prefix-match query-key key)
(or (null best-match)
(> (length key) (length best-match))))
(setq best-match key)
- [nongnu] elpa/flx a15638e403 064/182: Merge pull request #26 from bbatsov/master, (continued)
- [nongnu] elpa/flx a15638e403 064/182: Merge pull request #26 from bbatsov/master, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx c41f9f5087 065/182: reorder README sections, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx d77b703c37 069/182: Merge pull request #28 from bbatsov/marmalade, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 0c41fc616d 072/182: update package install instrucations, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx ce2d375f82 073/182: Makefile: introduce all, clean targets, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx e24352a502 074/182: add usage information, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 6800cc34a9 076/182: flx-ido: fix comment in advice for ido-set-matches-1, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 4cd6d9c9e4 078/182: flx: require cl-lib; avoid ugly eval-when-compile, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 569beec178 080/182: Merge pull request #39 from artagnon/minor-cleanups, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 2903e5d2a7 084/182: Merge pull request #42 from bbatsov/byte-compile-warning, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 9440288782 086/182: Refactor to make prefix match clear.,
ELPA Syncer <=
- [nongnu] elpa/flx a1fef07104 087/182: Fix C-k to kill buffer at head., ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 12589211c6 088/182: Implement case-fold searching, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 80bb88c32f 092/182: Clean test .elcs but never compile them., ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 5591055c33 093/182: Recommend enabling ido-flex., ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 48ebd6c857 094/182: Make prefix-matchine one way., ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 1f46d67762 096/182: Update big list experiment., ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx df036210c6 098/182: Switch to 24.4 delete dup runs algorithm., ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 3fdaea3ec7 097/182: Respecting flx-ido-threshhold., ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 3d631fdd38 101/182: Improve behaviour backspacing flx -> flex., ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx c75f14fbc2 104/182: Fix docstring bugs from checkdoc., ELPA Syncer, 2022/12/13