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:52:19 +0000
Message-ID: <8dea9f3e0e1d8e0786fa@heytings.org>
References: <87fscpifdw.fsf@localhost> <8dea9f3e0e57f739835f@heytings.org>
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="1255"; 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:53:58 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 1pDMwf-00007E-VK
	for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 05 Jan 2023 10:53:58 +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 1pDMvo-0005vk-AU; Thu, 05 Jan 2023 04:53:04 -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 1pDMvm-0005vM-On
 for bug-gnu-emacs@gnu.org; Thu, 05 Jan 2023 04:53:02 -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 1pDMvm-0005nK-Go
 for bug-gnu-emacs@gnu.org; Thu, 05 Jan 2023 04:53: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 1pDMvm-0004yK-Ct
 for bug-gnu-emacs@gnu.org; Thu, 05 Jan 2023 04:53: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:53:02 +0000
Resent-Message-ID: <handler.60568.B60568.167291234419065@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.167291234419065
 (code B ref 60568); Thu, 05 Jan 2023 09:53:02 +0000
Original-Received: (at 60568) by debbugs.gnu.org; 5 Jan 2023 09:52:24 +0000
Original-Received: from localhost ([127.0.0.1]:50318 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1pDMvA-0004xQ-9m
 for submit@debbugs.gnu.org; Thu, 05 Jan 2023 04:52:24 -0500
Original-Received: from heytings.org ([95.142.160.155]:59756)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gregory@heytings.org>) id 1pDMv7-0004xF-6h
 for 60568@debbugs.gnu.org; Thu, 05 Jan 2023 04:52:21 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org;
 s=20220101; t=1672912339;
 bh=N4If8LE83JPEFShedi+5QW9BPBaOqzoXO0Igdg7AIig=;
 h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From;
 b=zPNwcLf7UbT9ebEm0+b3gwXNOrDeOV211WQ32zdn2oTf/phisYDnUYvtLxxT3k+VI
 kajpAMSZjDcsGMVTyHutIcmLiYqS4L/x0gbKi1FGFJAv0kYB+w9eUP2nyGwK9mFOi4
 WA+oPZ6JdKM9OKjEOdQcMSi+haf5bqq46jRz5KsRmjQJorV9hHl0x/MgAIhfbjc1Z8
 gA7AR0UAykY//+FYDauahrMbohWFaqJG0v9LqxwDpS2RnZnQM3s213VhRPC0E7k+qo
 R9vw2TdR6mI3+639TncjhGoqMprGlz1/dFaYAJaU4zSDRF3Rp7/ycf5h03AzAB91VO
 MYQR1arU4GBlw==
In-Reply-To: <8dea9f3e0e57f739835f@heytings.org>
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:252587
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/252587>


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

Shorter and better:

diff --git a/lisp/help-mode.el b/lisp/help-mode.el
index bf64d032b6..75ccd93938 100644
--- a/lisp/help-mode.el
+++ b/lisp/help-mode.el
@@ -281,7 +281,11 @@ 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 `%s'."
+                          fun file))
+         (insert "\n\nFunction definition:\n\n")
+         (insert (pp-to-string (symbol-function fun))))))))

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