summaryrefslogtreecommitdiff
path: root/lisp/help-fns.el
diff options
context:
space:
mode:
authorRobert J. Chassell <bob@rattlesnake.com>2008-02-25 16:31:25 +0000
committerRobert J. Chassell <bob@rattlesnake.com>2008-02-25 16:31:25 +0000
commit70103376fb36d27587d13ab62c3d522587554926 (patch)
treede1ac2e74f2483c875d1c4178985372b310d18b8 /lisp/help-fns.el
parent2aacf0a54eda7f4465ab54b925d9d47934fd67b9 (diff)
downloademacs-70103376fb36d27587d13ab62c3d522587554926.tar.gz
(describe-variable): Add phrases about initialization file with and
without customization; use new button type help-info-variable.
Diffstat (limited to 'lisp/help-fns.el')
-rw-r--r--lisp/help-fns.el36
1 files changed, 29 insertions, 7 deletions
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index d7886215880..b5172ec024b 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -636,8 +636,8 @@ it is displayed along with the global value."
(terpri)
(let* ((alias (condition-case nil
- (indirect-variable variable)
- (error variable)))
+ (indirect-variable variable)
+ (error variable)))
(obsolete (get variable 'byte-obsolete-variable))
(safe-var (get variable 'safe-local-variable))
(doc (or (documentation-property variable 'variable-documentation)
@@ -676,17 +676,39 @@ it is displayed along with the global value."
(princ "Documentation:\n")
(with-current-buffer standard-output
(insert (or doc "Not documented as a variable."))))
- ;; Make a link to customize if this variable can be customized.
- (when (custom-variable-p variable)
- (let ((customize-label "customize"))
+
+ (let ((customize-label "customize")
+ (initialization-file "initialization file"))
+ ;; All variables can be set; some can be customized
+ (when (and (symbolp variable) (not (custom-variable-p variable)))
+ (terpri)
+ (terpri)
+ (princ (concat "You can set this variable in your "
+ initialization-file "."))
+ (with-current-buffer standard-output
+ (save-excursion
+ (re-search-backward
+ (concat "\\(" initialization-file "\\)") nil t)
+ (help-xref-button 1 'help-info-variable variable
+ "(emacs)Init File"))))
+ ;; Make a link to customize if this variable can be customized.
+ (when (custom-variable-p variable)
(terpri)
(terpri)
- (princ (concat "You can " customize-label " this variable."))
+ (princ (concat "You can " customize-label " this variable"))
+ (princ (concat " or set it in your " initialization-file "."))
(with-current-buffer standard-output
(save-excursion
(re-search-backward
(concat "\\(" customize-label "\\)") nil t)
- (help-xref-button 1 'help-customize-variable variable))))
+ (help-xref-button 1 'help-customize-variable variable))
+ (save-excursion
+ (re-search-backward
+ (concat "\\(" initialization-file "\\)") nil t)
+ (help-xref-button 1 'help-info-variable variable
+ "(emacs)Init File")
+ )
+ ))
;; Note variable's version or package version
(let ((output (describe-variable-custom-version-info variable)))
(when output