From e60624ff7c2baca11b0f35cdf648f0988fcc5d5b Mon Sep 17 00:00:00 2001 From: murata Date: Fri, 12 May 2000 14:32:23 +0000 Subject: [PATCH] Add threshold for displaying progress gauge. --- wl/wl-folder.el | 50 +++++++++++++++++++++++--------------------------- wl/wl-highlight.el | 13 +++++++------ wl/wl-score.el | 11 +++++++---- 3 files changed, 37 insertions(+), 37 deletions(-) diff --git a/wl/wl-folder.el b/wl/wl-folder.el index a43755c..5614345 100644 --- a/wl/wl-folder.el +++ b/wl/wl-folder.el @@ -1649,16 +1649,13 @@ Entering Folder mode calls the value of `wl-folder-mode-hook'." (setq new (+ (or new 0) (or (nth 0 ret-val) 0))) (setq unread (+ (or unread 0) (or (nth 1 ret-val) 0))) (setq all (+ (or all 0) (or (nth 2 ret-val) 0))) - (when mes + (when (and mes + (> len elmo-display-progress-threshold)) (setq i (1+ i)) (elmo-display-progress 'wl-folder-insert-entity "Inserting group %s..." (/ (* i 100) len) (car entity))) - (setq flist (cdr flist))) - (when mes - (elmo-display-progress - 'wl-folder-insert-entity "Inserting group %s..." - 100 (car entity)))) + (setq flist (cdr flist)))) (save-excursion (goto-char group-name-end) (delete-region (point) (save-excursion (end-of-line) @@ -2363,13 +2360,13 @@ Entering Folder mode calls the value of `wl-folder-mode-hook'." (point)) (save-excursion (end-of-line) (+ 1 (point)))) - (setq i (1+ i)) - (and (zerop (% i 10)) - (elmo-display-progress - 'wl-folder-open-all "Opening all folders..." - (/ (* i 100) len)))))) - (elmo-display-progress - 'wl-folder-open-all "Opening all folders..." 100) + (when (> len elmo-display-progress-threshold) + (setq i (1+ i)) + (if (or (zerop (% i 5)) (= i len)) + (elmo-display-progress + 'wl-folder-open-all "Opening all folders..." + (/ (* i 100) len))))))) + (message "Opening all folders...done.") (set-buffer-modified-p nil))) (defun wl-folder-close-all () @@ -2456,11 +2453,12 @@ Entering Folder mode calls the value of `wl-folder-mode-hook'." (setq diff t))) (t (wl-append removes (list folder)))))) - (setq i (1+ i)) - (and (zerop (% i 10)) - (elmo-display-progress - 'wl-folder-update-access-group "Updating access group..." - (/ (* i 100) len))) + (when (> len elmo-display-progress-threshold) + (setq i (1+ i)) + (if (or (zerop (% i 10)) (= i len)) + (elmo-display-progress + 'wl-folder-update-access-group "Updating access group..." + (/ (* i 100) len)))) (setq flist (cdr flist))) ;; check unsubscribed groups (while unsubscribes @@ -2473,15 +2471,13 @@ Entering Folder mode calls the value of `wl-folder-mode-hook'." (when (member (car unsubscribes) new-flist) (setq new-flist (delete (car unsubscribes) new-flist)) (wl-append new-unsubscribes (list (car unsubscribes)))))) - (setq i (1+ i)) - (and (zerop (% i 10)) - (elmo-display-progress - 'wl-folder-update-access-group "Updating access group..." - (/ (* i 100) len))) + (when (> len elmo-display-progress-threshold) + (setq i (1+ i)) + (if (or (zerop (% i 10)) (= i len)) + (elmo-display-progress + 'wl-folder-update-access-group "Updating access group..." + (/ (* i 100) len)))) (setq unsubscribes (cdr unsubscribes))) - (elmo-display-progress - 'wl-folder-update-access-group "Updating access group..." - 100) ;; (if (or new-flist removes) (setq diff t)) @@ -2516,7 +2512,7 @@ Entering Folder mode calls the value of `wl-folder-mode-hook'." (setq new-list (cdr new-list)))) (if new-flist (message "%d new folder(s)." (length new-flist)) - (message "Updating access group...done")) + (message "Updating access group...done.")) (wl-append new-flist subscribed-list) ;; new is first (run-hooks 'wl-folder-update-access-group-hook) (setcdr (cdr entity) (list new-flist new-unsubscribes)) diff --git a/wl/wl-highlight.el b/wl/wl-highlight.el index 5b6bc9b..0c9db1d 100644 --- a/wl/wl-highlight.el +++ b/wl/wl-highlight.el @@ -1000,12 +1000,13 @@ interpreted as cited text.)" (setq i 0) (while (not (eobp)) (wl-highlight-summary-current-line nil nil wl-summary-scored) - (setq i (+ i 1)) - (setq percent (/ (* i 100) lines)) - (if (eq (% percent 5) 0) - (elmo-display-progress - 'wl-highlight-summary "Highlighting..." - percent)) + (when (> lines elmo-display-progress-threshold) + (setq i (+ i 1)) + (setq percent (/ (* i 100) lines)) + (if (or (eq (% percent 5) 0) (= i lines)) + (elmo-display-progress + 'wl-highlight-summary "Highlighting..." + percent))) (forward-line 1)) (message "Highlighting...done."))))))) diff --git a/wl/wl-score.el b/wl/wl-score.el index aa0f1e7..c10dbab 100644 --- a/wl/wl-score.el +++ b/wl/wl-score.el @@ -1250,10 +1250,13 @@ See `wl-score-simplify-buffer-fuzzy' for details." (wl-summary-mark-line "*")) (setq wl-summary-buffer-target-mark-list (cons num wl-summary-buffer-target-mark-list)))) - (setq i (1+ i)) - (and (zerop (% i 10)) - (message "Updating score...%d%%" (/ (* i 100) count))) - (setq alist (cdr alist))) + (setq alist (cdr alist)) + (when (> count elmo-display-progress-threshold) + (setq i (1+ i)) + (if (or (zerop (% i 10)) (= i count)) + (elmo-display-progress + 'wl-summary-score-update-all-lines "Updating score..." + (/ (* i 100) count))))) (when dels ; (elmo-msgdb-delete-msgs wl-summary-buffer-folder-name ; dels wl-summary-buffer-msgdb t) -- 1.7.10.4