From 929adad22b49ea204bb3a1018fbe1e153364fe87 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sun, 6 Jun 2021 13:04:12 +0200 Subject: [PATCH] Clarify file reversion prompt * lisp/files.el (revert-buffer--default): Clarify prompt when the buffer is modified (bug#43884). --- lisp/files.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/files.el b/lisp/files.el index c694507e78a..2450daf5bfc 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -6248,8 +6248,11 @@ Non-file buffers need a custom function." (dolist (regexp revert-without-query) (when (string-match regexp file-name) (throw 'found t))))) - (yes-or-no-p (format "Revert buffer from file %s? " - file-name))) + (yes-or-no-p + (format (if (buffer-modified-p) + "Discard edits and reread from %s? " + "Revert buffer from file %s? ") + file-name))) (run-hooks 'before-revert-hook) ;; If file was backed up but has changed since, ;; we should make another backup. -- 2.39.5