diff options
| author | Stefan Monnier | 2001-05-11 20:33:15 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2001-05-11 20:33:15 +0000 |
| commit | 558371ba97c5936cde40bd049941635fd9efff6c (patch) | |
| tree | b348898eef7c24c9be74a511c666b8efa4da37da | |
| parent | 5c6d31a48f29aa04cfae76f8f3a2593b77e7cfa7 (diff) | |
| download | emacs-558371ba97c5936cde40bd049941635fd9efff6c.tar.gz emacs-558371ba97c5936cde40bd049941635fd9efff6c.zip | |
Docstring fixes.
| -rw-r--r-- | lisp/font-lock.el | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/lisp/font-lock.el b/lisp/font-lock.el index ef35b43dd9a..228359f3751 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el | |||
| @@ -353,12 +353,17 @@ Each element should have one of these forms: | |||
| 353 | (MATCHER HIGHLIGHT ...) | 353 | (MATCHER HIGHLIGHT ...) |
| 354 | (eval . FORM) | 354 | (eval . FORM) |
| 355 | 355 | ||
| 356 | where HIGHLIGHT should be either MATCH-HIGHLIGHT or MATCH-ANCHORED. | 356 | where MATCHER can be either the regexp to search for, or the function name to |
| 357 | call to make the search (called with one argument, the limit of the search) and | ||
| 358 | return non-nil if it succeeds (and set `match-data' appropriately). | ||
| 359 | MATCHER regexps can be generated via the function `regexp-opt'. | ||
| 357 | 360 | ||
| 358 | FORM is an expression, whose value should be a keyword element, evaluated when | 361 | FORM is an expression, whose value should be a keyword element, evaluated when |
| 359 | the keyword is (first) used in a buffer. This feature can be used to provide a | 362 | the keyword is (first) used in a buffer. This feature can be used to provide a |
| 360 | keyword that can only be generated when Font Lock mode is actually turned on. | 363 | keyword that can only be generated when Font Lock mode is actually turned on. |
| 361 | 364 | ||
| 365 | HIGHLIGHT should be either MATCH-HIGHLIGHT or MATCH-ANCHORED. | ||
| 366 | |||
| 362 | For highlighting single items, for example each instance of the word \"foo\", | 367 | For highlighting single items, for example each instance of the word \"foo\", |
| 363 | typically only MATCH-HIGHLIGHT is required. | 368 | typically only MATCH-HIGHLIGHT is required. |
| 364 | However, if an item or (typically) items are to be highlighted following the | 369 | However, if an item or (typically) items are to be highlighted following the |
| @@ -369,13 +374,14 @@ MATCH-HIGHLIGHT should be of the form: | |||
| 369 | 374 | ||
| 370 | (MATCH FACENAME OVERRIDE LAXMATCH) | 375 | (MATCH FACENAME OVERRIDE LAXMATCH) |
| 371 | 376 | ||
| 372 | where MATCHER can be either the regexp to search for, or the function name to | 377 | MATCH is the subexpression of MATCHER to be highlighted. FACENAME is an |
| 373 | call to make the search (called with one argument, the limit of the search) and | 378 | expression whose value is the face name to use. Face default attributes |
| 374 | return non-nil if it succeeds (and set `match-data' appropriately). | 379 | can be modified via \\[customize]. Instead of a face, FACENAME can |
| 375 | MATCHER regexps can be generated via the function `regexp-opt'. MATCH is | 380 | evaluate to a property list of the form (face VAL1 PROP2 VAL2 PROP3 VAL3 ...) |
| 376 | the subexpression of MATCHER to be highlighted. FACENAME is an expression | 381 | in which case all the listed text-properties will be set rather than |
| 377 | whose value is the face name to use. Face default attributes can be | 382 | just `face'. In such a case, you will most likely want to put those |
| 378 | modified via \\[customize]. | 383 | properties in `font-lock-extra-managed-props' or to override |
| 384 | `font-lock-unfontify-region-function'. | ||
| 379 | 385 | ||
| 380 | OVERRIDE and LAXMATCH are flags. If OVERRIDE is t, existing fontification can | 386 | OVERRIDE and LAXMATCH are flags. If OVERRIDE is t, existing fontification can |
| 381 | be overwritten. If `keep', only parts not already fontified are highlighted. | 387 | be overwritten. If `keep', only parts not already fontified are highlighted. |
| @@ -793,6 +799,10 @@ For example: | |||
| 793 | adds two fontification patterns for C mode, to fontify `FIXME:' words, even in | 799 | adds two fontification patterns for C mode, to fontify `FIXME:' words, even in |
| 794 | comments, and to fontify `and', `or' and `not' words as keywords. | 800 | comments, and to fontify `and', `or' and `not' words as keywords. |
| 795 | 801 | ||
| 802 | When used from an elisp package (such as a minor mode), it is recommended | ||
| 803 | to use nil for MODE (and place the call in a loop or on a hook) to avoid | ||
| 804 | subtle problems due to details of the implementation. | ||
| 805 | |||
| 796 | Note that some modes have specialised support for additional patterns, e.g., | 806 | Note that some modes have specialised support for additional patterns, e.g., |
| 797 | see the variables `c-font-lock-extra-types', `c++-font-lock-extra-types', | 807 | see the variables `c-font-lock-extra-types', `c++-font-lock-extra-types', |
| 798 | `objc-font-lock-extra-types' and `java-font-lock-extra-types'." | 808 | `objc-font-lock-extra-types' and `java-font-lock-extra-types'." |
| @@ -870,7 +880,11 @@ see the variables `c-font-lock-extra-types', `c++-font-lock-extra-types', | |||
| 870 | "Remove highlighting KEYWORDS for MODE. | 880 | "Remove highlighting KEYWORDS for MODE. |
| 871 | 881 | ||
| 872 | MODE should be a symbol, the major mode command name, such as `c-mode' | 882 | MODE should be a symbol, the major mode command name, such as `c-mode' |
| 873 | or nil. If nil, highlighting keywords are removed for the current buffer." | 883 | or nil. If nil, highlighting keywords are removed for the current buffer. |
| 884 | |||
| 885 | When used from an elisp package (such as a minor mode), it is recommended | ||
| 886 | to use nil for MODE (and place the call in a loop or on a hook) to avoid | ||
| 887 | subtle problems due to details of the implementation." | ||
| 874 | (cond (mode | 888 | (cond (mode |
| 875 | ;; Remove one keyword at the time. | 889 | ;; Remove one keyword at the time. |
| 876 | (dolist (keyword keywords) | 890 | (dolist (keyword keywords) |
| @@ -1607,7 +1621,6 @@ START should be at the beginning of a line." | |||
| 1607 | (re-search-forward matcher end t) | 1621 | (re-search-forward matcher end t) |
| 1608 | (funcall matcher end))) | 1622 | (funcall matcher end))) |
| 1609 | (when (and font-lock-multiline | 1623 | (when (and font-lock-multiline |
| 1610 | (match-beginning 0) | ||
| 1611 | (>= (point) | 1624 | (>= (point) |
| 1612 | (save-excursion (goto-char (match-beginning 0)) | 1625 | (save-excursion (goto-char (match-beginning 0)) |
| 1613 | (forward-line 1) (point)))) | 1626 | (forward-line 1) (point)))) |