From 6d6a90c4fb3988e0b65e6460d10d674a2c4202a8 Mon Sep 17 00:00:00 2001 From: teranisi Date: Mon, 30 Jul 2001 04:07:16 +0000 Subject: [PATCH] * elmo-shimbun.el (elmo-shimbun-use-cache): New user option. (elmo-message-use-cache-p): Define. (elmo-folder-msgdb-create): Treat cache. --- elmo/ChangeLog | 6 ++++++ elmo/elmo-shimbun.el | 45 ++++++++++++++++++++++++++++----------------- 2 files changed, 34 insertions(+), 17 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 4ef04f3..ee91ade 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,9 @@ +2001-07-30 Yuuichi Teranishi + + * elmo-shimbun.el (elmo-shimbun-use-cache): New user option. + (elmo-message-use-cache-p): Define. + (elmo-folder-msgdb-create): Treat cache. + 2001-07-28 Kenichi OKADA * elmo-nntp.el (elmo-network-initialize-session): Call diff --git a/elmo/elmo-shimbun.el b/elmo/elmo-shimbun.el index e5c9a47..5d92b88 100644 --- a/elmo/elmo-shimbun.el +++ b/elmo/elmo-shimbun.el @@ -45,6 +45,11 @@ (integer :tag "number")) :group 'elmo) +(defcustom elmo-shimbun-use-cache t + "*If non-nil, use cache for each article." + :type :boolean + :group 'elmo) + (defcustom elmo-shimbun-index-range-alist nil "*Alist of FOLDER-REGEXP and RANGE. FOLDER-REGEXP is the regexp for shimbun folder name. @@ -213,6 +218,10 @@ See `shimbun-headers' for more detail about RANGE." (luna-define-method elmo-folder-reserve-status-p ((folder elmo-shimbun-folder)) t) +(luna-define-method elmo-message-use-cache-p ((folder elmo-shimbun-folder) + number) + elmo-shimbun-use-cache) + (luna-define-method elmo-folder-close-internal :after ((folder elmo-shimbun-folder)) (shimbun-close-group @@ -295,8 +304,8 @@ See `shimbun-headers' for more detail about RANGE." important-mark seen-list) (let* (overview number-alist mark-alist entity - i percent num pair) - (setq num (length numlist)) + i percent number length pair msgid) + (setq length (length numlist)) (setq i 0) (message "Creating msgdb...") (while numlist @@ -307,24 +316,26 @@ See `shimbun-headers' for more detail about RANGE." (setq overview (elmo-msgdb-append-element overview entity)) + (setq number (elmo-msgdb-overview-entity-get-number entity)) + (setq msgid (elmo-msgdb-overview-entity-get-id entity)) (setq number-alist (elmo-msgdb-number-add number-alist - (elmo-msgdb-overview-entity-get-number - entity) - (elmo-msgdb-overview-entity-get-id - entity))) - (setq mark-alist - (elmo-msgdb-mark-append - mark-alist - (elmo-msgdb-overview-entity-get-number - entity) - (or (elmo-msgdb-global-mark-get - (elmo-msgdb-overview-entity-get-id - entity)) - new-mark)))) - (when (> num elmo-display-progress-threshold) + number msgid)) + (setq seen (member msgid seen-list)) + (if (setq gmark (or (elmo-msgdb-global-mark-get msgid) + (if (elmo-file-cache-status + (elmo-file-cache-get msgid)) + (if seen nil already-mark) + (if seen + (if elmo-shimbun-use-cache + seen-mark) + new-mark)))) + (setq mark-alist + (elmo-msgdb-mark-append mark-alist + number gmark)))) + (when (> length elmo-display-progress-threshold) (setq i (1+ i)) - (setq percent (/ (* i 100) num)) + (setq percent (/ (* i 100) length)) (elmo-display-progress 'elmo-folder-msgdb-create "Creating msgdb..." percent)) -- 1.7.10.4