* lisp/mail/smtpmail.el (smtpmail-send-data): Add progress reporter.
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 30 May 2011 17:23:47 +0000 (14:23 -0300)
committerStefan Monnier <monnier@iro.umontreal.ca>
Mon, 30 May 2011 17:23:47 +0000 (14:23 -0300)
lisp/ChangeLog
lisp/mail/smtpmail.el

index 0064bb7..badff5c 100644 (file)
@@ -1,3 +1,7 @@
+2011-05-30  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * mail/smtpmail.el (smtpmail-send-data): Add progress reporter.
+
 2011-05-30  Leo Liu  <sdl.web@gmail.com>
 
        * net/rcirc.el (rcirc-debug-buffer): Use visible buffer name.
index 3eda350..bc1ca77 100644 (file)
@@ -943,15 +943,20 @@ The list is in preference order.")
   (process-send-string process "\r\n"))
 
 (defun smtpmail-send-data (process buffer)
-  (let ((data-continue t) sending-data)
+  (let ((data-continue t) sending-data
+        (pr (with-current-buffer buffer
+              (make-progress-reporter "Sending email"
+                                      (point-min) (point-max)))))
     (with-current-buffer buffer
       (goto-char (point-min)))
     (while data-continue
       (with-current-buffer buffer
+        (progress-reporter-update pr (point))
         (setq sending-data (buffer-substring (point-at-bol) (point-at-eol)))
        (end-of-line 2)
         (setq data-continue (not (eobp))))
-      (smtpmail-send-data-1 process sending-data))))
+      (smtpmail-send-data-1 process sending-data))
+    (progress-reporter-done pr)))
 
 (defun smtpmail-deduce-address-list (smtpmail-text-buffer header-start header-end)
   "Get address list suitable for smtp RCPT TO: <address>."