aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2021-06-06 13:04:12 +0200
committerLars Ingebrigtsen2021-06-06 13:04:12 +0200
commit929adad22b49ea204bb3a1018fbe1e153364fe87 (patch)
tree9fa8564e59979a9c389fb6c2f0f97dfe4905bf6e
parent3c2db0c541491fceb7081d5b54de5abec25e2f4b (diff)
downloademacs-929adad22b49ea204bb3a1018fbe1e153364fe87.tar.gz
emacs-929adad22b49ea204bb3a1018fbe1e153364fe87.zip
Clarify file reversion prompt
* lisp/files.el (revert-buffer--default): Clarify prompt when the buffer is modified (bug#43884).
-rw-r--r--lisp/files.el7
1 files 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."
6248 (dolist (regexp revert-without-query) 6248 (dolist (regexp revert-without-query)
6249 (when (string-match regexp file-name) 6249 (when (string-match regexp file-name)
6250 (throw 'found t))))) 6250 (throw 'found t)))))
6251 (yes-or-no-p (format "Revert buffer from file %s? " 6251 (yes-or-no-p
6252 file-name))) 6252 (format (if (buffer-modified-p)
6253 "Discard edits and reread from %s? "
6254 "Revert buffer from file %s? ")
6255 file-name)))
6253 (run-hooks 'before-revert-hook) 6256 (run-hooks 'before-revert-hook)
6254 ;; If file was backed up but has changed since, 6257 ;; If file was backed up but has changed since,
6255 ;; we should make another backup. 6258 ;; we should make another backup.