From: Stefan Monnier Date: Mon, 29 Oct 2012 13:28:41 +0000 (-0400) Subject: * lisp/files.el (find-alternate-file): Only ask one question. X-Git-Tag: emacs-24.2.90~209^2~14 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e07fcbdc32093063079b21f5675e6109f143d36d;p=emacs.git * lisp/files.el (find-alternate-file): Only ask one question. Fixes: debbugs:12487 --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index db12be1301f..e81a6146a22 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2012-10-29 Stefan Monnier + + * files.el (find-alternate-file): Only ask one question (bug#12487). + 2012-10-29 Chong Yidong * vc/vc-hooks.el (vc-file-clearprops): Kill vc-parent-buffer. diff --git a/lisp/files.el b/lisp/files.el index e030aff0ae2..26c5c683b3d 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -1537,12 +1537,9 @@ killed." t))) (unless (run-hook-with-args-until-failure 'kill-buffer-query-functions) (error "Aborted")) - (when (and (buffer-modified-p) buffer-file-name) - (if (yes-or-no-p (format "Buffer %s is modified; save it first? " - (buffer-name))) - (save-buffer) - (unless (yes-or-no-p "Kill and replace the buffer without saving it? ") - (error "Aborted")))) + (and (buffer-modified-p) buffer-file-name + (not (yes-or-no-p "Kill and replace the buffer without saving it? ")) + (error "Aborted")) (let ((obuf (current-buffer)) (ofile buffer-file-name) (onum buffer-file-number)