diff options
| author | Robert J. Chassell | 2008-02-25 16:31:25 +0000 |
|---|---|---|
| committer | Robert J. Chassell | 2008-02-25 16:31:25 +0000 |
| commit | 7f9629ce03deaa0c7b90f13368e3bc7d199f51e0 (patch) | |
| tree | 122b0332b01444e0306232fb205ba1acd6e40d92 | |
| parent | 6a8128efceee2935c40c7d091acbd1b64f891ad1 (diff) | |
| download | emacs-7f9629ce03deaa0c7b90f13368e3bc7d199f51e0.tar.gz emacs-7f9629ce03deaa0c7b90f13368e3bc7d199f51e0.zip | |
(describe-variable): Add phrases about initialization file with and
without customization; use new button type help-info-variable.
| -rw-r--r-- | lisp/help-fns.el | 36 | ||||
| -rw-r--r-- | lisp/help-mode.el | 6 |
2 files changed, 35 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." | |||
| 636 | (terpri) | 636 | (terpri) |
| 637 | 637 | ||
| 638 | (let* ((alias (condition-case nil | 638 | (let* ((alias (condition-case nil |
| 639 | (indirect-variable variable) | 639 | (indirect-variable variable) |
| 640 | (error variable))) | 640 | (error variable))) |
| 641 | (obsolete (get variable 'byte-obsolete-variable)) | 641 | (obsolete (get variable 'byte-obsolete-variable)) |
| 642 | (safe-var (get variable 'safe-local-variable)) | 642 | (safe-var (get variable 'safe-local-variable)) |
| 643 | (doc (or (documentation-property variable 'variable-documentation) | 643 | (doc (or (documentation-property variable 'variable-documentation) |
| @@ -676,17 +676,39 @@ it is displayed along with the global value." | |||
| 676 | (princ "Documentation:\n") | 676 | (princ "Documentation:\n") |
| 677 | (with-current-buffer standard-output | 677 | (with-current-buffer standard-output |
| 678 | (insert (or doc "Not documented as a variable.")))) | 678 | (insert (or doc "Not documented as a variable.")))) |
| 679 | ;; Make a link to customize if this variable can be customized. | 679 | |
| 680 | (when (custom-variable-p variable) | 680 | (let ((customize-label "customize") |
| 681 | (let ((customize-label "customize")) | 681 | (initialization-file "initialization file")) |
| 682 | ;; All variables can be set; some can be customized | ||
| 683 | (when (and (symbolp variable) (not (custom-variable-p variable))) | ||
| 684 | (terpri) | ||
| 685 | (terpri) | ||
| 686 | (princ (concat "You can set this variable in your " | ||
| 687 | initialization-file ".")) | ||
| 688 | (with-current-buffer standard-output | ||
| 689 | (save-excursion | ||
| 690 | (re-search-backward | ||
| 691 | (concat "\\(" initialization-file "\\)") nil t) | ||
| 692 | (help-xref-button 1 'help-info-variable variable | ||
| 693 | "(emacs)Init File")))) | ||
| 694 | ;; Make a link to customize if this variable can be customized. | ||
| 695 | (when (custom-variable-p variable) | ||
| 682 | (terpri) | 696 | (terpri) |
| 683 | (terpri) | 697 | (terpri) |
| 684 | (princ (concat "You can " customize-label " this variable.")) | 698 | (princ (concat "You can " customize-label " this variable")) |
| 699 | (princ (concat " or set it in your " initialization-file ".")) | ||
| 685 | (with-current-buffer standard-output | 700 | (with-current-buffer standard-output |
| 686 | (save-excursion | 701 | (save-excursion |
| 687 | (re-search-backward | 702 | (re-search-backward |
| 688 | (concat "\\(" customize-label "\\)") nil t) | 703 | (concat "\\(" customize-label "\\)") nil t) |
| 689 | (help-xref-button 1 'help-customize-variable variable)))) | 704 | (help-xref-button 1 'help-customize-variable variable)) |
| 705 | (save-excursion | ||
| 706 | (re-search-backward | ||
| 707 | (concat "\\(" initialization-file "\\)") nil t) | ||
| 708 | (help-xref-button 1 'help-info-variable variable | ||
| 709 | "(emacs)Init File") | ||
| 710 | ) | ||
| 711 | )) | ||
| 690 | ;; Note variable's version or package version | 712 | ;; Note variable's version or package version |
| 691 | (let ((output (describe-variable-custom-version-info variable))) | 713 | (let ((output (describe-variable-custom-version-info variable))) |
| 692 | (when output | 714 | (when output |
diff --git a/lisp/help-mode.el b/lisp/help-mode.el index 95ae547f457..841ad8e2512 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el | |||
| @@ -159,6 +159,12 @@ The format is (FUNCTION ARGS...).") | |||
| 159 | 'help-function #'help-xref-go-forward | 159 | 'help-function #'help-xref-go-forward |
| 160 | 'help-echo (purecopy "mouse-2, RET: move forward to next help buffer")) | 160 | 'help-echo (purecopy "mouse-2, RET: move forward to next help buffer")) |
| 161 | 161 | ||
| 162 | (define-button-type 'help-info-variable | ||
| 163 | :supertype 'help-xref | ||
| 164 | ;; the name of the variable is put before the argument to Info | ||
| 165 | 'help-function (lambda (a v) (info v)) | ||
| 166 | 'help-echo (purecopy "mouse-2, RET: read this Info node")) | ||
| 167 | |||
| 162 | (define-button-type 'help-info | 168 | (define-button-type 'help-info |
| 163 | :supertype 'help-xref | 169 | :supertype 'help-xref |
| 164 | 'help-function #'info | 170 | 'help-function #'info |