emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 929adad: Clarify file reversion prompt


From: Lars Ingebrigtsen
Subject: master 929adad: Clarify file reversion prompt
Date: Sun, 6 Jun 2021 07:05:17 -0400 (EDT)

branch: master
commit 929adad22b49ea204bb3a1018fbe1e153364fe87
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    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 c694507..2450daf 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]