From 781f49eb3c06baeeab14012e432d3b6620e731f0 Mon Sep 17 00:00:00 2001 From: teranisi Date: Wed, 6 Jun 2001 03:12:33 +0000 Subject: [PATCH] * elmo-pop3.el (elmo-pop3-process-filter): Show retrieve progress (rewrite). (elmo-pop3-total-size): New variable. (elmo-message-fetch-plugged): Bind elmo-pop3-total-size while fetching. --- elmo/ChangeLog | 2 ++ elmo/elmo-pop3.el | 22 ++++++++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index ad884e9..37234e8 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,6 +1,8 @@ 2001-06-06 Yuuichi Teranishi * 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. diff --git a/elmo/elmo-pop3.el b/elmo/elmo-pop3.el index 71b1295..9e9335b 100644 --- a/elmo/elmo-pop3.el +++ b/elmo/elmo-pop3.el @@ -93,6 +93,8 @@ set as non-nil.") (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) @@ -235,7 +237,9 @@ set as non-nil.") (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))) @@ -835,18 +839,24 @@ set as non-nil.") (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) -- 1.7.10.4