changeset 100299:62b6bd1722a5

(save-some-buffers): At each map-y-or-n-p iteration, check whether the buffer is still alive.
author Chong Yidong <cyd@stupidchicken.com>
date Tue, 09 Dec 2008 23:43:11 +0000
parents cdbab14860b4
children abeff3bb00ab
files lisp/files.el
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/files.el	Tue Dec 09 23:43:03 2008 +0000
+++ b/lisp/files.el	Tue Dec 09 23:43:11 2008 +0000
@@ -4351,7 +4351,10 @@
       (setq files-done
 	    (map-y-or-n-p
              (lambda (buffer)
-               (and (buffer-modified-p buffer)
+	       ;; Note that killing some buffers may kill others via
+	       ;; hooks (e.g. Rmail and its viewing buffer).
+	       (and (buffer-live-p buffer)
+		    (buffer-modified-p buffer)
                     (not (buffer-base-buffer buffer))
                     (or
                      (buffer-file-name buffer)