]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/files.el (find-alternate-file): Only ask one question.
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 29 Oct 2012 13:28:41 +0000 (09:28 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Mon, 29 Oct 2012 13:28:41 +0000 (09:28 -0400)
Fixes: debbugs:12487
lisp/ChangeLog
lisp/files.el

index db12be1301f7cd5ee4bfcb866d2f4c49035b9575..e81a6146a22f9d15102ab722223653161b618f29 100644 (file)
@@ -1,3 +1,7 @@
+2012-10-29  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * files.el (find-alternate-file): Only ask one question (bug#12487).
+
 2012-10-29  Chong Yidong  <cyd@gnu.org>
 
        * vc/vc-hooks.el (vc-file-clearprops): Kill vc-parent-buffer.
index e030aff0ae25510c7ae3e32141b48a975037b1eb..26c5c683b3da4cfec34a0600eac1b1bc6e71037c 100644 (file)
@@ -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)