{"action":"closed","issue":{"url":"https://api.github.com/repos/abo-abo/swiper/issues/554","repository_url":"https://api.github.com/repos/abo-abo/swiper","labels_url":"https://api.github.com/repos/abo-abo/swiper/issues/554/labels{/name}","comments_url":"https://api.github.com/repos/abo-abo/swiper/issues/554/comments","events_url":"https://api.github.com/repos/abo-abo/swiper/issues/554/events","html_url":"https://github.com/abo-abo/swiper/issues/554","id":159839501,"number":554,"title":"Sorting issue #2","user":{"login":"jkitchin","id":1610070,"avatar_url":"https://avatars.githubusercontent.com/u/1610070?v=3","gravatar_id":"","url":"https://api.github.com/users/jkitchin","html_url":"https://github.com/jkitchin","followers_url":"https://api.github.com/users/jkitchin/followers","following_url":"https://api.github.com/users/jkitchin/following{/other_user}","gists_url":"https://api.github.com/users/jkitchin/gists{/gist_id}","starred_url":"https://api.github.com/users/jkitchin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkitchin/subscriptions","organizations_url":"https://api.github.com/users/jkitchin/orgs","repos_url":"https://api.github.com/users/jkitchin/repos","events_url":"https://api.github.com/users/jkitchin/events{/privacy}","received_events_url":"https://api.github.com/users/jkitchin/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-06-12T17:59:27Z","updated_at":"2016-06-13T16:20:35Z","closed_at":"2016-06-13T16:20:35Z","body":"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?\r\n\r\n```\r\n#+BEGIN_SRC emacs-lisp\r\n(defvar ivy-sorter-data '((\"b 1\" . 1) (\"a 2\" . 2) (\"d 0\" . 0) (\"c 5\" . 5)))\r\n\r\n(defun isn (a b)\r\n  (< (cdr (assoc a ivy-sorter-data)) (cdr (assoc b ivy-sorter-data))))\r\n\r\n(add-to-list 'ivy-sort-functions-alist '(ivy-sorter . isn))\r\n\r\n(defun ivy-sorter (&rest args) (mapcar 'car ivy-sorter-data))\r\n\r\n(ivy-read \"string: \" 'ivy-sorter\r\n\t  :sort t)\r\n#+END_SRC\r\n```"}}
{"actor":{"display_login":"abo-abo"}}