mu4e: tweak the contact sorting

Fall back to freq / tstamp when both contacts are personal.
This commit is contained in:
djcb 2016-01-03 15:53:07 +02:00
parent b373f8e5f0
commit 5e13d31450
1 changed files with 10 additions and 8 deletions

View File

@ -674,14 +674,16 @@ frequency."
(tstamp2 (plist-get c2 :tstamp))) (tstamp2 (plist-get c2 :tstamp)))
;; personal contacts come first ;; personal contacts come first
(if (or personal1 personal2) (if (or personal1 personal2)
(if personal1 t nil) (if (not (and personal1 personal2))
;; then come recently seen ones; but only if they're not in ;; if only one is personal, that one comes first
;; the future (as seen in spams) (if personal1 t nil)
(if (and (<= tstamp1 now) (<= tstamp2 now) ;; then come recently seen ones; but only if they're not in
(or (> tstamp1 recent) (> tstamp2 recent))) ;; the future (as seen in spams)
(> tstamp1 tstamp2) (if (and (<= tstamp1 now) (<= tstamp2 now)
;; otherwise, use the frequency (or (> tstamp1 recent) (> tstamp2 recent)))
(> freq1 freq2)))))))) (> tstamp1 tstamp2)
;; otherwise, use the frequency
(> freq1 freq2)))))))))
;; start and stopping ;; start and stopping
(defun mu4e~fill-contacts (contacts) (defun mu4e~fill-contacts (contacts)