From: teranisi Date: Sun, 10 Jun 2001 12:38:25 +0000 (+0000) Subject: * elmo.el (elmo-folder-move-messages): Bind X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=341d771b92e1e715ed5ac8f2fb6acf12abd02f70;p=elisp%2Fwanderlust.git * elmo.el (elmo-folder-move-messages): Bind elmo-inhibit-display-retrieval-progress as t while moving messages. * elmo-vars.el (elmo-display-retrieval-progress-threshold): New variable. (elmo-inhibit-display-retrieval-progress): Ditto. * elmo-pop3.el (elmo-pop3-process-filter): Use elmo-display-progress for retrieval progress; Don't display progress when total buffer size is smaller than elmo-display-retrieval-progress-threshold. (elmo-message-fetch-plugged): Don't display progress when elmo-inhibit-display-retrieval-progress is non-nil. * elmo-imap4.el (elmo-imap4-find-next-line): Use elmo-display-progress for retrieval progress; Don't display progress when literal size is smaller than elmo-display-retrieval-progress-threshold. (elmo-imap4-message-fetch): Don't display progress when elmo-inhibit-display-retrieval-progress is non-nil. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index d57a9e1..50698ff 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,26 @@ +2001-06-10 Yuuichi Teranishi + + * elmo.el (elmo-folder-move-messages): Bind + elmo-inhibit-display-retrieval-progress as t while moving messages. + + * elmo-vars.el (elmo-display-retrieval-progress-threshold): + New variable. + (elmo-inhibit-display-retrieval-progress): Ditto. + + * elmo-pop3.el (elmo-pop3-process-filter): Use elmo-display-progress + for retrieval progress; + Don't display progress when total buffer size is smaller than + elmo-display-retrieval-progress-threshold. + (elmo-message-fetch-plugged): Don't display progress when + elmo-inhibit-display-retrieval-progress is non-nil. + + * elmo-imap4.el (elmo-imap4-find-next-line): Use elmo-display-progress + for retrieval progress; + Don't display progress when literal size is smaller than + elmo-display-retrieval-progress-threshold. + (elmo-imap4-message-fetch): Don't display progress when + elmo-inhibit-display-retrieval-progress is non-nil. + 2001-06-07 Yuuichi Teranishi * elmo-imap4.el (elmo-imap4-display-literal-progress): New variable. diff --git a/elmo/elmo-imap4.el b/elmo/elmo-imap4.el index afa580f..c62d1a7 100644 --- a/elmo/elmo-imap4.el +++ b/elmo/elmo-imap4.el @@ -1142,10 +1142,16 @@ Return nil if no complete line has arrived." (if (match-string 1) (if (< (point-max) (+ (point) (string-to-number (match-string 1)))) (progn - (if elmo-imap4-display-literal-progress - (message "Retrieving...(%d/%d bytes)" + (if (and elmo-imap4-display-literal-progress + (> (string-to-number (match-string 1)) + elmo-display-retrieval-progress-threshold)) + (elmo-display-progress + 'elmo-display-retrieval-progress + (format "Retrieving (%d/%d bytes)..." (- (point-max) (point)) - (string-to-number (match-string 1)))) + (string-to-number (match-string 1))) + (floor (* (/ (float (- (point-max) (point))) + (string-to-number (match-string 1))) 100)))) nil) (goto-char (+ (point) (string-to-number (match-string 1)))) (elmo-imap4-find-next-line)) @@ -2455,7 +2461,8 @@ If optional argument REMOVE is non-nil, remove FLAG." (with-current-buffer (elmo-network-session-buffer session) (setq elmo-imap4-fetch-callback nil) (setq elmo-imap4-fetch-callback-data nil)) - (setq elmo-imap4-display-literal-progress t) + (unless elmo-inhibit-display-retrieval-progress + (setq elmo-imap4-display-literal-progress t)) (unwind-protect (setq response (elmo-imap4-send-command-wait session @@ -2468,7 +2475,11 @@ If optional argument REMOVE is non-nil, remove FLAG." (or section "") ))) (setq elmo-imap4-display-literal-progress nil)) - (message "Retrieving...done.") + (unless elmo-inhibit-display-retrieval-progress + (elmo-display-progress 'elmo-imap4-display-literal-progress + "" + 100) ; remove progress bar. + (message "Retrieving...done.")) (if (setq response (elmo-imap4-response-bodydetail-text (elmo-imap4-response-value-all response 'fetch))) diff --git a/elmo/elmo-pop3.el b/elmo/elmo-pop3.el index 0a2e6cb..c0a95f9 100644 --- a/elmo/elmo-pop3.el +++ b/elmo/elmo-pop3.el @@ -237,9 +237,16 @@ set as non-nil.") (set-buffer (process-buffer process)) (goto-char (point-max)) (insert output) - (if elmo-pop3-total-size - (message "Retrieving...(%d/%d bytes)." - (buffer-size) elmo-pop3-total-size)))) + (if (and elmo-pop3-total-size + (> elmo-pop3-total-size + elmo-display-retrieval-progress-threshold)) + (elmo-display-progress + 'elmo-display-retrieval-progress + (format "Retrieving (%d/%d bytes)..." + (buffer-size) + elmo-pop3-total-size) + (floor (* (/ (float (buffer-size)) + elmo-pop3-total-size) 100)))))) (defun elmo-pop3-auth-user (session) (let ((process (elmo-network-session-process-internal session))) @@ -849,8 +856,11 @@ set as non-nil.") (when number (elmo-pop3-send-command process (format "retr %s" number)) - (setq elmo-pop3-total-size size) - (message "Retrieving...") + (unless elmo-inhibit-display-retrieval-progress + (setq elmo-pop3-total-size size) + (elmo-display-progress + 'elmo-pop3-display-retrieval-progress + (format "Retrieving (0/%d bytes)..." elmo-pop3-total-size))) (unwind-protect (progn (when (null (setq response (elmo-pop3-read-response @@ -858,7 +868,8 @@ set as non-nil.") (error "Fetching message failed")) (setq response (elmo-pop3-read-body process outbuf))) (setq elmo-pop3-total-size nil)) - (message "Retrieving...done.") + (unless elmo-inhibit-display-retrieval-progress + (message "Retrieving...done.")) (set-buffer outbuf) (goto-char (point-min)) (while (re-search-forward "^\\." nil t) diff --git a/elmo/elmo-vars.el b/elmo/elmo-vars.el index 78e9b89..cb4d666 100644 --- a/elmo/elmo-vars.el +++ b/elmo/elmo-vars.el @@ -246,6 +246,12 @@ Arguments for this function are NAME, BUFFER, HOST and SERVICE.") (defvar elmo-inhibit-number-mapping nil "Global switch to inhibit number mapping (e.g. Inhibit UIDL on POP3).") +(defvar elmo-display-retrieval-progress-threshold 30000 + "*Don't display progress if the message size is smaller than this value.") + +(defvar elmo-inhibit-display-retrieval-progress nil + "Global switch to inhibit display progress of each message's retrieval.") + (defvar elmo-dop-queue nil "Global variable for storing disconnected operation queues.") diff --git a/elmo/elmo.el b/elmo/elmo.el index 746ace3..0ceebdd 100644 --- a/elmo/elmo.el +++ b/elmo/elmo.el @@ -886,6 +886,7 @@ Return a cons cell of (NUMBER-CROSSPOSTS . NEW-MARK-ALIST).") save-unread) (save-excursion (let* ((messages msgs) + (elmo-inhibit-display-retrieval-progress t) (len (length msgs)) (all-msg-num (or all len)) (done-msg-num (or done 0))