From d97a9ff3398c62fe0de929a6ae77e0a3c4ace5ae Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Tue, 27 Aug 2002 20:38:30 +0000 Subject: [PATCH] (find-alternate-file): Bind kill-buffer-query-functions locally, don't set it. --- lisp/ChangeLog | 5 +++++ lisp/files.el | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e43a04eb547..cc0fa8f3434 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2002-08-27 Richard M. Stallman + + * files.el (find-alternate-file): + Bind kill-buffer-query-functions locally, don't set it. + 2002-08-27 Andreas Schwab * kmacro.el (kmacro-start-macro): Doc fix. diff --git a/lisp/files.el b/lisp/files.el index abba36a5c07..2d129c888e5 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -964,9 +964,10 @@ If the current buffer now contains an empty file that you just visited (lock-buffer) (rename-buffer oname))) (unless (eq (current-buffer) obuf) - ;; We already asked; don't ask again. - (setq kill-buffer-query-functions nil) - (kill-buffer obuf)))) + (with-current-buffer obuf + ;; We already asked; don't ask again. + (let ((kill-buffer-query-functions)) + (kill-buffer obuf)))))) (defun create-file-buffer (filename) "Create a suitably named buffer for visiting FILENAME, and return it.