unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#50780: 28.0.50; [PATCH] Mention the 'r' key in ask-user-about-supersession-help
       [not found] <m1lf3m2hxv.fsf.ref@yahoo.es>
@ 2021-09-24 13:59 ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-09-25  1:54   ` Stefan Kangas
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-09-24 13:59 UTC (permalink / raw)
  To: 50780

[-- Attachment #1: Type: text/plain, Size: 367 bytes --]


When you edit a buffer whose underlying file has changed, Emacs presents
a dialog to confirm if you really want to edit the buffer.  The dialog,
since 1996, offers to revert the file by pressing 'r', but the help
message still mentions 'n' and then 'M-x revert'.  As they are
equivalent, the attached patch updates the help text to recommend
pressing 'r'.

Thanks.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Mention-the-r-key-in-ask-user-about-supersession-hel.patch --]
[-- Type: text/x-patch, Size: 2139 bytes --]

From b1e4985bb70ec820d59984e1bab8223c11de941a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20Mart=C3=ADn?= <mardani29@yahoo.es>
Date: Fri, 24 Sep 2021 15:32:01 +0200
Subject: [PATCH] Mention the 'r' key in ask-user-about-supersession-help

* lisp/userlock.el (ask-user-about-supersession-help): Replace "n, and
then M-x revert-buffer" in the help message with "r", which does the
same thing.
---
 lisp/userlock.el | 26 +++++++++++---------------
 1 file changed, 11 insertions(+), 15 deletions(-)

diff --git a/lisp/userlock.el b/lisp/userlock.el
index a38f6ac422..87a8b7b451 100644
--- a/lisp/userlock.el
+++ b/lisp/userlock.el
@@ -201,13 +201,10 @@ ask-user-about-supersession-threat
 
 (defun ask-user-about-supersession-help ()
   (with-output-to-temp-buffer "*Help*"
-    (let ((revert-buffer-binding
-           ;; This takes place in the original buffer.
-           (substitute-command-keys "\\[revert-buffer]")))
-      (with-current-buffer standard-output
-        (insert
-         (format
-          "You want to modify a buffer whose disk file has changed
+    (with-current-buffer standard-output
+      (insert
+       (format
+        "You want to modify a buffer whose disk file has changed
 since you last read it in or saved it with this buffer.
 
 If you say %s to go ahead and modify this buffer,
@@ -216,14 +213,13 @@ ask-user-about-supersession-help
 from the file on disk.
 If you say %s, the change you started to make will be aborted.
 
-Usually, you should type %s and then %s,
-to get the latest version of the file, then make the change again."
-          (userlock--fontify-key "y")
-          (userlock--fontify-key "r")
-          (userlock--fontify-key "n")
-          (userlock--fontify-key "n")
-          revert-buffer-binding))
-        (help-mode)))))
+Usually, you should type %s to get the latest version of the
+file, then make the change again."
+        (userlock--fontify-key "y")
+        (userlock--fontify-key "r")
+        (userlock--fontify-key "n")
+        (userlock--fontify-key "r")))
+      (help-mode))))
 
 ;;;###autoload
 (defun userlock--handle-unlock-error (error)
-- 
2.31.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#50780: 28.0.50; [PATCH] Mention the 'r' key in ask-user-about-supersession-help
  2021-09-24 13:59 ` bug#50780: 28.0.50; [PATCH] Mention the 'r' key in ask-user-about-supersession-help Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2021-09-25  1:54   ` Stefan Kangas
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Kangas @ 2021-09-25  1:54 UTC (permalink / raw)
  To: Daniel Martín; +Cc: 50780

tags 50780 + fixed
close 50780 28.1
thanks

Daniel Martín <mardani29@yahoo.es> writes:

> When you edit a buffer whose underlying file has changed, Emacs presents
> a dialog to confirm if you really want to edit the buffer.  The dialog,
> since 1996, offers to revert the file by pressing 'r', but the help
> message still mentions 'n' and then 'M-x revert'.  As they are
> equivalent, the attached patch updates the help text to recommend
> pressing 'r'.

That makes sense.  Pushed to master as commit 67a0eee727.

Thanks for the patch!





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-25  1:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <m1lf3m2hxv.fsf.ref@yahoo.es>
2021-09-24 13:59 ` bug#50780: 28.0.50; [PATCH] Mention the 'r' key in ask-user-about-supersession-help Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-25  1:54   ` Stefan Kangas

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).