From 7e824765ca6a3c3d3fb3b9bcf17fc74cc07df8b4 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 25 May 1998 18:39:16 +0000 Subject: (describe-variable): Add a button to call customize-variable if the variable can be customized. --- lisp/help.el | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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) -- cgit v1.2.3