2001-06-06 Yuuichi Teranishi <teranisi@gohome.org>
* elmo-pop3.el (elmo-pop3-process-filter): Show retrieve progress.
+ (elmo-pop3-total-size): New variable.
+ (elmo-message-fetch-plugged): Bind elmo-pop3-total-size while fetching.
* elmo.el (elmo-folder-reserve-status-p): New method.
(defvar elmo-pop3-exists-exactly t)
(defvar sasl-mechanism-alist)
+(defvar elmo-pop3-total-size nil)
+
;;; ELMO POP3 folder
(eval-and-compile
(luna-define-class elmo-pop3-folder (elmo-net-folder)
(set-buffer (process-buffer process))
(goto-char (point-max))
(insert output)
- (message "Retrieving...(%d bytes)." (buffer-size))))
+ (if elmo-pop3-total-size
+ (message "Retrieving...(%d/%d bytes)."
+ (buffer-size) elmo-pop3-total-size))))
(defun elmo-pop3-auth-user (session)
(let ((process (elmo-network-session-process-internal session)))
(let* ((loc-alist (elmo-pop3-folder-location-alist-internal folder))
(process (elmo-network-session-process-internal
(elmo-pop3-get-session folder)))
- response errmsg msg)
+ size response errmsg msg)
(with-current-buffer (process-buffer process)
(if loc-alist
(setq number (elmo-pop3-uidl-to-number
(cdr (assq number loc-alist)))))
+ (setq size (string-to-number
+ (elmo-pop3-number-to-size number)))
(when number
(elmo-pop3-send-command process
(format "retr %s" number))
- (when (null (setq response (elmo-pop3-read-response
- process t)))
- (error "Fetching message failed"))
- (setq response (elmo-pop3-read-body process outbuf))
+ (setq elmo-pop3-total-size size)
+ (unwind-protect
+ (progn
+ (when (null (setq response (elmo-pop3-read-response
+ process t)))
+ (error "Fetching message failed"))
+ (setq response (elmo-pop3-read-body process outbuf)))
+ (setq elmo-pop3-total-size nil))
(set-buffer outbuf)
(goto-char (point-min))
(while (re-search-forward "^\\." nil t)