aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2005-10-10 03:25:34 +0000
committerRichard M. Stallman2005-10-10 03:25:34 +0000
commit9bab4985d9d5d99fac443f0d5a3a1dd47f28fc1a (patch)
tree97f0a385a337d0894c72039713f7f9809b24554c
parentcc8556d9763db3924cabcf8f874e76bf988eb4ae (diff)
downloademacs-9bab4985d9d5d99fac443f0d5a3a1dd47f28fc1a.tar.gz
emacs-9bab4985d9d5d99fac443f0d5a3a1dd47f28fc1a.zip
(font-lock-syntactic-keywords, font-lock-keywords): Doc fixes.
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/font-lock.el45
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 @@
12005-10-09 Richard M. Stallman <rms@gnu.org> 12005-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
354Each element in a user-level keywords list should have one of these forms: 354Each 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
381MATCH-HIGHLIGHT should be of the form: 381MATCH-HIGHLIGHT should be of the form:
382 382
383 (MATCH FACENAME [OVERRIDE [LAXMATCH]]) 383 (SUBEXP FACENAME [OVERRIDE [LAXMATCH]])
384 384
385MATCH is the subexpression of MATCHER to be highlighted. FACENAME is an 385SUBEXP is the number of the subexpression of MATCHER to be highlighted.
386expression whose value is the face name to use. Face default attributes 386
387can be modified via \\[customize]. Instead of a face, FACENAME can 387FACENAME is an expression whose value is the face name to use.
388evaluate to a property list of the form (face FACE PROP1 VAL1 PROP2 VAL2 ...) 388Instead of a face, FACENAME can evaluate to a property list
389of the form (face FACE PROP1 VAL1 PROP2 VAL2 ...)
389in which case all the listed text-properties will be set rather than 390in which case all the listed text-properties will be set rather than
390just FACE. In such a case, you will most likely want to put those 391just FACE. In such a case, you will most likely want to put those
391properties in `font-lock-extra-managed-props' or to override 392properties 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
395be overwritten. If `keep', only parts not already fontified are highlighted. 396be overwritten. If `keep', only parts not already fontified are highlighted.
396If `prepend' or `append', existing fontification is merged with the new, in 397If `prepend' or `append', existing fontification is merged with the new, in
397which the new or existing fontification, respectively, takes precedence. 398which the new or existing fontification, respectively, takes precedence.
398If LAXMATCH is non-nil, no error is signaled if there is no MATCH in MATCHER. 399If LAXMATCH is non-nil, that means don't signal an error if there is
400no match for SUBEXP in MATCHER.
399 401
400For example, an element of the form highlights (if not already highlighted): 402For 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
508should return a face. This is normally set via `font-lock-defaults'.") 510should 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.
512Can be the list or the name of a function or variable whose value is the list. 514The value can be the list itself, or the name of a function or variable
515whose value is the list.
516
513See `font-lock-keywords' for a description of the form of this list; 517See `font-lock-keywords' for a description of the form of this list;
514the differences are listed below. MATCH-HIGHLIGHT should be of the form: 518only 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
518where SYNTAX can be a string (as taken by `modify-syntax-entry'), a syntax 522where SYNTAX can be a string (as taken by `modify-syntax-entry'), a syntax
519table, a cons cell (as returned by `string-to-syntax') or an expression whose 523table, a cons cell (as returned by `string-to-syntax') or an expression whose
520value is such a form. OVERRIDE cannot be `prepend' or `append'. 524value is such a form. OVERRIDE cannot be `prepend' or `append'.
521 525
522For example, an element of the form highlights syntactically: 526Here are two examples of elements of `font-lock-syntactic-keywords'
527and 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
542This is normally set via `font-lock-defaults'.") 543This is normally set via `font-lock-defaults'.")
543 544