From 31b36911a539fc6efdba90707f2cb5acec90b161 Mon Sep 17 00:00:00 2001 From: teranisi Date: Tue, 31 Aug 2004 09:05:31 +0000 Subject: [PATCH] * wl-vars.el (wl-summary-answered-uncached-mark): Fixed typo. * wl-folder.el (wl-folder-check-one-entity): Follow the change of return value of elmo-folder-count-flags. * wl-score.el (wl-summary-score-update-all-lines): Ditto. * wl-summary.el (wl-summary-count-unread): Ditto. (wl-summary-sync-update): Follow the change above. (wl-summary-force-prefetch): New function. --- wl/ChangeLog | 13 +++++++++++++ wl/wl-folder.el | 3 ++- wl/wl-score.el | 8 ++++++-- wl/wl-summary.el | 47 +++++++++++++++++++++++++++++++++++++++-------- wl/wl-vars.el | 2 +- 5 files changed, 61 insertions(+), 12 deletions(-) diff --git a/wl/ChangeLog b/wl/ChangeLog index 398e536..c55fc6a 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,16 @@ +2004-08-31 Yuuichi Teranishi + + * wl-vars.el (wl-summary-answered-uncached-mark): Fixed typo. + + * wl-folder.el (wl-folder-check-one-entity): Follow the change + of return value of elmo-folder-count-flags. + + * wl-score.el (wl-summary-score-update-all-lines): Ditto. + + * wl-summary.el (wl-summary-count-unread): Ditto. + (wl-summary-sync-update): Follow the change above. + (wl-summary-force-prefetch): New function. + 2004-08-25 Tetsurou Okazaki * wl-folder.el (wl-folder-set-folder-updated): Initialize the local diff --git a/wl/wl-folder.el b/wl/wl-folder.el index 5cf452f..409e254 100644 --- a/wl/wl-folder.el +++ b/wl/wl-folder.el @@ -868,7 +868,8 @@ Optional argument ARG is repeart count." all (and all (max 0 all)))) (setq unread (or (and unread (- unread (or new 0))) (elmo-folder-get-info-unread folder) - (nth 1 (elmo-folder-count-flags folder)))) + (or (cdr (assq 'unread + (elmo-folder-count-flags folder))) 0))) (wl-folder-entity-hashtb-set wl-folder-entity-hashtb entity (list new unread all) (get-buffer wl-folder-buffer-name))) diff --git a/wl/wl-score.el b/wl/wl-score.el index 1457489..3318177 100644 --- a/wl/wl-score.el +++ b/wl/wl-score.el @@ -1217,9 +1217,13 @@ Set `wl-score-cache' nil." (wl-folder-set-folder-updated (wl-summary-buffer-folder-name) (list 0 - (let ((lst + (let ((flag-count (wl-summary-count-unread))) - (+ (car lst) (nth 1 lst))) + (+ + (or (cdr (assq 'new flag-count)) + 0) + (or (cdr (assq 'unread flag-count)) + 0))) (elmo-folder-length wl-summary-buffer-elmo-folder))) (wl-summary-update-modeline)) diff --git a/wl/wl-summary.el b/wl/wl-summary.el index bafabd9..8ca71c7 100644 --- a/wl/wl-summary.el +++ b/wl/wl-summary.el @@ -631,12 +631,14 @@ See also variable `wl-use-petname'." (wl-summary-redisplay))) (defun wl-summary-count-unread () - (let ((lst (elmo-folder-count-flags wl-summary-buffer-elmo-folder))) - (if (eq major-mode 'wl-summary-mode) - (setq wl-summary-buffer-new-count (car lst) - wl-summary-buffer-unread-count (nth 1 lst) - wl-summary-buffer-answered-count (nth 2 lst))) - lst)) + (let ((flag-count (elmo-folder-count-flags wl-summary-buffer-elmo-folder))) + (setq wl-summary-buffer-new-count + (or (cdr (assq 'new flag-count)) 0) + wl-summary-buffer-unread-count + (or (cdr (assq 'unread flag-count)) 0) + wl-summary-buffer-answered-count + (or (cdr (assq 'answered flag-count)) 0)) + flag-count)) (defun wl-summary-message-string (&optional use-cache) "Return full body string of current message. @@ -1394,6 +1396,31 @@ If ARG is non-nil, checking is omitted." (wl-summary-prefetch-region-no-mark (point-min) (point-max) wl-summary-incorporate-marks)) +(defun wl-summary-force-prefetch () + "All uncached messages are cached." + (interactive) + (unless (elmo-folder-local-p wl-summary-buffer-elmo-folder) + (let ((targets (elmo-folder-list-flagged wl-summary-buffer-elmo-folder + 'uncached 'in-msgdb)) + (count 0) + wl-prefetch-confirm + wl-prefetch-threshold + (elmo-inhibit-display-retrieval-progress t) + length msg) + (save-excursion + (goto-char (point-min)) + (setq length (length targets)) + (dolist (target targets) + (when (if (not (wl-thread-entity-parent-invisible-p + (wl-thread-get-entity target))) + (progn + (wl-summary-jump-to-msg target) + (wl-summary-prefetch-msg + (wl-summary-message-number))) + (wl-summary-prefetch-msg target)) + (message "Retrieving... %d/%d" (incf count) length))) + (message "Retrieved %d/%d message(s)" count length))))) + (defun wl-summary-prefetch-msg (number &optional arg) "Prefetch message and return non-nil value. If skipped, return nil." ;; prefetching procedure. @@ -1955,8 +1982,12 @@ This function is defined for `window-scroll-functions'" (wl-folder-set-folder-updated (elmo-folder-name-internal folder) (list 0 - (let ((lst (wl-summary-count-unread))) - (+ (car lst) (nth 1 lst))) + (let ((flag-count (wl-summary-count-unread))) + (+ + (or (cdr (assq 'new flag-count)) + 0) + (or (cdr (assq 'unread flag-count)) + 0))) (elmo-folder-length folder))) (wl-summary-update-modeline) ;; diff --git a/wl/wl-vars.el b/wl/wl-vars.el index 3f6d4e7..eaea8d7 100644 --- a/wl/wl-vars.el +++ b/wl/wl-vars.el @@ -1056,7 +1056,7 @@ Example: :group 'wl-summary-marks) (defcustom wl-summary-answered-uncached-mark "A" - "Mark for answered but cached message." + "Mark for answered but uncached message." :type '(string :tag "Mark") :group 'wl-summary-marks) -- 1.7.10.4