Subject: 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:52:19 +0000

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