From: teranisi Date: Mon, 9 Apr 2001 05:41:43 +0000 (+0000) Subject: * wl-summary.el (wl-summary-sync-force-update): Added argument no-check. X-Git-Tag: wl-2_6-root^3~53 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=ae56e2b3b791ee7f880a935b5df69903829796ca;p=elisp%2Fwanderlust.git * 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. * 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. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 791c350..de28723 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,13 @@ +2001-04-09 Yuuichi Teranishi + + * 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 * elmo-archive.el (elmo-archive-folder-list-subfolders): Match diff --git a/elmo/elmo-shimbun.el b/elmo/elmo-shimbun.el index 424a254..e0caf68 100644 --- a/elmo/elmo-shimbun.el +++ b/elmo/elmo-shimbun.el @@ -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 @@ -56,13 +56,14 @@ (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)))) @@ -71,15 +72,17 @@ 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)) @@ -167,7 +170,7 @@ ((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) diff --git a/elmo/elmo.el b/elmo/elmo.el index c795cd7..78bacdb 100644 --- a/elmo/elmo.el +++ b/elmo/elmo.el @@ -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...") diff --git a/wl/ChangeLog b/wl/ChangeLog index 3ac3463..8bfa658 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,15 @@ +2001-04-09 Yuuichi Teranishi + + * 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 * wl-expire.el (wl-expire-archive-get-folder): Added argument diff --git a/wl/wl-message.el b/wl/wl-message.el index 98c6eda..2e8747f 100644 --- a/wl/wl-message.el +++ b/wl/wl-message.el @@ -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)) diff --git a/wl/wl-summary.el b/wl/wl-summary.el index 4577eb8..0b1cd6b 100644 --- a/wl/wl-summary.el +++ b/wl/wl-summary.el @@ -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))