From 9e0f75cd4d9a7b314ca4454c78640bd4de8f631b Mon Sep 17 00:00:00 2001 From: okada Date: Tue, 17 Oct 2000 12:45:43 +0000 Subject: [PATCH] * elmo-msgdb.el (elmo-msgdb-killed-list-length): New function. * elmo-localdir.el (elmo-localdir-list-folder-subr): Fix. * elmo-maildir.el (elmo-maildir-list-folder-subr): Fix. * elmo-archive.el (elmo-archive-list-folder-subr): Fix. * elmo-internal.el (elmo-internal-list-folder-subr): Fix. * elmo-imap4.el (elmo-imap4-max-of-folder): Fix. --- elmo/ChangeLog | 9 +++++++++ elmo/elmo-archive.el | 3 ++- elmo/elmo-imap4.el | 9 ++++++++- elmo/elmo-internal.el | 3 ++- elmo/elmo-localdir.el | 3 ++- elmo/elmo-maildir.el | 3 ++- elmo/elmo-msgdb.el | 10 ++++++++++ 7 files changed, 35 insertions(+), 5 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 0e3e69a..30ec1cc 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,12 @@ +2000-10-17 Kenichi OKADA + + * elmo-msgdb.el (elmo-msgdb-killed-list-length): New function. + * elmo-localdir.el (elmo-localdir-list-folder-subr): Fix. + * elmo-maildir.el (elmo-maildir-list-folder-subr): Fix. + * elmo-archive.el (elmo-archive-list-folder-subr): Fix. + * elmo-internal.el (elmo-internal-list-folder-subr): Fix. + * elmo-imap4.el (elmo-imap4-max-of-folder): Fix. + 2000-10-17 Akihiro MOTOKI * elmo-msgdb.el (elmo-msgdb-search-internal-primitive): Search by diff --git a/elmo/elmo-archive.el b/elmo/elmo-archive.el index 6bb7c80..3a82579 100644 --- a/elmo/elmo-archive.el +++ b/elmo/elmo-archive.el @@ -266,7 +266,8 @@ TYPE specifies the archiver's symbol." (if nonsort (cons (or (elmo-max-of-list file-list) 0) (if killed - (- (length file-list) (length killed)) + (- (length file-list) + (elmo-msgdb-killed-list-length killed)) (length file-list))) (setq numbers (sort file-list '<)) (elmo-living-messages numbers killed)))) diff --git a/elmo/elmo-imap4.el b/elmo/elmo-imap4.el index f91a04f..0b38a4d 100644 --- a/elmo/elmo-imap4.el +++ b/elmo/elmo-imap4.el @@ -618,6 +618,9 @@ BUFFER must be a single-byte buffer." (defun elmo-imap4-max-of-folder (spec) (let ((session (elmo-imap4-get-session spec)) + (killed (and elmo-use-killed-list + (elmo-msgdb-killed-list-load + (elmo-msgdb-expand-path spec)))) status) (with-current-buffer (elmo-network-session-buffer session) (setq elmo-imap4-status-callback nil) @@ -632,7 +635,11 @@ BUFFER must be a single-byte buffer." 'status)) (cons (- (elmo-imap4-response-value status 'uidnext) 1) - (elmo-imap4-response-value status 'messages)))) + (if killed + (- + (elmo-imap4-response-value status 'messages) + (elmo-msgdb-killed-list-length killed)) + (elmo-imap4-response-value status 'messages))))) (defun elmo-imap4-folder-diff (spec folder &optional number-list) (if elmo-use-server-diff diff --git a/elmo/elmo-internal.el b/elmo/elmo-internal.el index d504393..e402bf8 100644 --- a/elmo/elmo-internal.el +++ b/elmo/elmo-internal.el @@ -43,7 +43,8 @@ (if nonsort (cons (or (elmo-max-of-list flist) 0) (if killed - (- (length flist) (length killed)) + (- (length flist) + (elmo-msgdb-killed-list-length killed)) (length flist))) (setq numbers (sort flist '<)) (elmo-living-messages numbers killed)))) diff --git a/elmo/elmo-localdir.el b/elmo/elmo-localdir.el index 89a4c43..3b68094 100644 --- a/elmo/elmo-localdir.el +++ b/elmo/elmo-localdir.el @@ -227,7 +227,8 @@ (if nonsort (cons (or (elmo-max-of-list flist) 0) (if killed - (- (length flist) (length killed)) + (- (length flist) + (elmo-msgdb-killed-list-length killed)) (length flist))) (setq numbers (sort flist '<)) (elmo-living-messages numbers killed)))) diff --git a/elmo/elmo-maildir.el b/elmo/elmo-maildir.el index 9d0d3b5..84e1aa2 100644 --- a/elmo/elmo-maildir.el +++ b/elmo/elmo-maildir.el @@ -360,7 +360,8 @@ file name for maildir directories." (cons (+ (or (elmo-max-of-list flist) 0) (length news)) (+ (length news) (if killed - (- (length flist) (length killed)) + (- (length flist) + (elmo-msgdb-killed-list-length killed)) (length flist)))) (setq numbers (sort flist '<)) (elmo-living-messages numbers killed)))) diff --git a/elmo/elmo-msgdb.el b/elmo/elmo-msgdb.el index 18f9eaf..4a5e6ed 100644 --- a/elmo/elmo-msgdb.el +++ b/elmo/elmo-msgdb.el @@ -652,6 +652,16 @@ content of MSGDB is changed." (elmo-msgdb-killed-list-load dir) msgs)))) +(defun elmo-msgdb-killed-list-length (killed-list) + (let ((killed killed-list) + (ret-val 0)) + (while (car killed) + (if (consp (car killed)) + (setq ret-val (+ ret-val 1 (- (cdar killed) (caar killed)))) + (setq ret-val (+ ret-val 1))) + (setq killed (cdr killed))) + ret-val)) + (defun elmo-living-messages (messages killed-list) (if killed-list (delq nil -- 1.7.10.4