summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2011-11-14 19:34:01 -0500
committerGlenn Morris <rgm@gnu.org>2011-11-14 19:34:01 -0500
commit447f30f64b9269fa71faaa2dedf6b1f3957516fe (patch)
tree9e156505dd845cc9afaafc02c083cc10336e6c4e /lisp
parent91af3942e9ab5540b3ab4dde6733bc883dc2abdd (diff)
downloademacs-447f30f64b9269fa71faaa2dedf6b1f3957516fe.tar.gz
rmailout fix for bug#9978.
* lisp/mail/rmailout.el (rmail-output-to-rmail-buffer): Handle empty buffers.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/mail/rmailout.el11
2 files changed, 11 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 091117ef53d..a6d49015422 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2011-11-15 Glenn Morris <rgm@gnu.org>
+
+ * mail/rmailout.el (rmail-output-to-rmail-buffer):
+ Handle empty buffers. (Bug#9978)
+
2011-11-14 Juanma Barranquero <lekktu@gmail.com>
* international/mule.el (define-charset):
diff --git a/lisp/mail/rmailout.el b/lisp/mail/rmailout.el
index 3926b426a67..c168ca9d8f5 100644
--- a/lisp/mail/rmailout.el
+++ b/lisp/mail/rmailout.el
@@ -377,11 +377,12 @@ display message number MSG."
(rmail-maybe-set-message-counters)
;; Insert the new message after the last old message.
(widen)
- ;; Make sure the last old message ends with a blank line.
- (goto-char (point-max))
- (rmail-ensure-blank-line)
- ;; Insert the new message at the end.
- (narrow-to-region (point-max) (point-max))
+ (unless (zerop (buffer-size))
+ ;; Make sure the last old message ends with a blank line.
+ (goto-char (point-max))
+ (rmail-ensure-blank-line)
+ ;; Insert the new message at the end.
+ (narrow-to-region (point-max) (point-max)))
(insert-buffer-substring tembuf)
(rmail-count-new-messages t)
;; FIXME should re-use existing windows.