[Top][All Lists]

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

Re: address@hidden: C++-mode: Syntax highlighting: wrong color for funct

From: Alan Mackenzie
Subject: Re: address@hidden: C++-mode: Syntax highlighting: wrong color for function identifier depending on the kind of whitespace that follows]
Date: Thu, 16 Feb 2006 15:12:31 +0000 (GMT)

Hi, Ralf!

On Thu, 16 Feb 2006, Ralf Angeli wrote:

>* Alan Mackenzie (2006-02-16) writes:

>> Hi, Ralf!

>> On Wed, 5 Feb 2006, Ralf Angeli wrote:

>>>This is all well and good, but in contrast to the after-change hook, a
>>>hook in `font-lock-default-fontify-region' could not only adjust the
>>>region after a change but also during fontification by chunks as done
>>>by jit-lock.  (That's an advantage I haven't noticed before.)

>> That is horrible.  f-l-d-f-r currently fontifies the region requested
>> by the caller, not a different region that Font Lock finds more
>> convenient.

>As Stefan already pointed out this is not the case because the region
>may be extended if `font-lock-multiline' is activated.

>> If we change its functionality, something somewhere will surely break.

>>>Following your reasoning of separating the determination of the region
>>>to be fontified from the fontification itself would require that
>>>jit-lock determines the chunks to be fontified more intelligently.

>> I don't follow that.  There are several different ways that jit-lock
>> determines its chunks.  There's after-change, after-scrolling, stealth,
>> at least.  I don't see why determining a jit-lock after-change region
>> need have anything to do with determining an after-scrolling or stealth
>> region.

>I was referring to stealth fontification during which jit-lock
>fontifies chunks of the size determined by `jit-lock-chunk-size' one
>after another.  If the start of one of those chunks is located inside
>of a "<<...>>" construct an after-change hook will not let me extend
>the region backwards to the starting tag in that case because there
>hasn't happened a change.

OK, I've got you now!  It sounds like jit-lock perhaps isn't really the
right strategy for mark-up modes.  But it seems like a hook is required
in the jit-lock stealth bit.  This is surely needed as _well_ as the
after-change hook that expands the region, not instead of it.

For example, if a change were the insertion of a ">> .... <<", the region
to fontify would include some text before the new insertion.  The
after-change-expand-region hook would detect this by using information
recorded by a before-change-function.  AWK Mode uses this stragem.  A
stealth-expand-region hook would scan back to the ">>", and stop.



reply via email to

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