Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Sorting issue #2 #554
Say I have some candidates as a list of cons cells, and I want them sorted on the cdr of the cell. Is this the right way to do it?
Yes, this is a correct approach. Looking at it now, it is quite a bit clunky. I'm adding a commit to make this work:
(defvar ivy-sorter-data '(("b 1" . 1) ("a 2" . 2) ("d 0" . 0) ("c 5" . 5))) (defun isn (a b) (< (cdr a) (cdr b))) (add-to-list 'ivy-sort-functions-alist '(ivy-sorter . isn)) (ivy-read "string: " ivy-sorter-data :sort t :caller 'ivy-sorter)
added a commit
Jun 13, 2016
That is nice, thanks! That makes things like this possible too.