Make *Help* display info about generalized variables

* lisp/help-fns.el (help-fns--generalized-variable): New function
to document generalized variables.
This commit is contained in:
Lars Ingebrigtsen 2022-08-22 00:37:29 +02:00
commit 643990336f

View file

@ -1155,6 +1155,15 @@ Returns a list of the form (REAL-FUNCTION DEF ALIASED REAL-DEF)."
(add-hook 'help-fns-describe-function-functions #'help-fns--parent-mode)
(add-hook 'help-fns-describe-function-functions #'help-fns--compiler-macro 100)
(defun help-fns--generalized-variable (function)
(when (get function 'gv-expander)
(insert (format-message " `%s' is also a " function)
(buttonize "generalized variable"
(lambda (_) (info "(elisp)Generalized Variables")))
".\n")))
(add-hook 'help-fns-describe-function-functions
#'help-fns--generalized-variable)
;; Variables