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


Message #14 received at 70209 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: No Wayman <iarchivedmywholelife <at> gmail.com>
Cc: 70209 <at> debbugs.gnu.org
Subject: Re: bug#70209: 30.0.50; describe key + lambda too poetic
Date: Fri, 05 Apr 2024 07:44:51 -0400
Thank you for your enjoyable bug report and the suggested patch.

> @@ -1102,6 +1102,8 @@ help-fns-function-description-header
>  				elts nil))
>  		      (setq elts (cdr-safe elts)))
>  		    (concat beg (if is-full "keymap" "sparse keymap"))))
> +                 ((eq (car-safe def) 'lambda)
> +                  (concat beg "anonymous Lisp function"))
>  		 (t ""))))
>      (with-current-buffer standard-output
>        (insert description))

Actually, I think this won't help because in my test the `car` of `def`
is `closure` rather than `lambda`.

I installed the patch below instead.


        Stefan


diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index a291893e9a2..27011575333 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -1086,13 +1086,6 @@ help-fns-function-description-header
 		      ;; need to check macros before functions.
 		      (macrop function))
 		  (concat beg "Lisp macro"))
-		 ((atom def)
-		  (let ((type (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))))))
 		 ((keymapp def)
 		  (let ((is-full nil)
 			(elts (cdr-safe def)))
@@ -1102,7 +1095,16 @@ help-fns-function-description-header
 				elts nil))
 		      (setq elts (cdr-safe elts)))
 		    (concat beg (if is-full "keymap" "sparse keymap"))))
-		 (t ""))))
+		 (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)))))))))
     (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.