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 18:32:50 -0400	[thread overview]
Message-ID: <jwvwmpb8muc.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <875xwvedcs.fsf@gmail.com> (No Wayman's message of "Fri, 05 Apr 2024 16:58:11 -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))
 






  reply	other threads:[~2024-04-05 22:32 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
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 [this message]
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=jwvwmpb8muc.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).