]> git.eshelyaron.com Git - emacs.git/commitdiff
(find-alternate-file): Confirm killing buffer only if it is visiting a file.
authorRichard M. Stallman <rms@gnu.org>
Sat, 24 Sep 1994 01:27:46 +0000 (01:27 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sat, 24 Sep 1994 01:27:46 +0000 (01:27 +0000)
lisp/files.el

index 934674396215a48592bb2217711a1cdda3bc930b..f4766bc1760f23ffb4db5b105c22296bdc1d2439 100644 (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))))