unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: No Wayman <iarchivedmywholelife@gmail.com>
Cc: 70209@debbugs.gnu.org
Subject: bug#70209: 30.0.50; describe key + lambda too poetic
Date: Fri, 05 Apr 2024 07:44:51 -0400	[thread overview]
Message-ID: <jwvr0fkjat4.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87wmpc9z38.fsf@gmail.com> (No Wayman's message of "Fri, 05 Apr 2024 01:07:39 -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))
 






  parent reply	other threads:[~2024-04-05 11:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-05  4:47 bug#70209: 30.0.50; describe key + lambda too poetic No Wayman
2024-04-05  5:07 ` No Wayman
2024-04-05  5:43   ` Eli Zaretskii
2024-04-05 11:44   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-04-05 20:58     ` No Wayman
2024-04-05 22:32       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-06  5:36         ` No Wayman
2024-04-06 13:17           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvr0fkjat4.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=70209@debbugs.gnu.org \
    --cc=iarchivedmywholelife@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).