]> git.eshelyaron.com Git - emacs.git/commitdiff
Make *Help* display info about generalized variables
authorLars Ingebrigtsen <larsi@gnus.org>
Sun, 21 Aug 2022 22:37:29 +0000 (00:37 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 21 Aug 2022 22:37:29 +0000 (00:37 +0200)
* lisp/help-fns.el (help-fns--generalized-variable): New function
to document generalized variables.

lisp/help-fns.el

index 74e18285e6498ab3ec32d6f2d25b00725256a834..e06f2dec5cda9d1bdf0b7673a09c64424375ed02 100644 (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)
+
 \f
 ;; Variables