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.
(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."
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))))
(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)))