aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/mail/sendmail.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/mail/sendmail.el')
-rw-r--r--lisp/mail/sendmail.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index c4647d7893..1ecae9faa5 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -863,7 +863,10 @@ Prefix arg means don't delete this window."
;; even if this message was not started by an Rmail command.
(unless return-action
(dolist (buffer (buffer-list))
- (if (eq (buffer-local-value 'major-mode buffer) 'rmail-mode)
+ (if (and (eq (buffer-local-value 'major-mode buffer) 'rmail-mode)
+ (null return-action)
+ ;; Don't match message-viewer buffer.
+ (not (string-match "\\` " (buffer-name buffer))))
(setq return-action `(rmail-mail-return ,buffer)))))
(if (and (null arg) return-action)
(apply (car return-action) (cdr return-action))