emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] master 65979f6 291/348: Heed non-sort entries in ivy-sort-functio


From: Oleh Krehel
Subject: [elpa] master 65979f6 291/348: Heed non-sort entries in ivy-sort-functions-alist
Date: Sat, 8 Apr 2017 11:04:17 -0400 (EDT)

branch: master
commit 65979f62f8e8e75a0bdc3f6a86a65539042a4017
Author: Basil L. Contovounesios <address@hidden>
Commit: Oleh Krehel <address@hidden>

    Heed non-sort entries in ivy-sort-functions-alist
    
    Currently, ivy--sort-function does not distinguish between
    collection functions that are not members of
    ivy-sort-functions-alist and ones whose associated sorting function
    is nil, i.e. no sorting.
    
    In ivy-completing-read, this meant that the lookup in
    ivy-sort-functions-alist would always fall through to the default
    sorting function, even for existing collection functions whose CDR
    was explicitly set to nil.
    
    Fixes #870
---
 ivy.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/ivy.el b/ivy.el
index 95e1e1f..8e42efa 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1770,9 +1770,10 @@ INHERIT-INPUT-METHOD is currently ignored."
               :history history
               :keymap nil
               :sort
-              (let ((sort (or (ivy--sort-function this-command)
-                              (ivy--sort-function t))))
-                (or sort t)))))
+              (let ((sort (assoc this-command ivy-sort-functions-alist)))
+                (if sort
+                    (ivy--sort-function (car sort))
+                  (or (ivy--sort-function t) t))))))
 
 (defvar ivy-completion-beg nil
   "Completion bounds start.")



reply via email to

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