unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 50780@debbugs.gnu.org
Subject: bug#50780: 28.0.50; [PATCH] Mention the 'r' key in ask-user-about-supersession-help
Date: Fri, 24 Sep 2021 15:59:08 +0200	[thread overview]
Message-ID: <m1lf3m2hxv.fsf@yahoo.es> (raw)
In-Reply-To: m1lf3m2hxv.fsf.ref@yahoo.es

[-- 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


       reply	other threads:[~2021-09-24 13:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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 [this message]
2021-09-25  1:54   ` bug#50780: 28.0.50; [PATCH] Mention the 'r' key in ask-user-about-supersession-help Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1lf3m2hxv.fsf@yahoo.es \
    --to=bug-gnu-emacs@gnu.org \
    --cc=50780@debbugs.gnu.org \
    --cc=mardani29@yahoo.es \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).