;;; rmailout.el --- "RMAIL" mail reader for Emacs: output message to a file
-;; Copyright (C) 1985, 1987, 1993, 1994, 2001, 2002, 2003, 2004, 2005,
-;; 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1987, 1993-1994, 2001-2012
+;; Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: mail
(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.
(if rmail-buffer
(set-buffer rmail-buffer)
(error "There is no Rmail buffer"))
+ (if (zerop rmail-total-messages)
+ (error "No messages to output"))
(let ((orig-count count)
beg end)
(while (> count 0)
(if rmail-buffer
(set-buffer rmail-buffer)
(error "There is no Rmail buffer"))
+ (if (zerop rmail-total-messages)
+ (error "No messages to output"))
(let ((orig-count count)
(cur (current-buffer)))
(while (> count 0)
(expand-file-name file-name
(and rmail-default-body-file
(file-name-directory rmail-default-body-file))))
+ (if (zerop rmail-current-message)
+ (error "No message to output"))
(save-excursion
(goto-char (point-min))
(search-forward "\n\n")
(if rmail-delete-after-output
(rmail-delete-forward)))
-;; arch-tag: 4059abf0-f249-4be4-8e0d-602d370d01d1
;;; rmailout.el ends here