]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid "C-h for help" prompt in "C-h" commands describing keys
authorEli Zaretskii <eliz@gnu.org>
Sat, 20 Apr 2024 09:11:18 +0000 (12:11 +0300)
committerEshel Yaron <me@eshelyaron.com>
Sat, 20 Apr 2024 11:12:13 +0000 (14:12 +0300)
* lisp/info.el (Info-goto-emacs-key-command-node): Call
'read-key-sequence' instead of using 'interactive' with the "k"
code, and suppress the "C-h for help" echo.
* lisp/help.el (help--read-key-sequence): Suppress the "C-h for
help" prompt in echo-keystrokes.  Give the prompt the
'minibuffer-prompt' face.  (Bug#70432)

(cherry picked from commit 08b55ec559bd3e203abe5bbbdc2bc9135d385222)

lisp/help.el
lisp/info.el

index 9b020486f556905094ea6c90335481fe738028d1..46b3200d736c402da5bb2a213e49a0c5b5df1772 100644 (file)
@@ -1053,6 +1053,9 @@ with `mouse-movement' events."
   (let ((enable-disabled-menus-and-buttons t)
         (cursor-in-echo-area t)
         (side-event nil)
+        ;; Showing the list of key sequences makes no sense when they
+        ;; asked about a key sequence.
+        (echo-keystrokes-help nil)
         saved-yank-menu)
     (unwind-protect
         (let (last-modifiers key-list)
@@ -1070,8 +1073,11 @@ with `mouse-movement' events."
                   ;; After a click, see if a double click is on the way.
                   (and (memq 'click last-modifiers)
                        (not (sit-for (/ (mouse-double-click-time) 1000.0) t))))
-            (let* ((seq (read-key-sequence "\
+            (let* ((prompt
+                    (propertize "\
 Describe the following key, mouse click, or menu item: "
+                                'face 'minibuffer-prompt))
+                   (seq (read-key-sequence prompt
                                            nil nil 'can-return-switch-frame))
                    (raw-seq (this-single-command-raw-keys))
                    (keyn (when (> (length seq) 0)
index b1b9d48855a7942f6507b9fa225ddf6bdb98dce7..c2c393cb243c50875bbd94b1319293d99c43da4a 100644 (file)
@@ -4794,7 +4794,15 @@ Interactively, if the binding is `execute-extended-command', a command is read.
 The command is found by looking up in Emacs manual's indices
 or in another manual found via COMMAND's `info-file' property or
 the variable `Info-file-list-for-emacs'."
-  (interactive "kFind documentation for key: ")
+  (interactive
+   (let ((enable-disabled-menus-and-buttons t)
+         (cursor-in-echo-area t)
+         ;; Showing the list of key sequences makes no sense when they
+         ;; asked about a key sequence.
+         (echo-keystrokes-help nil)
+         (prompt (propertize "Find documentation for key: "
+                              'face 'minibuffer-prompt)))
+     (list (read-key-sequence prompt nil nil 'can-return-switch-frame))))
   (let ((command (key-binding key)))
     (cond ((null command)
           (message "%s is undefined" (key-description key)))