emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master d9c6b43 1/3: Protect flex's display-sort-function against 0-lengt


From: João Távora
Subject: master d9c6b43 1/3: Protect flex's display-sort-function against 0-length candidates
Date: Sat, 9 Nov 2019 09:56:13 -0500 (EST)

branch: master
commit d9c6b4378ac851f5e730daa0ae36c9ee2d0292fe
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>

    Protect flex's display-sort-function against 0-length candidates
    
    * lisp/minibuffer.el (completion--flex-adjust-metadata): Assume a
    candidate missing a score has a score of 0.
---
 lisp/minibuffer.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index cc113b9..5b993e7 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -3496,8 +3496,9 @@ that is non-nil."
                   res
                   (lambda (c1 c2)
                     (or (equal c1 minibuffer-default)
-                        (> (get-text-property 0 'completion-score c1)
-                           (get-text-property 0 'completion-score c2)))))))))
+                        (let ((s1 (get-text-property 0 'completion-score c1))
+                              (s2 (get-text-property 0 'completion-score c2)))
+                          (> (or s1 0) (or s2 0))))))))))
     `(metadata
       (display-sort-function
        . ,(compose-flex-sort-fn



reply via email to

[Prev in Thread] Current Thread [Next in Thread]