[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/flx 48ebd6c857 094/182: Make prefix-matchine one way.
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/flx 48ebd6c857 094/182: Make prefix-matchine one way. |
Date: |
Tue, 13 Dec 2022 03:59:33 -0500 (EST) |
branch: elpa/flx
commit 48ebd6c857cce9cf41f98ebffef7f72b79caa2eb
Author: Le Wang <le.wang@agworld.com.au>
Commit: Le Wang <le.wang@agworld.com.au>
Make prefix-matchine one way.
---
flx-ido.el | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/flx-ido.el b/flx-ido.el
index 3a99ba0fd2..414b01137e 100644
--- a/flx-ido.el
+++ b/flx-ido.el
@@ -97,6 +97,12 @@ item, in which case, the ending items are deleted."
(length b))))
(eq t (compare-strings b 0 min-len
a 0 min-len))))
+(defun flx-ido-is-prefix-match (str prefix)
+ "Return t if PREFIX is PREFIX of STR"
+ (when (and str prefix)
+ (let ((length (length prefix)))
+ (eq t (compare-strings prefix 0 length
+ str 0 length)))))
(defun flx-ido-narrowed (query items)
"Get the value from `flx-ido-narrowed-matches-hash' with the
@@ -108,15 +114,15 @@ item, in which case, the ending items are deleted."
exact
res)
(cl-loop for key being the hash-key of flx-ido-narrowed-matches-hash
- do (when (and (>= (length query-key) (length key))
- (flx-ido-is-prefix-match query-key key)
- (or (null best-match)
- (> (length key) (length best-match))))
- (setq best-match key)
- (when (= (length key)
- (length query-key))
- (setq exact t)
- (cl-return))))
+ do (when (and (>= (length query-key) (length key))
+ (flx-ido-is-prefix-match query-key key)
+ (or (null best-match)
+ (> (length key) (length best-match))))
+ (setq best-match key)
+ (when (= (length key)
+ (length query-key))
+ (setq exact t)
+ (cl-return))))
(setq res (cond (exact
(gethash best-match flx-ido-narrowed-matches-hash))
(best-match
- [nongnu] elpa/flx e24352a502 074/182: add usage information, (continued)
- [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, 2022/12/13
- [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 <=
- [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
- [nongnu] elpa/flx 6797797426 105/182: Update status in README.md., ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx a154058007 108/182: Use ido's name canonicalization., ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx acd4334893 109/182: Increase threshold to 2000., ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx a59c08283d 110/182: Simplify caching, implement own flex., ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 3032920883 117/182: Fix search results changing positions as you type., ELPA Syncer, 2022/12/13