]> code.delx.au - gnu-emacs/blobdiff - lisp/mail/rmailout.el
rmailout fix for bug#9978.
[gnu-emacs] / lisp / mail / rmailout.el
index 3926b426a67a5ec811abf4b8e6955fa7218d53ed..c168ca9d8f51c2c3c3a6247a9994e7f4df419031 100644 (file)
@@ -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.