mu4e: use sorted list in mu4e-contacts-info

Sort by rank.
This commit is contained in:
Dirk-Jan C. Binnema 2020-10-18 12:53:43 +03:00
parent 2eb8fc82ad
commit 3937b70f13
1 changed files with 9 additions and 3 deletions

View File

@ -710,9 +710,15 @@ completion; for testing/debugging."
(when mu4e~contacts
(insert (format "number of contacts cached: %d\n\n"
(hash-table-count mu4e~contacts)))
(maphash (lambda(key _val)
(insert (format "%S\n" key))) mu4e~contacts)))
(pop-to-buffer "*mu4e-contacts-info*"))
(let ((contacts))
(maphash (lambda (addr rank)
(setq contacts (cons (cons rank addr) contacts))) mu4e~contacts)
(setq contacts (sort contacts
(lambda(cell1 cell2) (< (car cell1) (car cell2)))))
(dolist (contact contacts)
(insert (format "%s\n" (cdr contact))))))
(pop-to-buffer "*mu4e-contacts-info*")))
(defun mu4e~check-requirements ()
"Check for the settings required for running mu4e."