From b7c5891531a0e381fb625601b1cbf0e59721fa6c Mon Sep 17 00:00:00 2001 From: teranisi Date: Fri, 1 Aug 2003 17:17:13 +0000 Subject: [PATCH] * elmo.el (elmo-message-set-cached): Define as a method. * elmo-pipe.el (elmo-message-set-cached): Define. (elmo-find-fetch-strategy): Ditto. * elmo-multi.el (elmo-message-set-cached): Define. (elmo-find-fetch-strategy): Rewrite. * elmo-mime.el (elmo-mime-message-display): Use elmo-message-entity. --- elmo/ChangeLog | 10 ++++++++++ elmo/elmo-mime.el | 4 +--- elmo/elmo-multi.el | 30 ++++++++++++++---------------- elmo/elmo-pipe.el | 13 +++++++++++++ elmo/elmo.el | 7 +++++-- 5 files changed, 43 insertions(+), 21 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 0156e42..c819cd0 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,5 +1,15 @@ 2003-08-01 Yuuichi Teranishi + * elmo.el (elmo-message-set-cached): Define as a method. + + * elmo-pipe.el (elmo-message-set-cached): Define. + (elmo-find-fetch-strategy): Ditto. + + * elmo-multi.el (elmo-message-set-cached): Define. + (elmo-find-fetch-strategy): Rewrite. + + * elmo-mime.el (elmo-mime-message-display): Use elmo-message-entity. + * elmo-pipe.el (elmo-message-folder): Fixed definition. 2003-07-30 Yuuichi Teranishi diff --git a/elmo/elmo-mime.el b/elmo/elmo-mime.el index 9efb463..feb5f42 100644 --- a/elmo/elmo-mime.el +++ b/elmo/elmo-mime.el @@ -224,9 +224,7 @@ Return non-nil if not entire message was fetched." (let (mime-display-header-hook ; Do nothing. (elmo-message-displaying t) entity strategy) - (setq entity (elmo-msgdb-overview-get-entity number - (elmo-folder-msgdb - folder))) + (setq entity (elmo-message-entity folder number)) (setq strategy (elmo-find-fetch-strategy folder entity ignore-cache)) (mime-display-message diff --git a/elmo/elmo-multi.el b/elmo/elmo-multi.el index 55a6caf..479c474 100644 --- a/elmo/elmo-multi.el +++ b/elmo/elmo-multi.el @@ -129,6 +129,20 @@ (nth (- (/ number (elmo-multi-folder-divide-number-internal folder)) 1) (elmo-multi-folder-children-internal folder))) +(luna-define-method elmo-message-set-cached ((folder elmo-multi-folder) + number cached) + (let ((pair (elmo-multi-real-folder-number folder number))) + (elmo-message-set-cached (car pair) (cdr pair) cached))) + +(luna-define-method elmo-find-fetch-strategy + ((folder elmo-multi-folder) entity &optional ignore-cache) + (let ((pair (elmo-multi-real-folder-number + folder + (elmo-message-entity-number entity)))) + (elmo-find-fetch-strategy + (car pair) + (elmo-message-entity (car pair) (cdr pair)) ignore-cache))) + (luna-define-method elmo-message-entity ((folder elmo-multi-folder) key) (cond ((numberp key) @@ -191,22 +205,6 @@ (dolist (child (elmo-multi-folder-children-internal folder)) (elmo-folder-process-crosspost child))) -(defsubst elmo-multi-find-fetch-strategy (folder entity ignore-cache) - (if entity - (let ((pair (elmo-multi-real-folder-number - folder - (elmo-msgdb-overview-entity-get-number entity))) - (new-entity (elmo-msgdb-copy-overview-entity entity))) - (setq new-entity - (elmo-msgdb-overview-entity-set-number new-entity (cdr pair))) - (elmo-find-fetch-strategy (car pair) new-entity ignore-cache)) - (elmo-make-fetch-strategy 'entire))) - -(luna-define-method elmo-find-fetch-strategy - ((folder elmo-multi-folder) - entity &optional ignore-cache) - (elmo-multi-find-fetch-strategy folder entity ignore-cache)) - (luna-define-method elmo-message-fetch ((folder elmo-multi-folder) number strategy &optional section outbuf unseen) diff --git a/elmo/elmo-pipe.el b/elmo/elmo-pipe.el index 987fd44..3f85eb6 100644 --- a/elmo/elmo-pipe.el +++ b/elmo/elmo-pipe.el @@ -366,6 +366,19 @@ number field)) +(luna-define-method elmo-message-set-cached ((folder elmo-pipe-folder) + number cached) + (elmo-message-set-cached (elmo-pipe-folder-dst-internal folder) + number cached)) + +(luna-define-method elmo-find-fetch-strategy + ((folder elmo-pipe-folder) entity &optional ignore-cache) + (elmo-find-fetch-strategy (elmo-pipe-folder-dst-internal folder) + (elmo-message-entity + (elmo-pipe-folder-dst-internal folder) + (elmo-message-entity-number entity)) + ignore-cache)) + (luna-define-method elmo-message-entity ((folder elmo-pipe-folder) key) (elmo-message-entity (elmo-pipe-folder-dst-internal folder) key)) diff --git a/elmo/elmo.el b/elmo/elmo.el index 13e6cc5..eebaa03 100644 --- a/elmo/elmo.el +++ b/elmo/elmo.el @@ -1137,11 +1137,14 @@ Return non-nil when message is accessible." (elmo-folder-local-p folder) (elmo-msgdb-get-cached (elmo-folder-msgdb folder) number))) -(defun elmo-message-set-cached (folder number cached) +(luna-define-generic elmo-message-set-cached (folder number cached) "Set cache status of the message in the msgdb. FOLDER is the ELMO folder structure. NUMBER is a number of the message. -If CACHED is t, message is set as cached." +If CACHED is t, message is set as cached.") + +(luna-define-method elmo-message-set-cached ((folder elmo-folder) + number cached) (when (elmo-msgdb-set-cached (elmo-folder-msgdb folder) number cached -- 1.7.10.4