diff options
| author | Luc Teirlinck | 2005-11-14 23:19:42 +0000 |
|---|---|---|
| committer | Luc Teirlinck | 2005-11-14 23:19:42 +0000 |
| commit | e715d9b46f8821f6e7e1469a3e1faa1df2c2d1a9 (patch) | |
| tree | 8ac5008e4851e5f811ad367d4e750844917ea992 | |
| parent | 7cb1a551058b06a700df497dddbe6831da856d61 (diff) | |
| download | emacs-e715d9b46f8821f6e7e1469a3e1faa1df2c2d1a9.tar.gz emacs-e715d9b46f8821f6e7e1469a3e1faa1df2c2d1a9.zip | |
(help-make-xrefs, help-xref-on-pp, help-xref-interned, help-follow):
Make hyperlinks for variables that are unbound, but have a non-nil
variable-documentation property.
| -rw-r--r-- | lisp/help-mode.el | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/lisp/help-mode.el b/lisp/help-mode.el index a2e7fb88663..b7cea179aea 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el | |||
| @@ -384,8 +384,9 @@ that." | |||
| 384 | (if sym | 384 | (if sym |
| 385 | (cond | 385 | (cond |
| 386 | ((match-string 3) ; `variable' &c | 386 | ((match-string 3) ; `variable' &c |
| 387 | (and (boundp sym) ; `variable' doesn't ensure | 387 | (and (or (boundp sym) ; `variable' doesn't ensure |
| 388 | ; it's actually bound | 388 | ; it's actually bound |
| 389 | (get sym 'variable-documentation)) | ||
| 389 | (help-xref-button 8 'help-variable sym))) | 390 | (help-xref-button 8 'help-variable sym))) |
| 390 | ((match-string 4) ; `function' &c | 391 | ((match-string 4) ; `function' &c |
| 391 | (and (fboundp sym) ; similarly | 392 | (and (fboundp sym) ; similarly |
| @@ -406,12 +407,15 @@ that." | |||
| 406 | (facep sym) | 407 | (facep sym) |
| 407 | (save-match-data (looking-at "[ \t\n]+face\\W"))) | 408 | (save-match-data (looking-at "[ \t\n]+face\\W"))) |
| 408 | (help-xref-button 8 'help-face sym)) | 409 | (help-xref-button 8 'help-face sym)) |
| 409 | ((and (boundp sym) (fboundp sym)) | 410 | ((and (or (boundp sym) |
| 411 | (get sym 'variable-documentation)) | ||
| 412 | (fboundp sym)) | ||
| 410 | ;; We can't intuit whether to use the | 413 | ;; We can't intuit whether to use the |
| 411 | ;; variable or function doc -- supply both. | 414 | ;; variable or function doc -- supply both. |
| 412 | (help-xref-button 8 'help-symbol sym)) | 415 | (help-xref-button 8 'help-symbol sym)) |
| 413 | ((and | 416 | ((and |
| 414 | (boundp sym) | 417 | (or (boundp sym) |
| 418 | (get sym 'variable-documentation)) | ||
| 415 | (or | 419 | (or |
| 416 | (documentation-property | 420 | (documentation-property |
| 417 | sym 'variable-documentation) | 421 | sym 'variable-documentation) |
| @@ -518,7 +522,10 @@ See `help-make-xrefs'." | |||
| 518 | ((or (memq sym '(t nil)) | 522 | ((or (memq sym '(t nil)) |
| 519 | (keywordp sym)) | 523 | (keywordp sym)) |
| 520 | nil) | 524 | nil) |
| 521 | ((and sym (boundp sym)) | 525 | ((and sym |
| 526 | (or (boundp sym) | ||
| 527 | (get sym | ||
| 528 | 'variable-documentation))) | ||
| 522 | 'help-variable)))) | 529 | 'help-variable)))) |
| 523 | (when type (help-xref-button 1 type sym))) | 530 | (when type (help-xref-button 1 type sym))) |
| 524 | (goto-char (match-end 1))) | 531 | (goto-char (match-end 1))) |
| @@ -542,7 +549,8 @@ help buffer." | |||
| 542 | ;; Don't record the current entry in the stack. | 549 | ;; Don't record the current entry in the stack. |
| 543 | (setq help-xref-stack-item nil) | 550 | (setq help-xref-stack-item nil) |
| 544 | (describe-function symbol))) | 551 | (describe-function symbol))) |
| 545 | (sdoc (when (boundp symbol) | 552 | (sdoc (when (or (boundp symbol) |
| 553 | (get symbol 'variable-documentation)) | ||
| 546 | ;; Don't record the current entry in the stack. | 554 | ;; Don't record the current entry in the stack. |
| 547 | (setq help-xref-stack-item nil) | 555 | (setq help-xref-stack-item nil) |
| 548 | (describe-variable symbol)))) | 556 | (describe-variable symbol)))) |
| @@ -639,7 +647,9 @@ For the cross-reference format, see `help-make-xrefs'." | |||
| 639 | (buffer-substring (point) | 647 | (buffer-substring (point) |
| 640 | (progn (skip-syntax-forward "w_") | 648 | (progn (skip-syntax-forward "w_") |
| 641 | (point))))))) | 649 | (point))))))) |
| 642 | (when (or (boundp sym) (fboundp sym) (facep sym)) | 650 | (when (or (boundp sym) |
| 651 | (get sym 'variable-documentation) | ||
| 652 | (fboundp sym) (facep sym)) | ||
| 643 | (help-do-xref pos #'help-xref-interned (list sym)))))) | 653 | (help-do-xref pos #'help-xref-interned (list sym)))))) |
| 644 | 654 | ||
| 645 | 655 | ||