From 45e387e15166c5194fe4b78ec01bb65f0db9bcb4 Mon Sep 17 00:00:00 2001 From: Arthur Miller Date: Wed, 15 Sep 2021 15:15:30 +0200 Subject: [PATCH] Do autoload if docs are not present in autoloads * lisp/help-fns.el ('help-enable-symbol-autoload'): New option. (help-fns--analyze-function): Perform autoloading when docs are missing from autoload objects. --- lisp/help-fns.el | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lisp/help-fns.el b/lisp/help-fns.el index a7219ede94..575c69638d 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -132,6 +132,12 @@ help-enable-completion-autoload :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) @@ -823,6 +829,11 @@ help-fns--analyze-function f)) ((subrp def) (intern (subr-name def))) (t def)))) + + (and (autoloadp real-def) (not (nth 2 real-def)) + help-enable-symbol-autoload + (autoload-do-load real-def)) + (list real-function def aliased real-def))) (defun help-fns-function-description-header (function) -- 2.33.0