(find-alternate-file): Confirm killing buffer only if it is visiting a file.

This commit is contained in:
Richard M. Stallman 1994-09-24 01:27:46 +00:00
parent 11da536332
commit 2aa8cc2dc5

View file

@ -516,7 +516,7 @@ If the current buffer now contains an empty file that you just visited
file-dir (file-name-directory file)))
(list (read-file-name
"Find alternate file: " file-dir nil nil file-name))))
(and (buffer-modified-p)
(and (buffer-modified-p) (buffer-file-name)
;; (not buffer-read-only)
(not (yes-or-no-p (format "Buffer %s is modified; kill anyway? "
(buffer-name))))