From: hmurata Date: Tue, 25 Dec 2001 12:23:16 +0000 (+0000) Subject: * elmo.el (elmo-message-fetch-with-cache-process): Rewrite. X-Git-Tag: wl-2_9_5~61 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=39090b30b52065a0b393e06ab43c989b97118051;p=elisp%2Fwanderlust.git * elmo.el (elmo-message-fetch-with-cache-process): Rewrite. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 6ad0a89..c88d65b 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,7 @@ +2001-12-25 Hiroya Murata + + * elmo.el (elmo-message-fetch-with-cache-process): Rewrite. + 2001-12-23 Hiroya Murata * elmo.el (elmo-generic-folder-append-messages): Make diff --git a/elmo/elmo.el b/elmo/elmo.el index 3edc6ad..49a8794 100644 --- a/elmo/elmo.el +++ b/elmo/elmo.el @@ -1175,25 +1175,36 @@ FIELD is a symbol of the field." &optional section unread) (let ((cache-path (elmo-fetch-strategy-cache-path strategy)) - err) - (or (and (eq (elmo-fetch-strategy-use-cache strategy) t) - (elmo-file-cache-load cache-path section)) - (when (and (condition-case error - (elmo-message-fetch-internal folder number - strategy - section - unread) - (error (setq err error) nil)) - (> (buffer-size) 0)) - (elmo-delete-cr-buffer) - (when (and (elmo-fetch-strategy-save-cache strategy) - cache-path) - (elmo-file-cache-save cache-path section)) - t) - (and (eq (elmo-fetch-strategy-use-cache strategy) 'maybe) - (elmo-file-cache-load cache-path section)) - (and err - (signal (car err) (cdr err)))))) + (method-priorities + (cond ((eq (elmo-fetch-strategy-use-cache strategy) 'meybe) + '(entity cache)) + ((elmo-fetch-strategy-use-cache strategy) + '(cache entity)) + (t + '(entity)))) + result err) + (while (and method-priorities + (null result)) + (setq result + (case (car method-priorities) + (cache + (elmo-file-cache-load cache-path section)) + (entity + (when (and (condition-case error + (elmo-message-fetch-internal folder number + strategy + section + unread) + (error (setq err error) nil)) + (> (buffer-size) 0)) + (elmo-delete-cr-buffer) + (when (and (elmo-fetch-strategy-save-cache strategy) + cache-path) + (elmo-file-cache-save cache-path section)) + t))) + method-priorities (cdr method-priorities))) + (or result + (and err (signal (car err) (cdr err)))))) (luna-define-method elmo-folder-clear ((folder elmo-folder) &optional keep-killed)