aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2011-11-22 23:41:17 -0800
committerGlenn Morris2011-11-22 23:41:17 -0800
commit8038d2d2900195ee31941abe6d3b5df2ed7f75d9 (patch)
tree5516bdab9e8cfd8371c21edcf634527fffcff8db
parentf3fe222a8217cdf3a755b0541d1101634939bca6 (diff)
downloademacs-8038d2d2900195ee31941abe6d3b5df2ed7f75d9.tar.gz
emacs-8038d2d2900195ee31941abe6d3b5df2ed7f75d9.zip
Rmail trivia: give explicit errors for empty folders.
* mail/rmail.el (rmail-forward): * mail/rmailkwd.el (rmail-set-label): * mail/rmailout.el (rmail-output, rmail-output-as-seen) (rmail-output-body-to-file): Give error if no message. Fixes: debbugs:10082
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/mail/rmail.el2
-rw-r--r--lisp/mail/rmailkwd.el3
-rw-r--r--lisp/mail/rmailout.el6
4 files changed, 15 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 54813759298..2a154b65890 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,10 @@
12011-11-23 Glenn Morris <rgm@gnu.org> 12011-11-23 Glenn Morris <rgm@gnu.org>
2 2
3 * mail/rmail.el (rmail-forward):
4 * mail/rmailkwd.el (rmail-set-label):
5 * mail/rmailout.el (rmail-output, rmail-output-as-seen)
6 (rmail-output-body-to-file): Give error if no message. (Bug#10082)
7
3 * mail/rmail.el (rmail-current-message): Doc fix. 8 * mail/rmail.el (rmail-current-message): Doc fix.
4 9
5 * mail/rmail.el (rmail-message-filter): Mark as obsolete. (Bug#2624) 10 * mail/rmail.el (rmail-message-filter): Mark as obsolete. (Bug#2624)
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 6e79c5c82b1..b920c065de5 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -3786,6 +3786,8 @@ which is an element of rmail-msgref-vector."
3786With prefix argument, \"resend\" the message instead of forwarding it; 3786With prefix argument, \"resend\" the message instead of forwarding it;
3787see the documentation of `rmail-resend'." 3787see the documentation of `rmail-resend'."
3788 (interactive "P") 3788 (interactive "P")
3789 (if (zerop rmail-current-message)
3790 (error "No message to forward"))
3789 (if resend 3791 (if resend
3790 (call-interactively 'rmail-resend) 3792 (call-interactively 'rmail-resend)
3791 (let ((forward-buffer rmail-buffer) 3793 (let ((forward-buffer rmail-buffer)
diff --git a/lisp/mail/rmailkwd.el b/lisp/mail/rmailkwd.el
index 73542578bf6..472740aefd8 100644
--- a/lisp/mail/rmailkwd.el
+++ b/lisp/mail/rmailkwd.el
@@ -96,7 +96,8 @@ LABEL may be a symbol or string."
96 (error "More than one label specified")) 96 (error "More than one label specified"))
97 (with-current-buffer rmail-buffer 97 (with-current-buffer rmail-buffer
98 (rmail-maybe-set-message-counters) 98 (rmail-maybe-set-message-counters)
99 (or msg (setq msg rmail-current-message)) 99 (if (zerop (or msg (setq msg rmail-current-message)))
100 (error "No message"))
100 ;; Force recalculation of summary for this message. 101 ;; Force recalculation of summary for this message.
101 (aset rmail-summary-vector (1- msg) nil) 102 (aset rmail-summary-vector (1- msg) nil)
102 (let (attr-index) 103 (let (attr-index)
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."
468 (if rmail-buffer 468 (if rmail-buffer
469 (set-buffer rmail-buffer) 469 (set-buffer rmail-buffer)
470 (error "There is no Rmail buffer")) 470 (error "There is no Rmail buffer"))
471 (if (zerop rmail-total-messages)
472 (error "No messages to output"))
471 (let ((orig-count count) 473 (let ((orig-count count)
472 beg end) 474 beg end)
473 (while (> count 0) 475 (while (> count 0)
@@ -533,6 +535,8 @@ so you should call `rmail-output' directly in that case."
533 (if rmail-buffer 535 (if rmail-buffer
534 (set-buffer rmail-buffer) 536 (set-buffer rmail-buffer)
535 (error "There is no Rmail buffer")) 537 (error "There is no Rmail buffer"))
538 (if (zerop rmail-total-messages)
539 (error "No messages to output"))
536 (let ((orig-count count) 540 (let ((orig-count count)
537 (cur (current-buffer))) 541 (cur (current-buffer)))
538 (while (> count 0) 542 (while (> count 0)
@@ -594,6 +598,8 @@ than appending to it. Deletes the message after writing if
594 (expand-file-name file-name 598 (expand-file-name file-name
595 (and rmail-default-body-file 599 (and rmail-default-body-file
596 (file-name-directory rmail-default-body-file)))) 600 (file-name-directory rmail-default-body-file))))
601 (if (zerop rmail-current-message)
602 (error "No message to output"))
597 (save-excursion 603 (save-excursion
598 (goto-char (point-min)) 604 (goto-char (point-min))
599 (search-forward "\n\n") 605 (search-forward "\n\n")