GNU bug report logs - #70209
30.0.50; describe key + lambda too poetic

Previous Next

Package: emacs;

Reported by: No Wayman <iarchivedmywholelife <at> gmail.com>

Date: Fri, 5 Apr 2024 04:49:02 UTC

Severity: normal

Found in version 30.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: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: No Wayman <iarchivedmywholelife <at> gmail.com>
Cc: 70209 <at> debbugs.gnu.org
Subject: bug#70209: 30.0.50; describe key + lambda too poetic
Date: Fri, 05 Apr 2024 18:32:50 -0400
> [1]:
> emacs -Q --batch \
> --eval '(global-set-key (kbd "c") `(lambda () (interactive) t)))'   \
> --eval '(describe-key "c")' \
> --eval '(with-current-buffer "*Help*"
>           (forward-button 2)
>           (push-button)
>           (print (buffer-substring-no-properties (point-min)
>            (point-max))))'
>
> Unknown type lambda

That's mild punishment for quoting a lambda.

> [2]:
> emacs -Q --batch \
> --eval '(global-set-key (kbd "c") (lambda () (interactive) t)))' \
> --eval '(describe-key "c")' \
> --eval '(with-current-buffer "*Help*"
>           (forward-button 2)
>           (push-button)
>           (print (buffer-substring-no-properties (point-min)
>            (point-max))))'
>
> Unknown type closure

OK, OK, I relent, it shouldn't be button.
Should be fixed now on `master`, thanks to the handy patch below.


        Stefan


diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 27011575333..cfe27077055 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -1096,15 +1096,15 @@ help-fns-function-description-header
 		      (setq elts (cdr-safe elts)))
 		    (concat beg (if is-full "keymap" "sparse keymap"))))
 		 (t
-		  (let ((type
-		         (if (and (consp def) (symbolp (car def)))
-		             (car def)
-		           (or (oclosure-type def) (cl-type-of def)))))
-		    (concat beg (format "%s"
-		                        (make-text-button
-		                         (symbol-name type) nil
-		                         'type 'help-type
-		                         'help-args (list type)))))))))
+		  (concat beg (format "%s"
+		                      (if (and (consp def) (symbolp (car def)))
+		                          (car def)
+		                        (let ((type (or (oclosure-type def)
+		                                        (cl-type-of def))))
+		                          (make-text-button
+		                           (symbol-name type) nil
+		                           'type 'help-type
+		                           'help-args (list type))))))))))
     (with-current-buffer standard-output
       (insert description))
 





This bug report was last modified 1 year and 40 days ago.

Previous Next


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