From b7d19f4a094edee26dfe029e5a50106e87b99a75 Mon Sep 17 00:00:00 2001 From: Karl Heuer Date: Mon, 29 May 1995 06:54:09 +0000 Subject: [PATCH] (find-file-noselect): In "file changed" messages, mention buffer name if different from file name. --- lisp/files.el | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/lisp/files.el b/lisp/files.el index e04a3d19012..6a658e7b8cc 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -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))))) -- 2.39.2