emacs-devel
[Top][All Lists]
Advanced

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

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


From: Ralf Angeli
Subject: Re: address@hidden: C++-mode: Syntax highlighting: wrong color for function identifier depending on the kind of whitespace that follows]
Date: Tue, 14 Feb 2006 22:12:45 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

* Stefan Monnier (2006-02-14) writes:

>> Hm, how would it be possible to detect closing tags in this case?
>> Maybe with an initial search for these tags across the region to be
>> fontified.  Or on a case by case basis for every closing tag which is
>> encountered during fontication of the region?  This would be rather
>> inefficient compared to using a hook to be called before
>> `font-lock-after-change-function'.  But maybe you are thinking about
>> something completely different.
>
> Huh?  I must be missing something: I don't see what's different between
> font-lock-after-change-function and font-lock-default-fontify-region, other
> than the fact that they're called at different moments.

You are right, it is not /that/ different.  However, the proposed
hook, like the other functions in `after-change-functions', will get
the begin and end of the changed region which will mostly be smaller
than the region passed to `font-lock-default-fontify-region' and the
end of the region will be nearer to the point I am interested in.  So
detecting an ending tag with something like (search-backward ">>" (1-
beg) t) will be faster.  I am not sure, however, if the solution with
`font-lock-default-fontify-region' is more efficient overall because
the function might not be called as often as a hook in
`after-change-functions'.

-- 
Ralf




reply via email to

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