* elmo-shimbun.el (elmo-shimbun-use-cache): New user option.
authorteranisi <teranisi>
Mon, 30 Jul 2001 04:07:16 +0000 (04:07 +0000)
committerteranisi <teranisi>
Mon, 30 Jul 2001 04:07:16 +0000 (04:07 +0000)
(elmo-message-use-cache-p): Define.
(elmo-folder-msgdb-create): Treat cache.

elmo/ChangeLog
elmo/elmo-shimbun.el

index 4ef04f3..ee91ade 100644 (file)
@@ -1,3 +1,9 @@
+2001-07-30  Yuuichi Teranishi  <teranisi@gohome.org>
+
+       * 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  <okada@opaopa.org>
 
        * elmo-nntp.el (elmo-network-initialize-session): Call
index e5c9a47..5d92b88 100644 (file)
                 (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))