@kbd{C-h f} command if you don't really want to view the
documentation.
+@vindex help-enable-symbol-autoload
+ If you request help for an autoloaded function that doesn't have a
+doc string, the @file{*Help*} buffer won't have any doc string to
+display. If @code{help-enable-symbol-autoload} is non-@code{nil},
+Emacs will try to load the file the function is defined in to see
+whether there's a doc string there.
+
@findex shortdoc-display-group
You can get an overview of functions relevant for a particular topic
by using the @kbd{M-x shortdoc-display-group} command. This will
Note that the new face will also be used in tooltips. When using the
GTK toolkit, this is only true if 'x-gtk-use-system-tooltips' is t.
+*** New user option 'help-enable-symbol-autoload'.
+If non-nil, displaying help for an autoloaded function that has no
+documentation string will try to load the file it's from. This will
+give more extensive help for these functions.
+
---
*** The 'help-for-help' ('C-h C-h') screen has been redesigned.
:group 'help
:version "26.3")
+(defcustom help-enable-symbol-autoload nil
+ "Perform autoload if docs are missing from autoload objects."
+ :type 'boolean
+ :group 'help
+ :version "28.1")
+
(defun help--symbol-class (s)
"Return symbol class characters for symbol S."
(when (stringp s)
;;;###autoload
(defun describe-function (function)
"Display the full documentation of FUNCTION (a symbol).
-When called from Lisp, FUNCTION may also be a function object."
+When called from Lisp, FUNCTION may also be a function object.
+
+See the `help-enable-symbol-autoload' variable for special
+handling of autoloaded functions."
(interactive (help-fns--describe-function-or-command-prompt))
;; We save describe-function-orig-buffer on the help xref stack, so
f))
((subrp def) (intern (subr-name def)))
(t def))))
+
+ ;; If we don't have a doc string, then try to load the file.
+ (when (and help-enable-symbol-autoload
+ (autoloadp real-def)
+ ;; Empty documentation slot.
+ (not (nth 2 real-def)))
+ (condition-case err
+ (autoload-do-load real-def)
+ (error (message "Error while autoloading: %S" err))))
+
(list real-function def aliased real-def)))
(defun help-fns-function-description-header (function)