]> git.eshelyaron.com Git - emacs.git/commitdiff
Clarify file reversion prompt
authorLars Ingebrigtsen <larsi@gnus.org>
Sun, 6 Jun 2021 11:04:12 +0000 (13:04 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 6 Jun 2021 11:04:12 +0000 (13:04 +0200)
* lisp/files.el (revert-buffer--default): Clarify prompt when the
buffer is modified (bug#43884).

lisp/files.el

index c694507e78af1402988d140532471a7b297035a7..2450daf5bfca9b3f7ad829028466507b55d6c541 100644 (file)
@@ -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.