From: teranisi Date: Mon, 16 Sep 2002 08:10:44 +0000 (+0000) Subject: * elmo-msgdb.el (elmo-msgdb-seen-list): Use `elmo-msgdb-unread-marks' X-Git-Tag: elmo-mark-restart~150 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2cb6017593cb52e5faeb94b88fd6dd167d6a8a48;p=elisp%2Fwanderlust.git * elmo-msgdb.el (elmo-msgdb-seen-list): Use `elmo-msgdb-unread-marks' * elmo-imap4.el (elmo-imap4-fetch-callback-1-subr): Set answered mark. (elmo-imap4-folder-list-any-plugged): New function. (elmo-imap4-search-internal-primitive): Use it. * elmo-filter.el (elmo-folder-check): Synchronize original folder only when require-msgdb slot is non-nil. (elmo-folder-close): Clear target folder's msgdb. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index b511394..47c7776 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,15 @@ +2002-09-16 Yuuichi Teranishi + + * elmo-msgdb.el (elmo-msgdb-seen-list): Use `elmo-msgdb-unread-marks' + + * elmo-imap4.el (elmo-imap4-fetch-callback-1-subr): Set answered mark. + (elmo-imap4-folder-list-any-plugged): New function. + (elmo-imap4-search-internal-primitive): Use it. + + * elmo-filter.el (elmo-folder-check): Synchronize original folder + only when require-msgdb slot is non-nil. + (elmo-folder-close): Clear target folder's msgdb. + 2002-09-13 Yuuichi Teranishi * elmo-pop3.el (elmo-folder-msgdb-create): Follow the API change. diff --git a/elmo/elmo-filter.el b/elmo/elmo-filter.el index 4698329..d626e30 100644 --- a/elmo/elmo-filter.el +++ b/elmo/elmo-filter.el @@ -65,16 +65,17 @@ (luna-call-next-method)) (luna-define-method elmo-folder-check ((folder elmo-filter-folder)) - (elmo-folder-synchronize (elmo-filter-folder-target-internal folder))) + (if (elmo-filter-folder-require-msgdb-internal folder) + (elmo-folder-synchronize (elmo-filter-folder-target-internal folder)))) (luna-define-method elmo-folder-close-internal ((folder elmo-filter-folder)) (elmo-folder-close-internal (elmo-filter-folder-target-internal folder))) -(luna-define-method elmo-folder-close :around ((folder elmo-filter-folder)) - ;; Save target msgdb if it is used. +(luna-define-method elmo-folder-close :after ((folder elmo-filter-folder)) + ;; Clear target msgdb if it is used. (if (elmo-filter-folder-require-msgdb-internal folder) - (elmo-folder-close (elmo-filter-folder-target-internal folder))) - (luna-call-next-method)) + (elmo-folder-set-msgdb-internal (elmo-filter-folder-target-internal + folder) nil))) (luna-define-method elmo-folder-commit :around ((folder elmo-filter-folder)) ;; Save target msgdb if it is used. diff --git a/elmo/elmo-imap4.el b/elmo/elmo-imap4.el index b4279f1..7b51c92 100644 --- a/elmo/elmo-imap4.el +++ b/elmo/elmo-imap4.el @@ -810,17 +810,22 @@ If CHOP-LENGTH is not specified, message set is not chopped." elmo-imap4-seen-messages))) (setq mark (or (if (elmo-file-cache-status (elmo-file-cache-get (car entity))) + ;; cached. + (if (member "\\Answered" flags) + elmo-msgdb-answered-cached-mark + (if (or seen + (and use-flag + (member "\\Seen" flags))) + nil + elmo-msgdb-unread-cached-mark)) + (if (member "\\Answered" flags) + elmo-msgdb-answered-uncached-mark (if (or seen (and use-flag (member "\\Seen" flags))) - nil - elmo-msgdb-unread-cached-mark) - (if (or seen - (and use-flag - (member "\\Seen" flags))) - (if elmo-imap4-use-cache - elmo-msgdb-read-uncached-mark) - elmo-msgdb-new-mark))))) + (if elmo-imap4-use-cache + elmo-msgdb-read-uncached-mark) + elmo-msgdb-new-mark)))))) (setq elmo-imap4-current-msgdb (elmo-msgdb-append elmo-imap4-current-msgdb @@ -1884,6 +1889,9 @@ Return nil if no complete line has arrived." ((folder elmo-imap4-folder)) (elmo-imap4-list folder "answered")) +(defun elmo-imap4-folder-list-any-plugged (folder) + (elmo-imap4-list folder "or answered or unseen flagged")) + (luna-define-method elmo-folder-use-flag-p ((folder elmo-imap4-folder)) (not (string-match elmo-imap4-disuse-server-flag-mailbox-regexp (elmo-imap4-folder-mailbox-internal folder)))) @@ -2122,7 +2130,9 @@ If optional argument REMOVE is non-nil, remove FLAG." ((string= "important" (elmo-filter-value filter)) (elmo-folder-list-importants folder)) ((string= "answered" (elmo-filter-value filter)) - (elmo-folder-list-answereds folder)))) + (elmo-folder-list-answereds folder)) + ((string= "any" (elmo-filter-value filter)) + (elmo-imap4-folder-list-any-plugged folder)))) ((or (string= "since" search-key) (string= "before" search-key)) (setq search-key (concat "sent" search-key) diff --git a/elmo/elmo-msgdb.el b/elmo/elmo-msgdb.el index 32203ea..5a46850 100644 --- a/elmo/elmo-msgdb.el +++ b/elmo/elmo-msgdb.el @@ -453,8 +453,8 @@ content of MSGDB is changed." (if (setq mark (elmo-msgdb-get-mark msgdb (elmo-msgdb-overview-entity-get-number (car ov)))) - (if (and mark (member mark (list elmo-msgdb-important-mark - elmo-msgdb-read-uncached-mark))) + (if (and mark (not (member mark + (elmo-msgdb-unread-marks)))) (setq seen-list (cons (elmo-msgdb-overview-entity-get-id (car ov)) seen-list)))