From: teranisi Date: Thu, 7 Jun 2001 03:30:18 +0000 (+0000) Subject: * elmo-imap4.el (elmo-imap4-display-literal-progress): New variable. X-Git-Tag: wl-2_6-root~13 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8798ade7873c513a1c4f7da9bd40a2c02fc4af94;p=elisp%2Fwanderlust.git * elmo-imap4.el (elmo-imap4-display-literal-progress): New variable. (elmo-imap4-find-next-line): Display progress while literal fetching. (elmo-imap4-read-msg): Likewise. (elmo-imap4-read-part): Ditto. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index d2f1db6..eeead28 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,10 @@ +2001-06-07 Yuuichi Teranishi + + * elmo-imap4.el (elmo-imap4-display-literal-progress): New variable. + (elmo-imap4-find-next-line): Display progress while literal fetching. + (elmo-imap4-read-msg): Likewise. + (elmo-imap4-read-part): Ditto. + 2001-06-06 Yuuichi Teranishi * elmo-pop3.el (elmo-pop3-process-filter): Show retrieve progress. diff --git a/elmo/elmo-imap4.el b/elmo/elmo-imap4.el index 122e362..e512fda 100644 --- a/elmo/elmo-imap4.el +++ b/elmo/elmo-imap4.el @@ -1351,16 +1351,21 @@ 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)) - (elmo-delete-cr - (elmo-imap4-response-bodydetail-text - (elmo-imap4-response-value-all - (elmo-imap4-send-command-wait session - (format - (if elmo-imap4-use-uid - "uid fetch %s body.peek[%s]" - "fetch %s body.peek[%s]") - msg part)) - 'fetch))))) + (setq elmo-imap4-display-literal-progress t) + (prog1 + (unwind-protect + (elmo-delete-cr + (elmo-imap4-response-bodydetail-text + (elmo-imap4-response-value-all + (elmo-imap4-send-command-wait session + (format + (if elmo-imap4-use-uid + "uid fetch %s body.peek[%s]" + "fetch %s body.peek[%s]") + msg part)) + 'fetch))) + (setq elmo-imap4-display-literal-progress nil)) + (message "Retrieving...done.")))) (defun elmo-imap4-prefetch-msg (spec msg outbuf) (elmo-imap4-read-msg spec msg outbuf nil 'unseen)) @@ -1374,15 +1379,19 @@ 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 response - (elmo-imap4-send-command-wait session - (format - (if elmo-imap4-use-uid - "uid fetch %s body%s[]" - "fetch %s body%s[]") - msg - (if leave-seen-flag-untouched - ".peek" "")))) + (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[]" + "fetch %s body%s[]") + msg + (if leave-seen-flag-untouched + ".peek" "")))) + (setq elmo-imap4-display-literal-progress nil)) + (message "Retrieving...done.") (and (setq response (elmo-imap4-response-bodydetail-text (elmo-imap4-response-value-all response 'fetch ))) @@ -1571,6 +1580,8 @@ 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." @@ -1579,7 +1590,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))))