aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/help.el
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>1998-05-25 18:39:16 +0000
committerRichard M. Stallman <[email protected]>1998-05-25 18:39:16 +0000
commit7e824765ca6a3c3d3fb3b9bcf17fc74cc07df8b4 (patch)
tree35ab40102e736d59276f07a807196c2277deed75 /lisp/help.el
parent0bea75b9d4b7771f59de550a02843db588e1c9bc (diff)
(describe-variable): Add a button to call
customize-variable if the variable can be customized.
Diffstat (limited to 'lisp/help.el')
-rw-r--r--lisp/help.el16
1 files changed, 16 insertions, 0 deletions
diff --git a/lisp/help.el b/lisp/help.el
index 4357963baa..1c15f4f87e 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -733,6 +733,22 @@ Returns the documentation as a string, also."
(let ((doc (documentation-property variable 'variable-documentation)))
(princ (or doc "not documented as a variable.")))
(help-setup-xref (cons #'describe-variable variable) (interactive-p))
+
+ ;; Make a link to customize if this variable can be customized.
+ (if (or (get variable 'custom-type)
+ (user-variable-p variable))
+ (let ((customize-label "customize"))
+ (terpri)
+ (terpri)
+ (princ (concat "You can " customize-label " this variable."))
+ (with-current-buffer "*Help*"
+ (save-excursion
+ (re-search-backward
+ (concat "\\(" customize-label "\\)") nil t)
+ (help-xref-button 1 #'(lambda (v)
+ (customize-variable v)) variable)
+ ))))
+
(print-help-return-message)
(save-excursion
(set-buffer standard-output)