GNU bug report logs - #76341
31.0.50; Confusing prompt after C-q

Previous Next

Package: emacs;

Reported by: Mauro Aranda <maurooaranda <at> gmail.com>

Date: Sun, 16 Feb 2025 15:59:01 UTC

Severity: minor

Found in version 31.0.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Mauro Aranda <maurooaranda <at> gmail.com>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 76341 <at> debbugs.gnu.org
Subject: bug#76341: 31.0.50; Confusing prompt after C-q
Date: Sat, 22 Feb 2025 14:25:14 +0200
> Date: Sun, 16 Feb 2025 12:58:25 -0300
> From: Mauro Aranda <maurooaranda <at> gmail.com>
> 
> After emacs -Q:
> C-q
> 
> Wait for a little while and read:
> C-q- (<nil> for help)
> 
> I think that if there's no key to press for help, that message shouldn't
> show up.

I agree.  But in this case, there _is_ a help key, it just isn't C-h.
Please try the patch below.

Stefan, do you see a cleaner fix?  I didn't want to test the key
itself for being [nil], since perhaps it could be [foo bar nil] or
somesuch?  IOW, what possible forms of key could cause key-description
produce "<nil>" for its argument?

diff --git a/lisp/help.el b/lisp/help.el
index 91e0366..6c643e6 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -2200,18 +2200,20 @@ help--append-keystrokes-help
                                    (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)
+        (let* ((key (vector (if (eql val 'help)
+                                help-char
+                              val)))
+               (key-desc (key-description key)))
+          (unless (or (seq-find
+                       (lambda (map) (and (keymapp map) (lookup-key map key)))
+                       bindings)
+                      ;; Reject unhelpful "keys".
+                      (equal key-desc "<nil>"))
             (throw 'res
                    (concat
                     str
                     (substitute-command-keys
-                     (format
-                      " (\\`%s' for help)"
-                      (key-description key))))))))
+                     (format " (\\`%s' for help)" key-desc)))))))
       str)))
 
 




This bug report was last modified 142 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.