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

From: Gregory Heytings <[email-masked]>
Date: Thu, 05 Jan 2023 09:40:11 +0000

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