From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Stefan Monnier via "Bug reports for GNU Emacs,
 the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
Newsgroups: gmane.emacs.bugs
Subject: bug#70209: 30.0.50; describe key + lambda too poetic
Date: Fri, 05 Apr 2024 18:32:50 -0400
Message-ID: <jwvwmpb8muc.fsf-monnier+emacs@gnu.org>
References: <874jcgbekr.fsf@gmail.com> <87wmpc9z38.fsf@gmail.com>
 <jwvr0fkjat4.fsf-monnier+emacs@gnu.org> <875xwvedcs.fsf@gmail.com>
Reply-To: Stefan Monnier <monnier@iro.umontreal.ca>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="32175"; mail-complaints-to="usenet@ciao.gmane.io"
User-Agent: Gnus/5.13 (Gnus v5.13)
Cc: 70209@debbugs.gnu.org
To: No Wayman <iarchivedmywholelife@gmail.com>
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Apr 06 00:36:19 2024
Return-path: <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>
Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org
Original-Received: from lists.gnu.org ([209.51.188.17])
	by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.92)
	(envelope-from <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>)
	id 1rssAU-0008BR-J7
	for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 Apr 2024 00:36:18 +0200
Original-Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <bug-gnu-emacs-bounces@gnu.org>)
	id 1rssAA-0003oe-G6; Fri, 05 Apr 2024 18:35:58 -0400
Original-Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1rssA9-0003oR-8k
 for bug-gnu-emacs@gnu.org; Fri, 05 Apr 2024 18:35:57 -0400
Original-Received: from debbugs.gnu.org ([2001:470:142:5::43])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1rssA8-0006EB-Vk
 for bug-gnu-emacs@gnu.org; Fri, 05 Apr 2024 18:35:57 -0400
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1rssAE-0006C1-Co
 for bug-gnu-emacs@gnu.org; Fri, 05 Apr 2024 18:36:02 -0400
X-Loop: help-debbugs@gnu.org
Resent-From: Stefan Monnier <monnier@iro.umontreal.ca>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Fri, 05 Apr 2024 22:36:02 +0000
Resent-Message-ID: <handler.70209.B70209.171235654523724@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 70209
X-GNU-PR-Package: emacs
Original-Received: via spool by 70209-submit@debbugs.gnu.org id=B70209.171235654523724
 (code B ref 70209); Fri, 05 Apr 2024 22:36:02 +0000
Original-Received: (at 70209) by debbugs.gnu.org; 5 Apr 2024 22:35:45 +0000
Original-Received: from localhost ([127.0.0.1]:37703 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1rss9u-0006AX-P1
 for submit@debbugs.gnu.org; Fri, 05 Apr 2024 18:35:45 -0400
Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:4827)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@iro.umontreal.ca>) id 1rss9o-00069c-Lq
 for 70209@debbugs.gnu.org; Fri, 05 Apr 2024 18:35:41 -0400
Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 0CA4C441412;
 Fri,  5 Apr 2024 18:35:25 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1712356523;
 bh=essbu3XfeULcAsNaODPK8n6ZwXSNuGBigoF5xMm+0Ic=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=hq3FS5lhrzp7Fw/swH8kpK4B/gMO/RTVtDt3hatT2XSmWWaGgo8XnytB1hMr0Gc37
 +2KlFFFKumMsu/1gdGpSun7KmDFX/f8Ax2D9XvoRMRUOtqI0A/1ZdWdf1Z7xizKxMA
 iEH/gvZU4XmTtVOO0nxtr2Qi2TCgSfKeSjqmilhBNbW8hREzDariSvsLRi5nrmPm2W
 HLhaY5PEtaItHbSTRkZ/DOq/u9tVhGkloBzWTR8B0vyNtIatRK+ta3KthUN/9s9oPJ
 UJoTGSv+KkymWzjfdtmBx3OXg1ipfBHbOdHIib9fI1XOFwYu925DslwJyiC/kqQ+k1
 VsLmPQtSh0jQg==
Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id A57454413B4;
 Fri,  5 Apr 2024 18:35:23 -0400 (EDT)
Original-Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 9768F1203BC;
 Fri,  5 Apr 2024 18:35:23 -0400 (EDT)
In-Reply-To: <875xwvedcs.fsf@gmail.com> (No Wayman's message of "Fri, 05 Apr
 2024 16:58:11 -0400")
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
X-BeenThere: bug-gnu-emacs@gnu.org
List-Id: "Bug reports for GNU Emacs,
 the Swiss army knife of text editors" <bug-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/bug-gnu-emacs>
List-Post: <mailto:bug-gnu-emacs@gnu.org>
List-Help: <mailto:bug-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=subscribe>
Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org
Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org
Xref: news.gmane.io gmane.emacs.bugs:282731
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/282731>

> [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))