]> git.eshelyaron.com Git - emacs.git/commitdiff
(help--append-keystrokes-help): Fix bug#76341
authorStefan Monnier <monnier@iro.umontreal.ca>
Sat, 22 Feb 2025 19:57:25 +0000 (14:57 -0500)
committerEshel Yaron <me@eshelyaron.com>
Sun, 23 Feb 2025 08:18:44 +0000 (09:18 +0100)
* lisp/help.el (help--append-keystrokes-help): Silence the help message
when there is no help key.

(cherry picked from commit c830caab2c5bd3d03673c26f053397042dc58ad3)

lisp/help.el

index b4430a813ecbde5f1af97cddecfd280662c1c1a5..75803afdfd446b47fc456220e7796ad852f80644 100644 (file)
@@ -2344,18 +2344,17 @@ The `temp-buffer-window-setup-hook' hook is called."
                                    (current-active-maps t)))))
     (catch 'res
       (dolist (val help-event-list)
-        (let ((key (vector (if (eql val 'help)
-                               help-char
-                             val))))
-          (unless (seq-find (lambda (map) (and (keymapp map) (lookup-key map key)))
-                            bindings)
-            (throw 'res
-                   (concat
-                    str
-                    (substitute-command-keys
-                     (format
-                      " (\\`%s' for help)"
-                      (key-description key))))))))
+        (when (setq val (if (eql val 'help) help-char val))
+          (let ((key (vector val)))
+            (unless (seq-find (lambda (map) (and (keymapp map) (lookup-key map key)))
+                              bindings)
+              (throw 'res
+                     (concat
+                      str
+                      (substitute-command-keys
+                       (format
+                        " (\\`%s' for help)"
+                        (key-description key)))))))))
       str)))
 
 \f