From: Lars Ingebrigtsen Date: Sun, 21 Aug 2022 22:37:29 +0000 (+0200) Subject: Make *Help* display info about generalized variables X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~16^2~2332^2~110 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=643990336f4b5d7db13757d59479f445e59d6b3a;p=emacs.git Make *Help* display info about generalized variables * lisp/help-fns.el (help-fns--generalized-variable): New function to document generalized variables. --- diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 74e18285e64..e06f2dec5cd 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -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