[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: regexp does not work as documented

From: martin rudalics
Subject: Re: regexp does not work as documented
Date: Sun, 11 May 2008 09:40:51 +0200
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

> First I'll work on the hi-lock warning as I described below, then I'll
> see about detecting and doing something helpful for additional
> situations where multi-line won't work.

Think of the following pathological case: Devise a regexp to highlight
the first line of a buffer provided the buffer does not end with a
newline.  Doing this with `font-lock-multiline' hardly makes any sense.

Maybe users should classify whether a regexp they use

(1) doesn't match newlines - no `font-lock-multiline' needed,

(2) match at most n newlines in which case you should tell font-lock to
rescan from n lines before each buffer change (with large n the display
engine will suffer noticeably, mainly because font-lock has to search
for all other keywords as well), or

(3) may match more than n newlines in which case you should use an idle
timer to scan the entire buffer for any matches of such regexps and
highlight them separately.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]