summaryrefslogtreecommitdiff
path: root/lisp/mail
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2012-03-10 03:54:24 -0500
committerRichard M. Stallman <rms@gnu.org>2012-03-10 03:54:24 -0500
commitde3bc99a8d21d742e0fea36094274b3ed85bcf11 (patch)
tree636cbccac49698fdda0a8a6ce32620b562f318ec /lisp/mail
parent92795c91426b870c838c7c60a143a83734d220d3 (diff)
downloademacs-de3bc99a8d21d742e0fea36094274b3ed85bcf11.tar.gz
rmail.el: If view buffer gets lost with the real text, don't save
the Rmail file as just one message.
Diffstat (limited to 'lisp/mail')
-rw-r--r--lisp/mail/rmail.el12
1 files changed, 8 insertions, 4 deletions
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 2d327c7a0f0..3a9ba8122ab 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -1363,8 +1363,7 @@ sets the current buffer's `buffer-file-coding-system' to that of
(defun rmail-buffers-swapped-p ()
"Return non-nil if the message collection is in `rmail-view-buffer'."
;; This is analogous to tar-data-swapped-p in tar-mode.el.
- (and (buffer-live-p rmail-view-buffer)
- rmail-buffer-swapped))
+ rmail-buffer-swapped)
(defun rmail-change-major-mode-hook ()
;; Bring the actual Rmail messages back into the main buffer.
@@ -1406,7 +1405,8 @@ If so restore the actual mbox message collection."
(kill-buffer rmail-view-buffer))))
(defun rmail-view-buffer-kill-buffer-hook ()
- (error "Can't kill message view buffer by itself"))
+ (error "Can't kill Rmail view buffer `%s' by itself"
+ (buffer-name (current-buffer))))
;; Set up the permanent locals associated with an Rmail file.
(defun rmail-perm-variables ()
@@ -4472,7 +4472,11 @@ encoded string (and the same mask) will decode the string."
;; Used in `write-region-annotate-functions' to write rmail files.
(defun rmail-write-region-annotate (start end)
- (when (and (null start) (rmail-buffers-swapped-p))
+ (when (and (null start) rmail-buffer-swapped)
+ (unless (buffer-live-p rmail-view-buffer)
+ (error "Buffer `%s' with real text of `%s' has disappeared"
+ (buffer-name rmail-view-buffer)
+ (buffer-name (current-buffer))))
(setq rmail-message-encoding buffer-file-coding-system)
(set-buffer rmail-view-buffer)
(widen)