From be9acc262964098b774110b7fb2f0228ffd74863 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Tue, 9 Dec 2008 23:43:11 +0000 Subject: [PATCH] (save-some-buffers): At each map-y-or-n-p iteration, check whether the buffer is still alive. --- lisp/files.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/files.el b/lisp/files.el index ba281a908a1..0e303805d0c 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -4351,7 +4351,10 @@ change the additional actions you can take on files." (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) -- 2.39.2