From: teranisi Date: Tue, 16 Jan 2001 08:07:41 +0000 (+0000) Subject: * elmo-pop3.el (elmo-pop3-sort-overview-by-original-number): New function. X-Git-Tag: wl-2_4_1pre~4 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=20ac7a19fdd6759a162d440d37df664dc176a8f7;p=elisp%2Fwanderlust.git * elmo-pop3.el (elmo-pop3-sort-overview-by-original-number): New function. (elmo-pop3-sort-msgdb-by-original-number): Ditto. (elmo-pop3-msgdb-create-as-numlist): Use it. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 53fc6e5..9311371 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,5 +1,10 @@ 2001-01-16 Yuuichi Teranishi + * elmo-pop3.el (elmo-pop3-sort-overview-by-original-number): + New function. + (elmo-pop3-sort-msgdb-by-original-number): Ditto. + (elmo-pop3-msgdb-create-as-numlist): Use it. + * elmo-imap4.el (elmo-imap4-arrival-filter): Check process-buffer. (Based on the report by AMAKAWA Shuhei ) diff --git a/elmo/elmo-pop3.el b/elmo/elmo-pop3.el index cb4ac69..d2c18de 100644 --- a/elmo/elmo-pop3.el +++ b/elmo/elmo-pop3.el @@ -520,6 +520,25 @@ (defalias 'elmo-pop3-msgdb-create 'elmo-pop3-msgdb-create-as-numlist) +(defun elmo-pop3-sort-overview-by-original-number (overview loc-alist) + (sort overview + (lambda (ent1 ent2) + (< (elmo-pop3-uidl-to-number + (cdr (assq (elmo-msgdb-overview-entity-get-number ent1) + loc-alist))) + (elmo-pop3-uidl-to-number + (cdr (assq (elmo-msgdb-overview-entity-get-number ent2) + loc-alist))))))) + +(defun elmo-pop3-sort-msgdb-by-original-number (msgdb) + (message "Sorting...") + (let ((overview (elmo-msgdb-get-overview msgdb))) + (setq overview (elmo-pop3-sort-overview-by-original-number + overview + (elmo-msgdb-get-location msgdb))) + (message "Sorting...done") + (list overview (nth 1 msgdb)(nth 2 msgdb)(nth 3 msgdb)(nth 4 msgdb)))) + (defun elmo-pop3-msgdb-create-as-numlist (spec numlist new-mark already-mark seen-mark important-mark seen-list @@ -532,11 +551,12 @@ (setq loc-alist (if msgdb (elmo-msgdb-get-location msgdb) (elmo-msgdb-location-load (elmo-msgdb-expand-path spec))))) - (elmo-msgdb-sort-by-date - (elmo-pop3-msgdb-create-by-header process numlist - new-mark already-mark - seen-mark seen-list - loc-alist))))) + (with-current-buffer (process-buffer process) + (elmo-pop3-sort-msgdb-by-original-number + (elmo-pop3-msgdb-create-by-header process numlist + new-mark already-mark + seen-mark seen-list + loc-alist)))))) (defun elmo-pop3-uidl-to-number (uidl) (string-to-number (elmo-get-hash-val uidl