comparison lispref/modes.texi @ 74083:a71f63e8ff3f

Rephrase some font-lock-multiline text.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sun, 19 Nov 2006 19:27:29 +0000
parents 86946679c343
children cedd7f653426 dbe3f29e61d6
comparison
equal deleted inserted replaced
74082:d34e01c317dc 74083:a71f63e8ff3f
3041 There are three ways to ensure correct identification of multiline 3041 There are three ways to ensure correct identification of multiline
3042 constructs: 3042 constructs:
3043 3043
3044 @itemize 3044 @itemize
3045 @item 3045 @item
3046 Place a @code{font-lock-multiline}
3047 property on the construct when it is added to the buffer.
3048 @item
3049 Use @code{font-lock-fontify-region-function} hook to extend the scan
3050 so that the scanned text never starts or ends in the middle of a
3051 multiline construct.
3052 @item
3053 Add a function to @code{font-lock-extend-region-functions} that does 3046 Add a function to @code{font-lock-extend-region-functions} that does
3054 the @emph{identification} and extends the scan so that the scanned 3047 the @emph{identification} and extends the scan so that the scanned
3055 text never starts or ends in the middle of a multiline construct. 3048 text never starts or ends in the middle of a multiline construct.
3049 @item
3050 Use the @code{font-lock-fontify-region-function} hook similarly to
3051 extend the scan so that the scanned text never starts or ends in the
3052 middle of a multiline construct.
3053 @item
3054 Somehow identify the multiline construct right when it gets inserted
3055 into the buffer (or at any point after that but before font-lock
3056 tries to highlight it), and mark it with a @code{font-lock-multiline}
3057 which will instruct font-lock not to start or end the scan in the
3058 middle of the construct.
3056 @end itemize 3059 @end itemize
3057 3060
3058 There are three ways to do rehighlighting of multiline constructs: 3061 There are three ways to do rehighlighting of multiline constructs:
3059 3062
3060 @itemize 3063 @itemize
3061 @item 3064 @item
3062 Place a @code{font-lock-multiline} property on the construct. This 3065 Place a @code{font-lock-multiline} property on the construct. This
3063 will rehighlight the whole construct if any part of it is changed. In 3066 will rehighlight the whole construct if any part of it is changed. In
3064 some cases you can do this automatically by setting the 3067 some cases you can do this automatically by setting the
3065 @code{font-lock-multiline} variable. 3068 @code{font-lock-multiline} variable, which see.
3066 @item 3069 @item
3067 Use @code{jit-lock-contextually}. This will only rehighlight the part 3070 Rely on @code{jit-lock-contextually}. This will only rehighlight the part
3068 of the construct that follows the actual change, and will do it after 3071 of the construct that follows the actual change, and will do it after
3069 a short delay. This only works if the highlighting of the various 3072 a short delay. This only works if the highlighting of the various
3070 parts of your multiline construct never depends on text in subsequent 3073 parts of your multiline construct never depends on text in subsequent
3071 lines. Since @code{jit-lock-contextually} is activated by default, 3074 lines. Since @code{jit-lock-contextually} is activated by default,
3072 this can be an attractive solution. 3075 this can be an attractive solution.