branch: elpa/flx commit 46a1b294829b275c6d4e0f999758db910f2c0b99 Merge: 813e56a014 3032920883 Author: Le Wang <l26w...@gmail.com> Commit: Le Wang <l26w...@gmail.com>
Merge pull request #62 from bsuh/fix61 Fix #61 by reverting fix for #60 and fixing the root problem. --- flx-ido.el | 11 ++--------- misc/flx-helm-demo.el | 10 ++-------- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/flx-ido.el b/flx-ido.el index 1b9648fdbd..bc85adab89 100644 --- a/flx-ido.el +++ b/flx-ido.el @@ -178,14 +178,7 @@ 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) - (let ((scorex (cadr x)) - (scorey (cadr y)) - (strx (car x)) - (stry (car y))) - (if (= scorex scorey) - (not (string< stry strx)) - (> scorex scorey))))) + (lambda (x y) (> (cadr x) (cadr y)))) t))) flex-result))) @@ -238,7 +231,7 @@ Our implementation always uses flex and doesn't care about substring matches." (if (string-match re name) (setq matches (cons item matches))))) items) - (delete-consecutive-dups matches t)))) + (delete-consecutive-dups (nreverse matches) t)))) (defadvice ido-exit-minibuffer (around flx-ido-reset activate) "Remove flx properties after." diff --git a/misc/flx-helm-demo.el b/misc/flx-helm-demo.el index 417941270a..34fb4d17fe 100644 --- a/misc/flx-helm-demo.el +++ b/misc/flx-helm-demo.el @@ -26,14 +26,8 @@ The score info we add here is later removed with another filter." (setcdr candidate (cons (cdr candidate) score)) candidate))) (setq res (sort res - (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)))))) + (lambda (a b) + (> (caddr a) (caddr b))))) (loop for item in res for index from 0 for score = (cddr item)