Subject: bug#70432: 30.0.50; C-h for help not working with C-h k

From: Eli Zaretskii <[email-masked]>
Date: Thu, 18 Apr 2024 15:02:30 +0300

> From: Gerd Möllmann <[email-masked]>
> Date: Wed, 17 Apr 2024 09:36:04 +0200
> 
> To reproduce
> 
> 1. emacs -Q
> 2. C-h k C-x t
> 3. display says Press C-h for help
> 4. C-h
> => C-x t C-h is undefined

Because "C-x t C-h" is indeed undefined.

I think it makes no sense to tell users about C-h that shows the
available sequences when they already invoked a C-h command to ask
about a particular sequence.  So the patch below seems to be in order.
Also, "C-h K" will need a similar treatment (which is complicated by
the fact that it uses (interactive "k")).

Dmitry and Stefan, any better ideas?

diff --git a/lisp/help.el b/lisp/help.el
index d4e39f0..e6117ec 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -1049,6 +1049,9 @@ help--read-key-sequence
   (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)