>>>> "Hrvoje" == Hrvoje Niksic
<hniksic(a)srce.hr> writes:
Hrvoje> Jan Vroonhof <vroonhof(a)math.ethz.ch> writes:
> Why is font-lock using text-properties anyway? Isn't what it
> does much more naturally mapped on extents.
Hrvoje> Not really (although it may look that way at the start).
Hrvoje> The font-lock code wants to apply certain properties to
Hrvoje> parts of the buffer, merging or breaking the extents as
Hrvoje> needed. This is exactly what the text-properties are for.
Could you be more specific? The documentation says something quite
different: text-properties are for attaching properties to characters
rather than intervals. That seems like exactly the _wrong_ thing to
do with strings and comments, both of which should be locked up in an
unbreakable (from the point of view of font-lock) extent once
identified; the individual characters in them should never be
considered "locally".
OTOH, I don't see why splitting an extent or merging neighboring
extents (which should be constant time, with relatively high overhead
I suppose) should be more efficient than iterating over a (possibly
lengthy) interval of characters (linear time but possibly lower
overhead, depending on the implementation, although I find it hard to
see why it would be necessarily much less than for extents).
--
University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Institute of Policy and Planning Sciences Tel/fax: +1 (298) 53-5091