diff options
| author | Richard M. Stallman | 2005-10-10 03:25:34 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2005-10-10 03:25:34 +0000 |
| commit | 9bab4985d9d5d99fac443f0d5a3a1dd47f28fc1a (patch) | |
| tree | 97f0a385a337d0894c72039713f7f9809b24554c | |
| parent | cc8556d9763db3924cabcf8f874e76bf988eb4ae (diff) | |
| download | emacs-9bab4985d9d5d99fac443f0d5a3a1dd47f28fc1a.tar.gz emacs-9bab4985d9d5d99fac443f0d5a3a1dd47f28fc1a.zip | |
(font-lock-syntactic-keywords, font-lock-keywords): Doc fixes.
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/font-lock.el | 45 |
2 files changed, 26 insertions, 22 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 60e1924206d..5ae269835f9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2005-10-09 Richard M. Stallman <rms@gnu.org> | 1 | 2005-10-09 Richard M. Stallman <rms@gnu.org> |
| 2 | 2 | ||
| 3 | * font-lock.el (font-lock-syntactic-keywords) | ||
| 4 | (font-lock-keywords): Doc fixes. | ||
| 5 | |||
| 3 | * textmodes/flyspell.el (flyspell-external-point-words): Simplify | 6 | * textmodes/flyspell.el (flyspell-external-point-words): Simplify |
| 4 | logic, and don't try to check for consecutive appearances of one | 7 | logic, and don't try to check for consecutive appearances of one |
| 5 | incorrect word. | 8 | incorrect word. |
diff --git a/lisp/font-lock.el b/lisp/font-lock.el index c4228c2841d..3d2d0fe6ef0 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el | |||
| @@ -354,7 +354,7 @@ contained expressions. You can also alter it by calling | |||
| 354 | Each element in a user-level keywords list should have one of these forms: | 354 | Each element in a user-level keywords list should have one of these forms: |
| 355 | 355 | ||
| 356 | MATCHER | 356 | MATCHER |
| 357 | (MATCHER . MATCH) | 357 | (MATCHER . SUBEXP) |
| 358 | (MATCHER . FACENAME) | 358 | (MATCHER . FACENAME) |
| 359 | (MATCHER . HIGHLIGHT) | 359 | (MATCHER . HIGHLIGHT) |
| 360 | (MATCHER HIGHLIGHT ...) | 360 | (MATCHER HIGHLIGHT ...) |
| @@ -380,12 +380,13 @@ word \"bar\" following the word \"anchor\" then MATCH-ANCHORED may be required. | |||
| 380 | 380 | ||
| 381 | MATCH-HIGHLIGHT should be of the form: | 381 | MATCH-HIGHLIGHT should be of the form: |
| 382 | 382 | ||
| 383 | (MATCH FACENAME [OVERRIDE [LAXMATCH]]) | 383 | (SUBEXP FACENAME [OVERRIDE [LAXMATCH]]) |
| 384 | 384 | ||
| 385 | MATCH is the subexpression of MATCHER to be highlighted. FACENAME is an | 385 | SUBEXP is the number of the subexpression of MATCHER to be highlighted. |
| 386 | expression whose value is the face name to use. Face default attributes | 386 | |
| 387 | can be modified via \\[customize]. Instead of a face, FACENAME can | 387 | FACENAME is an expression whose value is the face name to use. |
| 388 | evaluate to a property list of the form (face FACE PROP1 VAL1 PROP2 VAL2 ...) | 388 | Instead of a face, FACENAME can evaluate to a property list |
| 389 | of the form (face FACE PROP1 VAL1 PROP2 VAL2 ...) | ||
| 389 | in which case all the listed text-properties will be set rather than | 390 | in which case all the listed text-properties will be set rather than |
| 390 | just FACE. In such a case, you will most likely want to put those | 391 | just FACE. In such a case, you will most likely want to put those |
| 391 | properties in `font-lock-extra-managed-props' or to override | 392 | properties in `font-lock-extra-managed-props' or to override |
| @@ -395,7 +396,8 @@ OVERRIDE and LAXMATCH are flags. If OVERRIDE is t, existing fontification can | |||
| 395 | be overwritten. If `keep', only parts not already fontified are highlighted. | 396 | be overwritten. If `keep', only parts not already fontified are highlighted. |
| 396 | If `prepend' or `append', existing fontification is merged with the new, in | 397 | If `prepend' or `append', existing fontification is merged with the new, in |
| 397 | which the new or existing fontification, respectively, takes precedence. | 398 | which the new or existing fontification, respectively, takes precedence. |
| 398 | If LAXMATCH is non-nil, no error is signaled if there is no MATCH in MATCHER. | 399 | If LAXMATCH is non-nil, that means don't signal an error if there is |
| 400 | no match for SUBEXP in MATCHER. | ||
| 399 | 401 | ||
| 400 | For example, an element of the form highlights (if not already highlighted): | 402 | For example, an element of the form highlights (if not already highlighted): |
| 401 | 403 | ||
| @@ -508,36 +510,35 @@ The function is called with a single parameter (the state as returned by | |||
| 508 | should return a face. This is normally set via `font-lock-defaults'.") | 510 | should return a face. This is normally set via `font-lock-defaults'.") |
| 509 | 511 | ||
| 510 | (defvar font-lock-syntactic-keywords nil | 512 | (defvar font-lock-syntactic-keywords nil |
| 511 | "A list of the syntactic keywords to highlight. | 513 | "A list of the syntactic keywords to put syntax properties on. |
| 512 | Can be the list or the name of a function or variable whose value is the list. | 514 | The value can be the list itself, or the name of a function or variable |
| 515 | whose value is the list. | ||
| 516 | |||
| 513 | See `font-lock-keywords' for a description of the form of this list; | 517 | See `font-lock-keywords' for a description of the form of this list; |
| 514 | the differences are listed below. MATCH-HIGHLIGHT should be of the form: | 518 | only the differences are stated here. MATCH-HIGHLIGHT should be of the form: |
| 515 | 519 | ||
| 516 | (MATCH SYNTAX OVERRIDE LAXMATCH) | 520 | (SUBEXP SYNTAX OVERRIDE LAXMATCH) |
| 517 | 521 | ||
| 518 | where SYNTAX can be a string (as taken by `modify-syntax-entry'), a syntax | 522 | where SYNTAX can be a string (as taken by `modify-syntax-entry'), a syntax |
| 519 | table, a cons cell (as returned by `string-to-syntax') or an expression whose | 523 | table, a cons cell (as returned by `string-to-syntax') or an expression whose |
| 520 | value is such a form. OVERRIDE cannot be `prepend' or `append'. | 524 | value is such a form. OVERRIDE cannot be `prepend' or `append'. |
| 521 | 525 | ||
| 522 | For example, an element of the form highlights syntactically: | 526 | Here are two examples of elements of `font-lock-syntactic-keywords' |
| 527 | and what they do: | ||
| 523 | 528 | ||
| 524 | (\"\\\\$\\\\(#\\\\)\" 1 \".\") | 529 | (\"\\\\$\\\\(#\\\\)\" 1 \".\") |
| 525 | 530 | ||
| 526 | a hash character when following a dollar character, with a SYNTAX of | 531 | gives a hash character punctuation syntax (\".\") when following a |
| 527 | \".\" (meaning punctuation syntax). Assuming that the buffer syntax table does | 532 | dollar-sign character. Hash characters in other contexts will still |
| 528 | specify hash characters to have comment start syntax, the element will only | 533 | follow whatever the syntax table says about the hash character. |
| 529 | highlight hash characters that do not follow dollar characters as comments | ||
| 530 | syntactically. | ||
| 531 | 534 | ||
| 532 | (\"\\\\('\\\\).\\\\('\\\\)\" | 535 | (\"\\\\('\\\\).\\\\('\\\\)\" |
| 533 | (1 \"\\\"\") | 536 | (1 \"\\\"\") |
| 534 | (2 \"\\\"\")) | 537 | (2 \"\\\"\")) |
| 535 | 538 | ||
| 536 | both single quotes which surround a single character, with a SYNTAX of | 539 | gives a pair single-quotes, which surround a single character, a SYNTAX of |
| 537 | \"\\\"\" (meaning string quote syntax). Assuming that the buffer syntax table | 540 | \"\\\"\" (meaning string quote syntax). Single-quote characters in other |
| 538 | does not specify single quotes to have quote syntax, the element will only | 541 | contexts will not be affected. |
| 539 | highlight single quotes of the form 'c' as strings syntactically. | ||
| 540 | Other forms, such as foo'bar or 'fubar', will not be highlighted as strings. | ||
| 541 | 542 | ||
| 542 | This is normally set via `font-lock-defaults'.") | 543 | This is normally set via `font-lock-defaults'.") |
| 543 | 544 | ||