Subject: bug#60568: [FR] 30.0.50; Help buffers and function bodies for generated functions

From: Ihor Radchenko <[email-masked]>
Date: Thu, 05 Jan 2023 07:56:11 +0000

Hi,

There have been a discussion [1] about including some of the helpful
package [2] features into built-in *Help* buffers.

One of the discussed features was displaying function source code right
in *Help* buffers. This feature usefulness have been objected at that
time, on the grounds that showing function code may be too long and
cause large *Help* buffers.

Recently, we have stumbled upon a situation when showing function code
is not only useful, but one of the few sane ways to examine it [3].
Functions that are not directly written in the source but rather
generated programmatically cannot currently be easily examined using
built-in help functionality (using describe-function or other means).
The help buffer only links to the (point-min) in the library defining
the generated function - not very helpful. In contrast, helpful extracts
function body from symbol function slot.

To illustrate, one can try the following:

1. emacs -Q
2. M-: (require 'ob-shell)
3. <F1> f org-babel-execute:sh <RET>
4. Click on the source code link in *Help* buffer
5. Observe point jumping to (point-min) with no obvious way to find the
   function definition.

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

[1]
https://yhetil.org/emacs-devel/[email-masked]

[2] https://github.com/Wilfred/helpful

[3] https://orgmode.org/list/87h6x8kluc.fsf@localhost

In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.35, cairo version 1.17.6) of 2023-01-02 built on localhost
Repository revision: 9377a3c889aa3b178a11a3b849c3d1665da096d6
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101004
System Description: Gentoo Linux

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>