2161 |
to match text which spans lines; this does not work reliably. While |
to match text which spans lines; this does not work reliably. While |
2162 |
@code{font-lock-fontify-buffer} handles multi-line patterns correctly, |
@code{font-lock-fontify-buffer} handles multi-line patterns correctly, |
2163 |
updating when you edit the buffer does not, since it considers text one |
updating when you edit the buffer does not, since it considers text one |
2164 |
line at a time. |
line at a time. If you have patterns that typically only span one |
2165 |
|
line but can occasionally span two or three, such as |
2166 |
|
@samp{<title>...</title>}, you can ask font-lock to be more careful by |
2167 |
|
setting @code{font-lock-multiline} to @code{t}. But it still will not |
2168 |
|
work in all cases. |
2169 |
|
|
2170 |
@node Other Font Lock Variables |
@node Other Font Lock Variables |
2171 |
@subsection Other Font Lock Variables |
@subsection Other Font Lock Variables |
2235 |
@code{font-lock-keywords} as well as adding them to this list. |
@code{font-lock-keywords} as well as adding them to this list. |
2236 |
@end defvar |
@end defvar |
2237 |
|
|
2238 |
|
@defvar font-lock-syntactic-face-function |
2239 |
|
A function to determine which face to use for a given syntactic |
2240 |
|
element (a string or a comment). The function is called with one |
2241 |
|
argument, the parse state at point returned by |
2242 |
|
@code{parse-partial-sexp}, and should return a face. The default |
2243 |
|
value returns @code{font-lock-comment-face} for comments and |
2244 |
|
@code{font-lock-string-face} for strings. |
2245 |
|
|
2246 |
|
This can be used to highlighting different kinds of strings or |
2247 |
|
comments differently. It is also sometimes abused together with |
2248 |
|
@code{font-lock-syntactic-keywords} to highlight elements that span |
2249 |
|
multiple lines, but this is too obscure to document in this manual. |
2250 |
|
@end defvar |
2251 |
|
|
2252 |
@node Levels of Font Lock |
@node Levels of Font Lock |
2253 |
@subsection Levels of Font Lock |
@subsection Levels of Font Lock |
2254 |
|
|