From: Richard M. Stallman Date: Mon, 25 May 1998 18:39:16 +0000 (+0000) Subject: (describe-variable): Add a button to call X-Git-Tag: emacs-20.3~843 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7e824765ca6a3c3d3fb3b9bcf17fc74cc07df8b4;p=emacs.git (describe-variable): Add a button to call customize-variable if the variable can be customized. --- diff --git a/lisp/help.el b/lisp/help.el index 4357963baa5..1c15f4f87e4 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)