* elmo-imap4.el (elmo-imap4-display-literal-progress): New variable.
authorteranisi <teranisi>
Thu, 7 Jun 2001 03:30:54 +0000 (03:30 +0000)
committerteranisi <teranisi>
Thu, 7 Jun 2001 03:30:54 +0000 (03:30 +0000)
(elmo-imap4-find-next-line): Display progress whille literal fetching.
(elmo-imap4-message-fetch): Likewise.

elmo/ChangeLog
elmo/elmo-imap4.el

index 20e3893..d57a9e1 100644 (file)
@@ -1,5 +1,9 @@
 2001-06-07  Yuuichi Teranishi  <teranisi@gohome.org>
 
+       * elmo-imap4.el (elmo-imap4-display-literal-progress): New variable.
+       (elmo-imap4-find-next-line): Display progress whille literal fetching.
+       (elmo-imap4-message-fetch): Likewise.
+
        * elmo-shimbun.el (elmo-shimbun-default-index-range): New user option.
        (elmo-shimbun-index-range-alist): Ditto.
        (elmo-shimbun-use-entire-index): Abolish.
index 1ca021b..afa580f 100644 (file)
@@ -1131,6 +1131,8 @@ If CHOP-LENGTH is not specified, message set is not chopped."
 (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."
@@ -1139,7 +1141,12 @@ Return nil if no complete line has arrived."
                           nil t)
     (if (match-string 1)
        (if (< (point-max) (+ (point) (string-to-number (match-string 1))))
-           nil
+           (progn
+             (if elmo-imap4-display-literal-progress
+                 (message "Retrieving...(%d/%d bytes)"
+                          (- (point-max) (point))
+                          (string-to-number (match-string 1))))
+             nil)
          (goto-char (+ (point) (string-to-number (match-string 1))))
          (elmo-imap4-find-next-line))
       (point))))
@@ -2448,16 +2455,20 @@ 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 response
-         (elmo-imap4-send-command-wait session
-                                       (format
-                                        (if elmo-imap4-use-uid
-                                            "uid fetch %s body%s[%s]"
-                                          "fetch %s body%s[%s]")
-                                        number
-                                        (if unseen ".peek" "")
-                                        (or section "")
-                                        )))
+    (setq elmo-imap4-display-literal-progress t)
+    (unwind-protect
+       (setq response
+             (elmo-imap4-send-command-wait session
+                                           (format
+                                            (if elmo-imap4-use-uid
+                                                "uid fetch %s body%s[%s]"
+                                              "fetch %s body%s[%s]")
+                                            number
+                                            (if unseen ".peek" "")
+                                            (or section "")
+                                            )))
+      (setq elmo-imap4-display-literal-progress nil))
+    (message "Retrieving...done.")
     (if (setq response (elmo-imap4-response-bodydetail-text
                        (elmo-imap4-response-value-all
                         response 'fetch)))