/[emacs]/emacs/lisp/font-lock.el
ViewVC logotype

Diff of /emacs/lisp/font-lock.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.275 by monnier, Mon Sep 19 12:08:07 2005 UTC revision 1.276 by rms, Mon Oct 10 03:25:23 2005 UTC
# Line 354  contained expressions.  You can also alt Line 354  contained expressions.  You can also alt
354  Each element in a user-level keywords list should have one of these forms:  Each element in a user-level keywords list should have one of these forms:
355    
356   MATCHER   MATCHER
357   (MATCHER . MATCH)   (MATCHER . SUBEXP)
358   (MATCHER . FACENAME)   (MATCHER . FACENAME)
359   (MATCHER . HIGHLIGHT)   (MATCHER . HIGHLIGHT)
360   (MATCHER HIGHLIGHT ...)   (MATCHER HIGHLIGHT ...)
# Line 380  word \"bar\" following the word \"anchor Line 380  word \"bar\" following the word \"anchor
380    
381  MATCH-HIGHLIGHT should be of the form:  MATCH-HIGHLIGHT should be of the form:
382    
383   (MATCH FACENAME [OVERRIDE [LAXMATCH]])   (SUBEXP FACENAME [OVERRIDE [LAXMATCH]])
384    
385  MATCH is the subexpression of MATCHER to be highlighted.  FACENAME is an  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  
387  can be modified via \\[customize].  Instead of a face, FACENAME can  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 ...)  Instead of a face, FACENAME can evaluate to a property list
389    of the form (face FACE PROP1 VAL1 PROP2 VAL2 ...)
390  in which case all the listed text-properties will be set rather than  in which case all the listed text-properties will be set rather than
391  just FACE.  In such a case, you will most likely want to put those  just FACE.  In such a case, you will most likely want to put those
392  properties in `font-lock-extra-managed-props' or to override  properties in `font-lock-extra-managed-props' or to override
# Line 395  OVERRIDE and LAXMATCH are flags.  If OVE Line 396  OVERRIDE and LAXMATCH are flags.  If OVE
396  be overwritten.  If `keep', only parts not already fontified are highlighted.  be overwritten.  If `keep', only parts not already fontified are highlighted.
397  If `prepend' or `append', existing fontification is merged with the new, in  If `prepend' or `append', existing fontification is merged with the new, in
398  which the new or existing fontification, respectively, takes precedence.  which the new or existing fontification, respectively, takes precedence.
399  If LAXMATCH is non-nil, no error is signaled if there is no MATCH in MATCHER.  If LAXMATCH is non-nil, that means don't signal an error if there is
400    no match for SUBEXP in MATCHER.
401    
402  For example, an element of the form highlights (if not already highlighted):  For example, an element of the form highlights (if not already highlighted):
403    
# Line 508  The function is called with a single par Line 510  The function is called with a single par
510  should return a face.  This is normally set via `font-lock-defaults'.")  should return a face.  This is normally set via `font-lock-defaults'.")
511    
512  (defvar font-lock-syntactic-keywords nil  (defvar font-lock-syntactic-keywords nil
513    "A list of the syntactic keywords to highlight.    "A list of the syntactic keywords to put syntax properties on.
514  Can be the list or the name of a function or variable whose value is the list.  The value can be the list itself, or the name of a function or variable
515    whose value is the list.
516    
517  See `font-lock-keywords' for a description of the form of this list;  See `font-lock-keywords' for a description of the form of this list;
518  the differences are listed below.  MATCH-HIGHLIGHT should be of the form:  only the differences are stated here.  MATCH-HIGHLIGHT should be of the form:
519    
520   (MATCH SYNTAX OVERRIDE LAXMATCH)   (SUBEXP SYNTAX OVERRIDE LAXMATCH)
521    
522  where SYNTAX can be a string (as taken by `modify-syntax-entry'), a syntax  where SYNTAX can be a string (as taken by `modify-syntax-entry'), a syntax
523  table, a cons cell (as returned by `string-to-syntax') or an expression whose  table, a cons cell (as returned by `string-to-syntax') or an expression whose
524  value is such a form.  OVERRIDE cannot be `prepend' or `append'.  value is such a form.  OVERRIDE cannot be `prepend' or `append'.
525    
526  For example, an element of the form highlights syntactically:  Here are two examples of elements of `font-lock-syntactic-keywords'
527    and what they do:
528    
529   (\"\\\\$\\\\(#\\\\)\" 1 \".\")   (\"\\\\$\\\\(#\\\\)\" 1 \".\")
530    
531   a hash character when following a dollar character, with a SYNTAX of   gives a hash character punctuation syntax (\".\") when following a
532   \".\" (meaning punctuation syntax).  Assuming that the buffer syntax table does   dollar-sign character.  Hash characters in other contexts will still
533   specify hash characters to have comment start syntax, the element will only   follow whatever the syntax table says about the hash character.
  highlight hash characters that do not follow dollar characters as comments  
  syntactically.  
534    
535   (\"\\\\('\\\\).\\\\('\\\\)\"   (\"\\\\('\\\\).\\\\('\\\\)\"
536    (1 \"\\\"\")    (1 \"\\\"\")
537    (2 \"\\\"\"))    (2 \"\\\"\"))
538    
539   both single quotes which surround a single character, with a SYNTAX of   gives a pair single-quotes, which surround a single character, a SYNTAX of
540   \"\\\"\" (meaning string quote syntax).  Assuming that the buffer syntax table   \"\\\"\" (meaning string quote syntax).  Single-quote characters in other
541   does not specify single quotes to have quote syntax, the element will only   contexts will not be affected.
  highlight single quotes of the form 'c' as strings syntactically.  
  Other forms, such as foo'bar or 'fubar', will not be highlighted as strings.  
542    
543  This is normally set via `font-lock-defaults'.")  This is normally set via `font-lock-defaults'.")
544    

Legend:
Removed from v.1.275  
changed lines
  Added in v.1.276

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26