From ab383a615f145c03fa62cb469c3307b0df7be1fc Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 31 Jan 2009 03:15:35 +0000 Subject: [PATCH] (rmail-new-summary): Don't try to summarize an empty folder. --- lisp/ChangeLog | 3 +++ lisp/mail/rmailsum.el | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index bcaa546ad75..338a9eb23ef 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2009-01-31 Glenn Morris + * mail/rmailsum.el (rmail-new-summary): Don't try to summarize an empty + folder. + * mail/rmail.el (rmail-msg-is-pruned): New function. (rmail-toggle-header): Doc fix. Use rmail-msg-is-pruned. (rmail-reply): Set up to yank from the decoded message rather than the diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el index 94cfa7b3df6..eb202721353 100644 --- a/lisp/mail/rmailsum.el +++ b/lisp/mail/rmailsum.el @@ -204,8 +204,9 @@ nil for FUNCTION means all messages." (if (eq major-mode 'rmail-summary-mode) (setq was-in-summary t)) (with-current-buffer rmail-buffer - (setq mesg rmail-current-message - rmail-summary-buffer (rmail-new-summary-1 desc redo func args))) + (if (zerop (setq mesg rmail-current-message)) + (error "No messages to summarize")) + (setq rmail-summary-buffer (rmail-new-summary-1 desc redo func args))) ;; Now display the summary buffer and go to the right place in it. (unless was-in-summary (if (and (one-window-p) -- 2.39.2