]> git.eshelyaron.com Git - emacs.git/commitdiff
(describe-variable): Add a button to call
authorRichard M. Stallman <rms@gnu.org>
Mon, 25 May 1998 18:39:16 +0000 (18:39 +0000)
committerRichard M. Stallman <rms@gnu.org>
Mon, 25 May 1998 18:39:16 +0000 (18:39 +0000)
customize-variable if the variable can be customized.

lisp/help.el

index 4357963baa50d17f0f76f6563c5e3899c9dfee8d..1c15f4f87e4fd36fd4061db82378e47e4daae3e9 100644 (file)
@@ -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)