* wl-summary.el (wl-summary-sync-force-update): Added argument no-check.
authorteranisi <teranisi>
Mon, 9 Apr 2001 05:41:43 +0000 (05:41 +0000)
committerteranisi <teranisi>
Mon, 9 Apr 2001 05:41:43 +0000 (05:41 +0000)
(wl-summary-sync-update): Ditto.
(wl-summary-goto-folder-subr): Call wl-summary-sync-force-update with
`no-check'.

* wl-message.el (wl-message-buffer-prefetch-timer): New variable.
(wl-message-buffer-prefetch-next): Don't run timer if timer is already running.

* elmo.el (elmo-folder-synchronize): Added optional no-check argument.

* elmo-shimbun.el (elmo-shimbun-folder): Added headers slot.
(elmo-folder-open-internal): Set up headers slot.
(elmo-folder-check): Call elmo-folder-close-internal and
 elmo-folder-open-internal.
(elmo-folder-close-internal): Clean up headers slot.

elmo/ChangeLog
elmo/elmo-shimbun.el
elmo/elmo.el
wl/ChangeLog
wl/wl-message.el
wl/wl-summary.el

index 791c350..de28723 100644 (file)
@@ -1,3 +1,13 @@
+2001-04-09  Yuuichi Teranishi  <teranisi@gohome.org>
+
+       * elmo.el (elmo-folder-synchronize): Added optional no-check argument.
+
+       * elmo-shimbun.el (elmo-shimbun-folder): Added headers slot.
+       (elmo-folder-open-internal): Set up headers slot.
+       (elmo-folder-check): Call elmo-folder-close-internal and
+       elmo-folder-open-internal.
+       (elmo-folder-close-internal): Clean up headers slot.
+
 2001-04-07  Masahiro MURATA  <muse@ba2.so-net.ne.jp>
 
        * elmo-archive.el (elmo-archive-folder-list-subfolders): Match
index 424a254..e0caf68 100644 (file)
@@ -34,7 +34,7 @@
 
 (eval-and-compile
   (luna-define-class elmo-shimbun-folder
-                    (elmo-map-folder) (shimbun header-hash group))
+                    (elmo-map-folder) (shimbun headers header-hash group))
   (luna-define-internal-accessors 'elmo-shimbun-folder))
 
 (luna-define-method elmo-folder-initialize ((folder
   (shimbun-open-group
    (elmo-shimbun-folder-shimbun-internal folder)
    (elmo-shimbun-folder-group-internal folder))
+  (elmo-shimbun-folder-set-headers-internal
+   folder (shimbun-headers
+          (elmo-shimbun-folder-shimbun-internal folder)))
   (elmo-shimbun-folder-set-header-hash-internal
    folder
-   (elmo-make-hash (length (shimbun-headers
-                           (elmo-shimbun-folder-shimbun-internal folder)))))
+   (elmo-make-hash (length (elmo-shimbun-folder-headers-internal folder))))
   ;; Set up header hash.
-  (dolist (header (shimbun-headers (elmo-shimbun-folder-shimbun-internal
-                                   folder)))
+  (dolist (header (elmo-shimbun-folder-headers-internal folder))
     (elmo-set-hash-val
      (shimbun-header-id header) header
      (elmo-shimbun-folder-header-hash-internal folder))))
                                                        elmo-shimbun-folder))
   (shimbun-close-group
    (elmo-shimbun-folder-shimbun-internal folder))
+  (elmo-shimbun-folder-set-headers-internal
+   folder nil)
   (elmo-shimbun-folder-set-header-hash-internal
    folder nil))
 
 (luna-define-method elmo-folder-check :after ((folder elmo-shimbun-folder))
-  (shimbun-close-group
-   (elmo-shimbun-folder-shimbun-internal folder))
-  (shimbun-open-group
-   (elmo-shimbun-folder-shimbun-internal folder)
-   (elmo-shimbun-folder-group-internal folder)))
+  (when (shimbun-current-group-internal 
+        (elmo-shimbun-folder-shimbun-internal folder))
+    ;; Discard current headers information.
+    (elmo-folder-close-internal folder)
+    (elmo-folder-open-internal folder)))
 
 (luna-define-method elmo-folder-expand-msgdb-path ((folder
                                                    elmo-shimbun-folder))
   ((folder elmo-shimbun-folder))
   (mapcar
    (function shimbun-header-id)
-   (shimbun-headers (elmo-shimbun-folder-shimbun-internal folder))))
+   (elmo-shimbun-folder-headers-internal folder)))
 
 (luna-define-method elmo-folder-list-subfolders ((folder elmo-shimbun-folder)
                                                 &optional one-level)
index c795cd7..78bacdb 100644 (file)
@@ -1046,7 +1046,8 @@ FIELD is a symbol of the field."
                                unread-cached-mark   ;"!"
                                read-uncached-mark   ;"u"
                                important-mark       ;"$"
-                               &optional ignore-msgdb)
+                               &optional ignore-msgdb
+                               no-check)
   "Synchronize the folder data to the newest status.
 FOLDER is the ELMO folder structure.
 NEW-MARK, UNREAD-CACHED-MARK, READ-UNCACHED-MARK, and IMPORTANT-MARK
@@ -1055,6 +1056,7 @@ read but not cached messages, and important messages.
 If optional IGNORE-MSGDB is non-nil, current msgdb is thrown away except
 read mark status. If IGNORE-MSGDB is 'visible-only, only visible messages
 are thrown away and synchronized.
+If NO-CHECK is non-nil, recheck folder is skipped.
 
 Return a list of
 \(NEW-MSGDB DELETE-LIST CROSSED\)
@@ -1085,7 +1087,7 @@ CROSSED is cross-posted message number."
            (elmo-folder-set-killed-list-internal folder nil))
          (elmo-folder-set-msgdb-internal folder
                                          (elmo-msgdb-clear))))
-    (elmo-folder-check folder)
+    (unless no-check (elmo-folder-check folder))
     (condition-case nil
        (progn
          (message "Checking folder diff...")
index 3ac3463..8bfa658 100644 (file)
@@ -1,3 +1,15 @@
+2001-04-09  Yuuichi Teranishi  <teranisi@gohome.org>
+
+       * wl-summary.el (wl-summary-sync-force-update): Added argument
+       no-check.
+       (wl-summary-sync-update): Ditto.
+       (wl-summary-goto-folder-subr): Call wl-summary-sync-force-update
+       with `no-check'.
+
+       * wl-message.el (wl-message-buffer-prefetch-timer): New variable.
+       (wl-message-buffer-prefetch-next): Don't run timer if timer is
+       already running.
+
 2001-04-07  Masahiro MURATA  <muse@ba2.so-net.ne.jp>
 
        * wl-expire.el (wl-expire-archive-get-folder): Added argument
index 98c6eda..2e8747f 100644 (file)
@@ -490,6 +490,9 @@ Returns non-nil if bottom of message."
                            wl-message-buffer-prefetch-folder-type-list))
    (t wl-message-buffer-prefetch-folder-type-list)))
 
+
+(defvar wl-message-buffer-prefetch-timer nil)
+
 (defun wl-message-buffer-prefetch-next (folder number &optional
                                               summary charset)
   (if (wl-message-buffer-prefetch-p folder)
@@ -500,11 +503,13 @@ Returns non-nil if bottom of message."
            (if (not (fboundp 'run-with-idle-timer))
                (when (sit-for wl-message-buffer-prefetch-idle-time)
                  (wl-message-buffer-prefetch folder next summary charset))
-             (run-with-idle-timer
-              wl-message-buffer-prefetch-idle-time
-              nil
-              'wl-message-buffer-prefetch folder next summary charset)
-             (sit-for 0)))))))
+             (unless wl-message-buffer-prefetch-timer
+               (setq wl-message-buffer-prefetch-timer
+                     (run-with-idle-timer
+                      wl-message-buffer-prefetch-idle-time
+                      nil
+                      'wl-message-buffer-prefetch
+                      folder next summary charset)))))))))
 
 (defun wl-message-buffer-prefetch (folder number summary charset)
   (when (buffer-live-p summary)
@@ -538,7 +543,8 @@ Returns non-nil if bottom of message."
                    (setq micro (+ micro (* 1000000 sec)))
                    (message "Prefetching %d...done(%f msec)."
                             number
-                            (/ micro 1000.0)))))))))))
+                            (/ micro 1000.0))))))))))
+  (setq wl-message-buffer-prefetch-timer nil))
 
 (defvar wl-message-button-map (make-sparse-keymap))
 
index 4577eb8..0b1cd6b 100644 (file)
@@ -1056,9 +1056,9 @@ Entering Folder mode calls the value of `wl-summary-mode-hook'."
              (kill-buffer summary-buf)))
        (run-hooks 'wl-summary-exit-hook)))))
 
-(defun wl-summary-sync-force-update (&optional unset-cursor)
+(defun wl-summary-sync-force-update (&optional unset-cursor no-check)
   (interactive)
-  (wl-summary-sync-update unset-cursor))
+  (wl-summary-sync-update unset-cursor nil no-check))
 
 (defsubst wl-summary-sync-all-init ()
   (wl-summary-cleanup-temp-marks)
@@ -2010,7 +2010,7 @@ If ARG is non-nil, checking is omitted."
          (nthcdr (max (- len in) 0) appends))
       appends)))
 
-(defun wl-summary-sync-update (&optional unset-cursor sync-all)
+(defun wl-summary-sync-update (&optional unset-cursor sync-all no-check)
   "Update the summary view to the newest folder status."
   (interactive)
   (let* ((folder wl-summary-buffer-elmo-folder)
@@ -2041,7 +2041,7 @@ If ARG is non-nil, checking is omitted."
                       wl-summary-unread-cached-mark
                       wl-summary-read-uncached-mark
                       wl-summary-important-mark
-                      sync-all))
+                      sync-all no-check))
     (setq new-msgdb (nth 0 sync-result))
     (setq delete-list (nth 1 sync-result))
     (setq crossed (nth 2 sync-result))
@@ -2553,7 +2553,8 @@ If ARG, without confirm."
               ((eq scan-type 'no-sync))
               ((or (eq scan-type 'force-update)
                    (eq scan-type 'update))
-               (setq mes (wl-summary-sync-force-update 'unset-cursor)))))
+               (setq mes (wl-summary-sync-force-update
+                          'unset-cursor 'no-check)))))
          (if interactive
              (switch-to-buffer buf)
            (set-buffer buf))