diff options
| author | Karl Fogel | 2009-09-05 15:16:49 +0000 |
|---|---|---|
| committer | Karl Fogel | 2009-09-05 15:16:49 +0000 |
| commit | ef7ef2a01693469788f72fdaa554b88f1b961e0f (patch) | |
| tree | 9677e0a4703913860f617bf8190cc98759c23aea | |
| parent | 21ee034d123f4e6918cd4b50a7df8f8d8551c661 (diff) | |
| download | emacs-ef7ef2a01693469788f72fdaa554b88f1b961e0f.tar.gz emacs-ef7ef2a01693469788f72fdaa554b88f1b961e0f.zip | |
* 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.
| -rw-r--r-- | lisp/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/files.el | 12 |
2 files changed, 15 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 182e064579e..9356b66552d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2009-09-05 Karl Fogel <kfogel@red-bean.com> | ||
| 2 | |||
| 3 | * files.el (find-alternate-file): If the old buffer is modified | ||
| 4 | and visiting a file, behave similarly to `kill-buffer' when | ||
| 5 | killing it, thus reverting to the pre-1.878 behavior; see | ||
| 6 | http://lists.gnu.org/archive/html/emacs-devel/2009-09/msg00101.html | ||
| 7 | for discussion. Also, consult `buffer-file-name' as a variable | ||
| 8 | not as a function, for consistency with the rest of the code. | ||
| 9 | |||
| 1 | 2009-09-04 Michael Albinus <michael.albinus@gmx.de> | 10 | 2009-09-04 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 11 | ||
| 3 | * net/tramp.el (tramp-handle-insert-directory): Handle "--dired" | 12 | * net/tramp.el (tramp-handle-insert-directory): Handle "--dired" |
diff --git a/lisp/files.el b/lisp/files.el index 9f22a60dc00..773740214b7 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -1481,12 +1481,12 @@ killed." | |||
| 1481 | t))) | 1481 | t))) |
| 1482 | (unless (run-hook-with-args-until-failure 'kill-buffer-query-functions) | 1482 | (unless (run-hook-with-args-until-failure 'kill-buffer-query-functions) |
| 1483 | (error "Aborted")) | 1483 | (error "Aborted")) |
| 1484 | (when (and (buffer-modified-p) (buffer-file-name)) | 1484 | (when (and (buffer-modified-p) buffer-file-name) |
| 1485 | (if (yes-or-no-p (format "Buffer %s is modified; kill anyway? " | 1485 | (if (yes-or-no-p (format "Buffer %s is modified; save it first? " |
| 1486 | (buffer-name))) | 1486 | (buffer-name))) |
| 1487 | (unless (yes-or-no-p "Kill and replace the buffer without saving it? ") | 1487 | (save-buffer) |
| 1488 | (error "Aborted")) | 1488 | (unless (yes-or-no-p "Kill and replace the buffer without saving it? ") |
| 1489 | (save-buffer))) | 1489 | (error "Aborted")))) |
| 1490 | (let ((obuf (current-buffer)) | 1490 | (let ((obuf (current-buffer)) |
| 1491 | (ofile buffer-file-name) | 1491 | (ofile buffer-file-name) |
| 1492 | (onum buffer-file-number) | 1492 | (onum buffer-file-number) |