From: Lars Ingebrigtsen Date: Sun, 6 Jun 2021 11:04:12 +0000 (+0200) Subject: Clarify file reversion prompt X-Git-Tag: emacs-28.0.90~2178 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=929adad22b49ea204bb3a1018fbe1e153364fe87;p=emacs.git Clarify file reversion prompt * lisp/files.el (revert-buffer--default): Clarify prompt when the buffer is modified (bug#43884). --- 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.