changeset 11981:405d4e500223

(find-file-noselect): In "file changed" messages, mention buffer name if different from file name.
author Karl Heuer <kwzh@gnu.org>
date Mon, 29 May 1995 06:54:09 +0000
parents 30b88291babf
children a88f862b3927
files lisp/files.el
diffstat 1 files changed, 13 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/files.el	Mon May 29 06:36:12 1995 +0000
+++ b/lisp/files.el	Mon May 29 06:54:09 1995 +0000
@@ -685,11 +685,19 @@
 	      (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)))))