From: hmurata Date: Thu, 24 Oct 2002 17:36:10 +0000 (+0000) Subject: * elmo-msgdb.el (elmo-msgdb-set-flag): Use X-Git-Tag: elmo-mark-restart~102 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=877cb6c823f06b9e97c72f6d6b1e17385c865ecb;p=elisp%2Fwanderlust.git * elmo-msgdb.el (elmo-msgdb-set-flag): Use `elmo-file-cache-exists-p'; use proper mark that depends on `use-cache'. (elmo-msgdb-unset-flag): Ditto. (elmo-msgdb-set-cached): Ditto. added argument `use-cache'. * elmo.el (elmo-message-set-cached): Call `elmo-msgdb-set-cached' with 4th argument `use-cache'. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 262835e..3bda2b4 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,14 @@ +2002-10-24 Hiroya Murata + + * elmo-msgdb.el (elmo-msgdb-set-flag): Use + `elmo-file-cache-exists-p'; use proper mark that depends on + `use-cache'. + (elmo-msgdb-unset-flag): Ditto. + (elmo-msgdb-set-cached): Ditto. added argument `use-cache'. + + * elmo.el (elmo-message-set-cached): Call `elmo-msgdb-set-cached' + with 4th argument `use-cache'. + 2002-10-18 Yuuichi Teranishi * elmo.el (elmo-folder-unmark-important): Follow the changes above. diff --git a/elmo/elmo-msgdb.el b/elmo/elmo-msgdb.el index 44fab6b..7424186 100644 --- a/elmo/elmo-msgdb.el +++ b/elmo/elmo-msgdb.el @@ -120,7 +120,7 @@ if MARK is nil, mark is removed." ;; return value. t)) -(defun elmo-msgdb-set-cached (msgdb number cached) +(defun elmo-msgdb-set-cached (msgdb number cached use-cache) "Set message cache status. If mark is changed, return non-nil." (let* ((cur-mark (elmo-msgdb-get-mark msgdb number)) @@ -131,13 +131,14 @@ If mark is changed, return non-nil." 'answered) ((not (member cur-mark (elmo-msgdb-unread-marks))) 'read))) - (cur-cached (not (member cur-mark (elmo-msgdb-uncached-marks))))) + (cur-cached (elmo-file-cache-exists-p + (elmo-msgdb-get-field msgdb number 'message-id)))) (unless (eq cached cur-cached) (case cur-flag (read (elmo-msgdb-set-mark msgdb number - (unless cached - elmo-msgdb-read-uncached-mark))) + (if (and use-cache (not cached)) + elmo-msgdb-read-uncached-mark))) (important nil) (answered (elmo-msgdb-set-mark msgdb number @@ -168,7 +169,8 @@ FLAG is a symbol which is one of the following: 'answered) ((not (member cur-mark (elmo-msgdb-unread-marks))) 'read))) - (cur-cached (not (member cur-mark (elmo-msgdb-uncached-marks)))) + (cur-cached (elmo-file-cache-exists-p + (elmo-msgdb-get-field msgdb number 'message-id))) mark-modified) (case flag (read @@ -186,9 +188,7 @@ FLAG is a symbol which is one of the following: (unless (or (eq cur-flag 'answered) (eq cur-flag 'important)) (elmo-msgdb-set-mark msgdb number (if cur-cached - (if use-cache - elmo-msgdb-answered-cached-mark - elmo-msgdb-answered-uncached-mark) + elmo-msgdb-answered-cached-mark elmo-msgdb-answered-uncached-mark))) (setq mark-modified t))) (if mark-modified (elmo-folder-set-mark-modified-internal folder t)))) @@ -211,13 +211,14 @@ FLAG is a symbol which is one of the following: 'answered) ((not (member cur-mark (elmo-msgdb-unread-marks))) 'read))) - (cur-cached (not (member cur-mark (elmo-msgdb-uncached-marks)))) + (cur-cached (elmo-file-cache-exists-p + (elmo-msgdb-get-field msgdb number 'message-id))) mark-modified) (case flag (read (when (eq cur-flag 'read) (elmo-msgdb-set-mark msgdb number - (if (and cur-cached use-cache) + (if cur-cached elmo-msgdb-unread-cached-mark elmo-msgdb-unread-uncached-mark)) (setq mark-modified t))) @@ -228,7 +229,7 @@ FLAG is a symbol which is one of the following: (answered (when (eq cur-flag 'answered) (elmo-msgdb-set-mark msgdb number - (if (and cur-cached (not use-cache)) + (if (and use-cache (not cur-cached)) elmo-msgdb-read-uncached-mark)) (setq mark-modified t)))) (if mark-modified (elmo-folder-set-mark-modified-internal folder t)))) diff --git a/elmo/elmo.el b/elmo/elmo.el index 42f5448..2676cf0 100644 --- a/elmo/elmo.el +++ b/elmo/elmo.el @@ -1114,8 +1114,10 @@ Return a cons cell of (NUMBER-CROSSPOSTS . NEW-MARK-ALIST).") FOLDER is the ELMO folder structure. NUMBER is a number of the message. If CACHED is t, message mark is set as cached." - (when (elmo-msgdb-set-cached - (elmo-folder-msgdb folder) number cached) + (when (elmo-msgdb-set-cached (elmo-folder-msgdb folder) + number + cached + (elmo-message-use-cache-p folder number)) (elmo-folder-set-mark-modified-internal folder t)))