Commit 2aa8cc2d authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

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

parent 11da5363
......@@ -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? "
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment