diff options
| author | Luc Teirlinck | 2003-10-19 03:58:43 +0000 |
|---|---|---|
| committer | Luc Teirlinck | 2003-10-19 03:58:43 +0000 |
| commit | 040b2fa358d70e6013a6e6e1dcacdf435c9369dd (patch) | |
| tree | 3ec151f116996fa94a0bcf2f1782e11a2efe5e9c /lisp/help-mode.el | |
| parent | a4a6aad0df5b7a6cafc34bc3a5418180e508a79f (diff) | |
| download | emacs-040b2fa358d70e6013a6e6e1dcacdf435c9369dd.tar.gz emacs-040b2fa358d70e6013a6e6e1dcacdf435c9369dd.zip | |
(help-xref-symbol-regexp): Treat newlines as whitespace.
(help-make-xrefs): Only make cross-references for faces if preceded or
followed by the word `face'. Do not make a cross-reference for
variables without variable documentation, unless preceded by the word
`variable'. Update doc string accordingly.
Diffstat (limited to 'lisp/help-mode.el')
| -rw-r--r-- | lisp/help-mode.el | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/lisp/help-mode.el b/lisp/help-mode.el index 4ef3072ca53..8e33b08bd42 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el | |||
| @@ -213,7 +213,8 @@ Commands: | |||
| 213 | "\\(function\\|command\\)\\|" | 213 | "\\(function\\|command\\)\\|" |
| 214 | "\\(face\\)\\|" | 214 | "\\(face\\)\\|" |
| 215 | "\\(symbol\\)\\|" | 215 | "\\(symbol\\)\\|" |
| 216 | "\\(source \\(?:code \\)?\\(?:of\\|for\\)\\)\\)\\s-+\\)?" | 216 | "\\(source \\(?:code \\)?\\(?:of\\|for\\)\\)\\)" |
| 217 | "[ \t\n]+\\)?" | ||
| 217 | ;; Note starting with word-syntax character: | 218 | ;; Note starting with word-syntax character: |
| 218 | "`\\(\\sw\\(\\sw\\|\\s_\\)+\\)'")) | 219 | "`\\(\\sw\\(\\sw\\|\\s_\\)+\\)'")) |
| 219 | "Regexp matching doc string references to symbols. | 220 | "Regexp matching doc string references to symbols. |
| @@ -278,7 +279,10 @@ Find cross-reference information in a buffer and activate such cross | |||
| 278 | references for selection with `help-follow'. Cross-references have | 279 | references for selection with `help-follow'. Cross-references have |
| 279 | the canonical form `...' and the type of reference may be | 280 | the canonical form `...' and the type of reference may be |
| 280 | disambiguated by the preceding word(s) used in | 281 | disambiguated by the preceding word(s) used in |
| 281 | `help-xref-symbol-regexp'. | 282 | `help-xref-symbol-regexp'. Faces only get cross-referenced if |
| 283 | preceded or followed by the word `face'. Variables without | ||
| 284 | variable documentation do not get cross-referenced, unless | ||
| 285 | preceded by the word `variable'. | ||
| 282 | 286 | ||
| 283 | If the variable `help-xref-mule-regexp' is non-nil, find also | 287 | If the variable `help-xref-mule-regexp' is non-nil, find also |
| 284 | cross-reference information related to multilingual environment | 288 | cross-reference information related to multilingual environment |
| @@ -342,11 +346,11 @@ that." | |||
| 342 | (sym (intern-soft data))) | 346 | (sym (intern-soft data))) |
| 343 | (if sym | 347 | (if sym |
| 344 | (cond | 348 | (cond |
| 345 | ((match-string 3) ; `variable' &c | 349 | ((match-string 3) ; `variable' &c |
| 346 | (and (boundp sym) ; `variable' doesn't ensure | 350 | (and (boundp sym) ; `variable' doesn't ensure |
| 347 | ; it's actually bound | 351 | ; it's actually bound |
| 348 | (help-xref-button 8 'help-variable sym))) | 352 | (help-xref-button 8 'help-variable sym))) |
| 349 | ((match-string 4) ; `function' &c | 353 | ((match-string 4) ; `function' &c |
| 350 | (and (fboundp sym) ; similarly | 354 | (and (fboundp sym) ; similarly |
| 351 | (help-xref-button 8 'help-function sym))) | 355 | (help-xref-button 8 'help-function sym))) |
| 352 | ((match-string 5) ; `face' | 356 | ((match-string 5) ; `face' |
| @@ -354,23 +358,27 @@ that." | |||
| 354 | (help-xref-button 8 'help-face sym))) | 358 | (help-xref-button 8 'help-face sym))) |
| 355 | ((match-string 6)) ; nothing for `symbol' | 359 | ((match-string 6)) ; nothing for `symbol' |
| 356 | ((match-string 7) | 360 | ((match-string 7) |
| 357 | ;; this used: | 361 | ;;; this used: |
| 358 | ;; #'(lambda (arg) | 362 | ;;; #'(lambda (arg) |
| 359 | ;; (let ((location | 363 | ;;; (let ((location |
| 360 | ;; (find-function-noselect arg))) | 364 | ;;; (find-function-noselect arg))) |
| 361 | ;; (pop-to-buffer (car location)) | 365 | ;;; (pop-to-buffer (car location)) |
| 362 | ;; (goto-char (cdr location)))) | 366 | ;;; (goto-char (cdr location)))) |
| 363 | (help-xref-button 8 'help-function-def sym)) | 367 | (help-xref-button 8 'help-function-def sym)) |
| 364 | ((and (boundp sym) (fboundp sym)) | 368 | ((and (boundp sym) (fboundp sym)) |
| 365 | ;; We can't intuit whether to use the | 369 | ;; We can't intuit whether to use the |
| 366 | ;; variable or function doc -- supply both. | 370 | ;; variable or function doc -- supply both. |
| 367 | (help-xref-button 8 'help-symbol sym)) | 371 | (help-xref-button 8 'help-symbol sym)) |
| 368 | ((boundp sym) | 372 | ((and |
| 373 | (boundp sym) | ||
| 374 | (documentation-property sym | ||
| 375 | 'variable-documentation)) | ||
| 369 | (help-xref-button 8 'help-variable sym)) | 376 | (help-xref-button 8 'help-variable sym)) |
| 370 | ((fboundp sym) | 377 | ((fboundp sym) |
| 371 | (help-xref-button 8 'help-function sym)) | 378 | (help-xref-button 8 'help-function sym)) |
| 372 | ((facep sym) | 379 | ((facep sym) |
| 373 | (help-xref-button 8 'help-face sym))))))) | 380 | (if (save-match-data (looking-at "[ \t\n]+face\\W")) |
| 381 | (help-xref-button 8 'help-face sym)))))))) | ||
| 374 | ;; An obvious case of a key substitution: | 382 | ;; An obvious case of a key substitution: |
| 375 | (save-excursion | 383 | (save-excursion |
| 376 | (while (re-search-forward | 384 | (while (re-search-forward |