[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/flx 11f3fad14f 041/182: get complete cache key more smartl
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/flx 11f3fad14f 041/182: get complete cache key more smartly |
Date: |
Tue, 13 Dec 2022 03:59:23 -0500 (EST) |
branch: elpa/flx
commit 11f3fad14fa9b0c55c153db732d92a7a69c2fd6c
Author: Le Wang <le.wang@agworld.com.au>
Commit: Le Wang <le.wang@agworld.com.au>
get complete cache key more smartly
#14
---
flx-ido.el | 26 +++++++++++---------------
1 file changed, 11 insertions(+), 15 deletions(-)
diff --git a/flx-ido.el b/flx-ido.el
index 8d1f18dfc9..2927ac8076 100644
--- a/flx-ido.el
+++ b/flx-ido.el
@@ -13,7 +13,7 @@
;; Version: 0.1
;; Last-Updated:
;; By:
-;; Update #: 32
+;; Update #: 34
;; URL:
;; Keywords:
;; Compatibility:
@@ -85,10 +85,10 @@ item, in which case, the ending items are deleted."
(defvar flx-ido-narrowed-matches-hash (make-hash-table :test 'equal))
-(defun flx-ido-narrowed (items)
+(defun flx-ido-narrowed (query items)
"Get the value from `flx-ido-narrowed-matches-hash' with the
longest prefix match."
- (let ((query-key (flx-ido-key-for-query))
+ (let ((query-key (flx-ido-key-for-query query))
best-match
exact
res)
@@ -142,31 +142,27 @@ item, in which case, the ending items are deleted."
(sort matches
(lambda (x y) (> (cadr x) (cadr y))))))))
-(defun flx-ido-key-for-query ()
- (if (boundp 'prompt)
- (buffer-substring-no-properties (+ (point-min)
- (length prompt))
- (point))
- ido-text))
+(defun flx-ido-key-for-query (query)
+ (concat ido-current-directory query))
-(defun flx-ido-cache (items)
+(defun flx-ido-cache (query items)
(if (consp (car items))
items
- (puthash (flx-ido-key-for-query) items flx-ido-narrowed-matches-hash)))
+ (puthash (flx-ido-key-for-query query) items
flx-ido-narrowed-matches-hash)))
(defun flx-ido-match (query items)
"Better sorting for flx ido matching."
(when (and (equal "" query)
- (not (gethash (flx-ido-key-for-query)
+ (not (gethash (flx-ido-key-for-query query)
flx-ido-narrowed-matches-hash)))
;; original function reverses list.
(setq items (nreverse (ido-delete-runs items)))
- (flx-ido-cache items))
+ (flx-ido-cache query items))
(destructuring-bind (exact res-items)
- (flx-ido-narrowed items)
+ (flx-ido-narrowed query items)
(if exact ; `ido-rotate' case is covered by exact
match
res-items
- (flx-ido-cache (flx-ido-match-internal query res-items)))))
+ (flx-ido-cache query (flx-ido-match-internal query res-items)))))
(defvar flx-ido-use t
"Use flx matching for ido.")
- [nongnu] elpa/flx 7110df04e2 005/182: update tests, (continued)
- [nongnu] elpa/flx 7110df04e2 005/182: update tests, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx fabca711e9 013/182: fix typo, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx dc739574ad 011/182: add helm demo without flx, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 955772f489 029/182: optimize full-match boost, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 0519734c5b 030/182: consider runs of capitals to be same word, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx e80bc0dea4 018/182: more ido optimizations, refactor out flx-propertize, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx a31814e5ef 031/182: update README to say alpha, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 5ab18c3101 024/182: fix over manipulation of strings, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx fd10bf595d 025/182: fix typo, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx af1010e4ad 035/182: Reverting "fix `ido-merge-work-directories`", ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 11f3fad14f 041/182: get complete cache key more smartly,
ELPA Syncer <=
- [nongnu] elpa/flx c6601c7162 022/182: readme update, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx a13d654096 045/182: disable caching for files/dirs for now, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 1f175f3c65 047/182: add comment about disabling ido faces, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 222f60d28e 055/182: Merge pull request #18 from jschaf/master, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 1d86d3bc09 052/182: cache clearing advice should be "before", ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx a0de931381 048/182: bump version, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 3b650d13f7 057/182: Merge pull request #23 from bbatsov/doc-improvements, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx f3ccfc9168 049/182: make warning less dramatic, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx acf230e2c9 102/182: Lower default flx-ido-threshold -> 500., ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx a1ac8f97ec 034/182: fix `ido-merge-work-directories`, ELPA Syncer, 2022/12/13