[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/flx 813e56a014 115/182: Stabilise search results when scor
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/flx 813e56a014 115/182: Stabilise search results when scores are equal. |
Date: |
Tue, 13 Dec 2022 03:59:35 -0500 (EST) |
branch: elpa/flx
commit 813e56a014eb9a929ad8a58142ee61a35f674276
Author: Le Wang <le.wang@agworld.com.au>
Commit: Le Wang <le.wang@agworld.com.au>
Stabilise search results when scores are equal.
- fixes #60
---
flx-ido.el | 9 ++++++++-
misc/flx-helm-demo.el | 10 ++++++++--
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/flx-ido.el b/flx-ido.el
index 7cb18b0efb..1b9648fdbd 100644
--- a/flx-ido.el
+++ b/flx-ido.el
@@ -178,7 +178,14 @@ If filtered item count is still greater than
`flx-ido-threshold', then use flex.
finally return matches)))
(flx-ido-decorate (delete-consecutive-dups
(sort matches
- (lambda (x y) (> (cadr x) (cadr y))))
+ (lambda (x y)
+ (let ((scorex (cadr x))
+ (scorey (cadr y))
+ (strx (car x))
+ (stry (car y)))
+ (if (= scorex scorey)
+ (not (string< stry strx))
+ (> scorex scorey)))))
t)))
flex-result)))
diff --git a/misc/flx-helm-demo.el b/misc/flx-helm-demo.el
index 34fb4d17fe..417941270a 100644
--- a/misc/flx-helm-demo.el
+++ b/misc/flx-helm-demo.el
@@ -26,8 +26,14 @@ The score info we add here is later removed with another
filter."
(setcdr candidate (cons (cdr candidate) score))
candidate)))
(setq res (sort res
- (lambda (a b)
- (> (caddr a) (caddr b)))))
+ (lambda (x y)
+ (let ((scorex (caddr x))
+ (scorey (caddr y))
+ (strx (car x))
+ (stry (car y)))
+ (if (= scorex scorey)
+ (not (string< stry strx))
+ (> scorex scorey))))))
(loop for item in res
for index from 0
for score = (cddr item)
- [nongnu] elpa/flx 9c5cb5de02 158/182: Merge pull request #95 from emacsjanitors/silencio, (continued)
- [nongnu] elpa/flx 9c5cb5de02 158/182: Merge pull request #95 from emacsjanitors/silencio, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 7017d8416b 163/182: Add LICENSE file., ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx e5c0680ebf 165/182: Add badges to README., ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx f589b237b8 172/182: Add a proper library commentary, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx a62e3dd974 176/182: Add missing license statements, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 5c23a9e87d 180/182: Merge pull request #114 from tarsiiformes/silencio, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 9076fb87af 091/182: Add commentary about using uppercase., ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 2b54391aa6 119/182: Fix helm demo with `.` in query., ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx c3229e0075 134/182: cask install into project root, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx b340205929 143/182: Tidy up docstrings, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 813e56a014 115/182: Stabilise search results when scores are equal.,
ELPA Syncer <=
- [nongnu] elpa/flx e2ed4ea0a7 113/182: Make flex search match case-folding behaviour of flx-ido., ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 10db531369 120/182: Remove spurious space., ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 3f567a4741 126/182: back out clojure style `<`, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 72c9ea0045 082/182: Fix a byte compilation warning, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 502e01673a 106/182: Bump version to 0.3, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx b96f2c3e1d 152/182: Merge pull request #80 from tarsius/silencio, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 82d647a5c6 159/182: Fix incorrect markup in the readme, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 836d5917a3 161/182: Fix typos, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 17f5c9cb2a 162/182: Merge pull request #102 from tarsiiformes/typos, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx c7e8574da3 171/182: Shorten long lines, ELPA Syncer, 2022/12/13