From 58cb3f65f24a51d423ac6b81ecc84c14ccc098b9 Mon Sep 17 00:00:00 2001 From: teranisi Date: Thu, 7 Jun 2001 03:30:54 +0000 Subject: [PATCH] * 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/ChangeLog | 4 ++++ elmo/elmo-imap4.el | 33 ++++++++++++++++++++++----------- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 20e3893..d57a9e1 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,5 +1,9 @@ 2001-06-07 Yuuichi Teranishi + * 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. diff --git a/elmo/elmo-imap4.el b/elmo/elmo-imap4.el index 1ca021b..afa580f 100644 --- a/elmo/elmo-imap4.el +++ b/elmo/elmo-imap4.el @@ -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))) -- 1.7.10.4