summaryrefslogtreecommitdiff
path: root/lisp/mail/rmailout.el
diff options
context:
space:
mode:
authorJoakim Verona <joakim@verona.se>2011-12-28 04:12:56 +0100
committerJoakim Verona <joakim@verona.se>2011-12-28 04:12:56 +0100
commitbb29f044aa967831cd664c54eba0de0c701436ce (patch)
tree1398cc9780bbae0fdad071a3a3765a571c3f6d7b /lisp/mail/rmailout.el
parent3c935a7e996701244d166f684119f0ff97e25496 (diff)
parent5e605a2e528955721fc6f2bd7b9f174c15075fb1 (diff)
downloademacs-bb29f044aa967831cd664c54eba0de0c701436ce.tar.gz
emacs-bb29f044aa967831cd664c54eba0de0c701436ce.tar.bz2
emacs-bb29f044aa967831cd664c54eba0de0c701436ce.zip
upstream i think
Diffstat (limited to 'lisp/mail/rmailout.el')
-rw-r--r--lisp/mail/rmailout.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/lisp/mail/rmailout.el b/lisp/mail/rmailout.el
index c168ca9d8f5..ad76a493483 100644
--- a/lisp/mail/rmailout.el
+++ b/lisp/mail/rmailout.el
@@ -468,6 +468,8 @@ from a non-Rmail buffer. In this case, COUNT is ignored."
(if rmail-buffer
(set-buffer rmail-buffer)
(error "There is no Rmail buffer"))
+ (if (zerop rmail-total-messages)
+ (error "No messages to output"))
(let ((orig-count count)
beg end)
(while (> count 0)
@@ -533,6 +535,8 @@ so you should call `rmail-output' directly in that case."
(if rmail-buffer
(set-buffer rmail-buffer)
(error "There is no Rmail buffer"))
+ (if (zerop rmail-total-messages)
+ (error "No messages to output"))
(let ((orig-count count)
(cur (current-buffer)))
(while (> count 0)
@@ -594,6 +598,8 @@ than appending to it. Deletes the message after writing if
(expand-file-name file-name
(and rmail-default-body-file
(file-name-directory rmail-default-body-file))))
+ (if (zerop rmail-current-message)
+ (error "No message to output"))
(save-excursion
(goto-char (point-min))
(search-forward "\n\n")