# HG changeset patch # User Karl Fogel # Date 1252163809 0 # Node ID ea5c49fab49a14fe3b61d8414b6ef5bf145f996c # Parent 2c670d6d9528338f04ccf7d469418dcfd0b4f6c3 * lisp/files.el (find-alternate-file): If the old buffer is modified and visiting a file, behave similarly to `kill-buffer' when killing it, thus reverting to the pre-1.878 behavior; see http://lists.gnu.org/archive/html/emacs-devel/2009-09/msg00101.html for discussion. Also, consult `buffer-file-name' as a variable not as a function, for consistency with the rest of the code. diff -r 2c670d6d9528 -r ea5c49fab49a lisp/ChangeLog --- a/lisp/ChangeLog Sat Sep 05 06:03:01 2009 +0000 +++ b/lisp/ChangeLog Sat Sep 05 15:16:49 2009 +0000 @@ -1,3 +1,12 @@ +2009-09-05 Karl Fogel + + * files.el (find-alternate-file): If the old buffer is modified + and visiting a file, behave similarly to `kill-buffer' when + killing it, thus reverting to the pre-1.878 behavior; see + http://lists.gnu.org/archive/html/emacs-devel/2009-09/msg00101.html + for discussion. Also, consult `buffer-file-name' as a variable + not as a function, for consistency with the rest of the code. + 2009-09-04 Michael Albinus * net/tramp.el (tramp-handle-insert-directory): Handle "--dired" diff -r 2c670d6d9528 -r ea5c49fab49a lisp/files.el --- a/lisp/files.el Sat Sep 05 06:03:01 2009 +0000 +++ b/lisp/files.el Sat Sep 05 15:16:49 2009 +0000 @@ -1481,12 +1481,12 @@ 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; kill anyway? " - (buffer-name))) - (unless (yes-or-no-p "Kill and replace the buffer without saving it? ") - (error "Aborted")) - (save-buffer))) + (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")))) (let ((obuf (current-buffer)) (ofile buffer-file-name) (onum buffer-file-number)