aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2012-03-10 03:54:24 -0500
committerRichard M. Stallman2012-03-10 03:54:24 -0500
commitde3bc99a8d21d742e0fea36094274b3ed85bcf11 (patch)
tree636cbccac49698fdda0a8a6ce32620b562f318ec
parent92795c91426b870c838c7c60a143a83734d220d3 (diff)
downloademacs-de3bc99a8d21d742e0fea36094274b3ed85bcf11.tar.gz
emacs-de3bc99a8d21d742e0fea36094274b3ed85bcf11.zip
rmail.el: If view buffer gets lost with the real text, don't save
the Rmail file as just one message.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/mail/rmail.el12
2 files changed, 13 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e1ece83b6a6..0648c9dc5cd 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,10 @@
12012-03-10 Richard Stallman <rms@gnu.org> 12012-03-10 Richard Stallman <rms@gnu.org>
2 2
3 * mail/rmail.el (rmail-buffers-swapped-p): Don't assume dead
4 view buffer means not swapped.
5 (rmail-view-buffer-kill-buffer-hook): Give buf name in error msg.
6 (rmail-write-region-annotate): Error if real text has disappeared.
7
3 * epa-mail.el (epa-mail-encrypt): Bind inhibit-read-only. 8 * epa-mail.el (epa-mail-encrypt): Bind inhibit-read-only.
4 9
52012-03-10 Chong Yidong <cyd@gnu.org> 102012-03-10 Chong Yidong <cyd@gnu.org>
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
1363(defun rmail-buffers-swapped-p () 1363(defun rmail-buffers-swapped-p ()
1364 "Return non-nil if the message collection is in `rmail-view-buffer'." 1364 "Return non-nil if the message collection is in `rmail-view-buffer'."
1365 ;; This is analogous to tar-data-swapped-p in tar-mode.el. 1365 ;; This is analogous to tar-data-swapped-p in tar-mode.el.
1366 (and (buffer-live-p rmail-view-buffer) 1366 rmail-buffer-swapped)
1367 rmail-buffer-swapped))
1368 1367
1369(defun rmail-change-major-mode-hook () 1368(defun rmail-change-major-mode-hook ()
1370 ;; Bring the actual Rmail messages back into the main buffer. 1369 ;; Bring the actual Rmail messages back into the main buffer.
@@ -1406,7 +1405,8 @@ If so restore the actual mbox message collection."
1406 (kill-buffer rmail-view-buffer)))) 1405 (kill-buffer rmail-view-buffer))))
1407 1406
1408(defun rmail-view-buffer-kill-buffer-hook () 1407(defun rmail-view-buffer-kill-buffer-hook ()
1409 (error "Can't kill message view buffer by itself")) 1408 (error "Can't kill Rmail view buffer `%s' by itself"
1409 (buffer-name (current-buffer))))
1410 1410
1411;; Set up the permanent locals associated with an Rmail file. 1411;; Set up the permanent locals associated with an Rmail file.
1412(defun rmail-perm-variables () 1412(defun rmail-perm-variables ()
@@ -4472,7 +4472,11 @@ encoded string (and the same mask) will decode the string."
4472 4472
4473;; Used in `write-region-annotate-functions' to write rmail files. 4473;; Used in `write-region-annotate-functions' to write rmail files.
4474(defun rmail-write-region-annotate (start end) 4474(defun rmail-write-region-annotate (start end)
4475 (when (and (null start) (rmail-buffers-swapped-p)) 4475 (when (and (null start) rmail-buffer-swapped)
4476 (unless (buffer-live-p rmail-view-buffer)
4477 (error "Buffer `%s' with real text of `%s' has disappeared"
4478 (buffer-name rmail-view-buffer)
4479 (buffer-name (current-buffer))))
4476 (setq rmail-message-encoding buffer-file-coding-system) 4480 (setq rmail-message-encoding buffer-file-coding-system)
4477 (set-buffer rmail-view-buffer) 4481 (set-buffer rmail-view-buffer)
4478 (widen) 4482 (widen)