From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Gregory Heytings <gregory@heytings.org>
Newsgroups: gmane.emacs.bugs
Subject: bug#60568: [FR] 30.0.50;
 Help buffers and function bodies for generated functions
Date: Thu, 05 Jan 2023 09:40:11 +0000
Message-ID: <8dea9f3e0e57f739835f@heytings.org>
References: <87fscpifdw.fsf@localhost>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="29321"; mail-complaints-to="usenet@ciao.gmane.io"
Cc: 60568@debbugs.gnu.org
To: Ihor Radchenko <yantar92@posteo.net>
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 05 10:44:24 2023
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 1pDMnP-0007P4-Ns
	for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 05 Jan 2023 10:44:23 +0100
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 1pDMkJ-0003R0-Aa; Thu, 05 Jan 2023 04:41:11 -0500
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 1pDMkB-0003Na-N7
 for bug-gnu-emacs@gnu.org; Thu, 05 Jan 2023 04:41:04 -0500
Original-Received: from debbugs.gnu.org ([209.51.188.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 1pDMkA-00089P-U9
 for bug-gnu-emacs@gnu.org; Thu, 05 Jan 2023 04:41:02 -0500
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1pDMkA-0004cN-Bn
 for bug-gnu-emacs@gnu.org; Thu, 05 Jan 2023 04:41:02 -0500
X-Loop: help-debbugs@gnu.org
Resent-From: Gregory Heytings <gregory@heytings.org>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Thu, 05 Jan 2023 09:41:02 +0000
Resent-Message-ID: <handler.60568.B60568.167291161617680@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 60568
X-GNU-PR-Package: emacs
Original-Received: via spool by 60568-submit@debbugs.gnu.org id=B60568.167291161617680
 (code B ref 60568); Thu, 05 Jan 2023 09:41:02 +0000
Original-Received: (at 60568) by debbugs.gnu.org; 5 Jan 2023 09:40:16 +0000
Original-Received: from localhost ([127.0.0.1]:50290 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1pDMjP-0004b6-VI
 for submit@debbugs.gnu.org; Thu, 05 Jan 2023 04:40:16 -0500
Original-Received: from heytings.org ([95.142.160.155]:59742)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gregory@heytings.org>) id 1pDMjN-0004au-O0
 for 60568@debbugs.gnu.org; Thu, 05 Jan 2023 04:40:14 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org;
 s=20220101; t=1672911612;
 bh=P2fDjiQkLO4XJWUIvbP/HmzQqE4y+J/y2KLXhKLOBBE=;
 h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From;
 b=OMoFI37kaaew2yFyxwjJn86l7ujWL/Bja5LgfLzEt6//YLjpecG9egV2Zj/Ieubcq
 O+fcFuSYj47MM0Auatq/PjLe24CN2nNcVYRhrXroyAQNOhp1DC0pYvzXZTx2LyBkFU
 rAdbW8X4UkNl660jlSRJnG6NoJWp+klokenYfiW8gm3/072h9ibyUptsRdi9y0Z5Gy
 4WqsxkLfY4K11kWbyNNm4VEZLxPKpOexB7OZnUWWthVSR0kuhR9kWtU0WmfoAmr/P7
 fMGbGv7inrBnaz7wDFxpyJzqSXo70sTpARRN7FFan5hfqp1q/3d8SHrXGqoqldNYpM
 ORTRx0cZpOBUA==
In-Reply-To: <87fscpifdw.fsf@localhost>
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:252584
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/252584>


>
> Would it be possible to provide function body info via *Help* system in 
> Emacs?
>

Would this fit the bill?

diff --git a/lisp/help-mode.el b/lisp/help-mode.el
index bf64d032b6..049eb2fa5a 100644
--- a/lisp/help-mode.el
+++ b/lisp/help-mode.el
@@ -281,7 +281,14 @@ help-function-def--button-function
              (unless (= (point) position)
                (push-mark nil t))
              (goto-char position))
-        (message "Unable to find location in file")))))
+       (with-help-window (help-buffer)
+         (insert (format "Function `%s' could not be found in " fun))
+         (if file
+              (insert (format "`%s'." file))
+            (insert " this file."))
+         (insert "\n\n")
+         (insert (format "Function definition:\n\n" fun))
+         (insert (format "%S" (symbol-function fun))))))))

  (define-button-type 'help-function-def
    :supertype 'help-xref