+2006-01-18 Alex Schroeder <alex@gnu.org>
+
+ * rmail.el (rmail): Only insert the file if it actually exists.
+ (rmail-show-message): Do not display labels if there are no
+ messages. This corrects the mistake if visiting an empty file,
+ but it doesn't fix the situation where you delete the all messages
+ and expunge them. This may leave the labels of the last message
+ in the modeline.
+
2006-01-17 Henrik Enberg <enberg@printf.se>
* rmailkwd.el: Don't require rmail.
(setq major-mode 'fundamental-mode))
(switch-to-buffer
(get-buffer-create (file-name-nondirectory file-name)))
- (insert-file-contents-literally file-name)
+ (when (file-exists-p file-name)
+ (insert-file-contents-literally file-name))
(setq buffer-file-name file-name))
;; As we have read a file as raw-text, the buffer is set to
;; unibyte. We must make it multibyte if necessary.
(interactive "p")
(or (eq major-mode 'rmail-mode)
(switch-to-buffer rmail-buffer))
-
- ;; If there are no messages to display, then provide a message to
- ;; indicate thusly.
(if (zerop rmail-total-messages)
-
- ;; There are no messages so display the Babyl boilerplate in the
- ;; presentation buffer. It is important to keep the boilerplate
- ;; out of the Rmail file so as not to break other mail agents.
(progn
(message "No messages to show. Add something better soon.")
- (rmail-display-labels)
+ ;; (rmail-display-labels)
(force-mode-line-update))
-
- ;; There are messages. Show one.
(let (blurb coding-system)
;; Set n to the first sane message based on the sign of n:
;; positive but greater than the total number of messages -> n;