* elmo2.el (elmo-move-msgs): Bind
authorteranisi <teranisi>
Mon, 11 Jun 2001 01:43:40 +0000 (01:43 +0000)
committerteranisi <teranisi>
Mon, 11 Jun 2001 01:43:40 +0000 (01:43 +0000)
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-pop3-read-msg): Don't display progress when
elmo-inhibit-display-retrieval-progress is non-nil;
Remove progress bar after retrieval.

* 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-read-msg): Don't display progress when
elmo-inhibit-display-retrieval-progress is non-nil;
Remove progress bar after retrieval.
* elmo-imap4.el (elmo-imap4-read-part): Ditto.

elmo/ChangeLog
elmo/elmo-imap4.el
elmo/elmo-pop3.el
elmo/elmo-vars.el
elmo/elmo2.el

index eeead28..44735f0 100644 (file)
@@ -1,3 +1,29 @@
+2001-06-11  Yuuichi Teranishi  <teranisi@gohome.org>
+
+       * elmo2.el (elmo-move-msgs): 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-pop3-read-msg): Don't display progress when
+       elmo-inhibit-display-retrieval-progress is non-nil;
+       Remove progress bar after retrieval.
+
+       * 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-read-msg): Don't display progress when
+       elmo-inhibit-display-retrieval-progress is non-nil;
+       Remove progress bar after retrieval.
+       * elmo-imap4.el (elmo-imap4-read-part): Ditto.
+
 2001-06-07  Yuuichi Teranishi  <teranisi@gohome.org>
 
        * elmo-imap4.el (elmo-imap4-display-literal-progress): New variable.
index e512fda..52e4996 100644 (file)
     elmo-imap4-status-callback-data
     elmo-imap4-current-msgdb))
 
+(defvar elmo-imap4-display-literal-progress nil)
 ;;;;
 
 (defconst elmo-imap4-quoted-specials-list '(?\\ ?\"))
@@ -1351,7 +1352,8 @@ If optional argument UNMARK is non-nil, unmark."
     (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))
     (prog1
        (unwind-protect
            (elmo-delete-cr
@@ -1365,7 +1367,10 @@ If optional argument UNMARK is non-nil, unmark."
                                              msg part))
               'fetch)))
          (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.")))))
 
 (defun elmo-imap4-prefetch-msg (spec msg outbuf)
   (elmo-imap4-read-msg spec msg outbuf nil 'unseen))
@@ -1379,7 +1384,8 @@ If optional argument UNMARK is non-nil, unmark."
     (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
@@ -1391,7 +1397,10 @@ If optional argument UNMARK is non-nil, unmark."
                                             (if leave-seen-flag-untouched
                                                 ".peek" ""))))
       (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."))    
     (and (setq response (elmo-imap4-response-bodydetail-text
                         (elmo-imap4-response-value-all
                          response 'fetch )))
@@ -1580,8 +1589,6 @@ If optional argument UNMARK is non-nil, unmark."
 (defvar elmo-imap4-client-eol "\r\n"
   "The EOL string we send to the server.")
 
-(defvar elmo-imap4-display-literal-progress nil)
-
 (defun elmo-imap4-find-next-line ()
   "Return point at end of current line, taking into account literals.
 Return nil if no complete line has arrived."
@@ -1591,10 +1598,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))
+                         (min elmo-display-retrieval-progress-threshold 100)))
+                 (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)))
+                  (/ (- (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))
index 47475e5..e36af94 100644 (file)
        (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)
+          0))
        (unwind-protect
            (progn
              (when (null (setq response (elmo-pop3-read-response
                (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
+         (elmo-display-progress
+          'elmo-display-retrieval-progress "" 100)  ; remove progress bar.
+         (message "Retrieving...done."))
        (set-buffer outbuf)
        (goto-char (point-min))
        (while (re-search-forward "^\\." nil t)
index e7ed046..bc9900e 100644 (file)
@@ -363,6 +363,12 @@ set as non-nil.")
 (defvar elmo-inhibit-read-cache nil
   "*Global switch to inhibit reading cache.")
 
+(defvar elmo-inhibit-display-retrieval-progress nil
+  "Global switch to inhibit display progress of each message's retrieval.")
+
+(defvar elmo-display-retrieval-progress-threshold 30000
+  "*Don't display progress if the message size is smaller than this value.")
+
 (require 'product)
 (product-provide (provide 'elmo-vars) (require 'elmo-version))
 
index f99ffeb..b018394 100644 (file)
@@ -273,6 +273,7 @@ If optional UNREAD is non-nil, message is keeped as unread."
           (number-alist (elmo-msgdb-get-number-alist db))
           (mark-alist   (elmo-msgdb-get-mark-alist db))
           (messages msgs)
+          (elmo-inhibit-display-retrieval-progress t)
           (len (length msgs))
           (all-msg-num (or all len))
           (done-msg-num (or done 0))