Created
July 23, 2009 14:48
-
-
Save whym/153020 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Add below to ~/.wl and 'reply-date will be a candidate for wl-summary-sort | |
(defun wl-summary-overview-entity-compare-by-reply-date (a b) | |
"Compare entity X and Y by latest date of replies." | |
(flet ((string-max2 | |
(x y) | |
(cond ((string< x y) y) | |
('t x))) | |
(elmo-entity-to-number | |
(x) | |
(elt (cdr x) 0)) | |
(thread-number-get-date | |
(x) | |
(timezone-make-date-sortable (elmo-msgdb-overview-entity-get-date (elmo-message-entity wl-summary-buffer-elmo-folder x)))) | |
(thread-get-family | |
(x) | |
(cons x (wl-thread-entity-get-descendant (wl-thread-get-entity x)))) | |
(max-reply-date | |
(x) | |
(cond ((eq 'nil x) | |
'nil) | |
((eq 'nil (cdr x)) | |
(thread-number-get-date (car x))) | |
('t | |
(string-max2 (thread-number-get-date (car x)) | |
(max-reply-date (cdr x))))))) | |
(string< | |
(max-reply-date (thread-get-family (elmo-entity-to-number a))) | |
(max-reply-date (thread-get-family (elmo-entity-to-number b)))))) | |
(add-to-list 'wl-summary-sort-specs 'reply-date) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment