]> git.eshelyaron.com Git - emacs.git/commitdiff
(find-file-noselect): In "file changed" messages,
authorKarl Heuer <kwzh@gnu.org>
Mon, 29 May 1995 06:54:09 +0000 (06:54 +0000)
committerKarl Heuer <kwzh@gnu.org>
Mon, 29 May 1995 06:54:09 +0000 (06:54 +0000)
mention buffer name if different from file name.

lisp/files.el

index e04a3d1901217ea375191f7a0fe0767902b01777..6a658e7b8cc58895f00557b0dec986dd66ab5633 100644 (file)
@@ -685,11 +685,19 @@ The buffer is not selected, just returned to the caller."
              (cond ((not (file-exists-p filename))
                     (error "File %s no longer exists!" filename))
                    ((yes-or-no-p
-                     (format
-                      (if (buffer-modified-p buf)
-    "File %s changed on disk.  Discard your edits? "
-    "File %s changed on disk.  Reread from disk? ")
-                      (file-name-nondirectory filename)))
+                     (if (string= (file-name-nondirectory filename)
+                                  (buffer-name buf))
+                         (format
+                          (if (buffer-modified-p buf)
+       "File %s changed on disk.  Discard your edits? "
+       "File %s changed on disk.  Reread from disk? ")
+                          (file-name-nondirectory filename))
+                       (format
+                        (if (buffer-modified-p buf)
+      "File %s changed on disk.  Discard your edits in %s? "
+      "File %s changed on disk.  Reread from disk into %s? ")
+                        (file-name-nondirectory filename)
+                        (buffer-name buf))))
                     (save-excursion
                       (set-buffer buf)
                       (revert-buffer t t)))))