From 20ac7a19fdd6759a162d440d37df664dc176a8f7 Mon Sep 17 00:00:00 2001 From: teranisi Date: Tue, 16 Jan 2001 08:07:41 +0000 Subject: [PATCH] * 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/ChangeLog | 5 +++++ elmo/elmo-pop3.el | 30 +++++++++++++++++++++++++----- 2 files changed, 30 insertions(+), 5 deletions(-) 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 -- 1.7.10.4