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: Alan Mackenzie
Subject: Re: address@hidden: C++-mode: Syntax highlighting: wrong color for function identifier depending on the kind of whitespace that follows]
Date: Wed, 15 Feb 2006 20:56:25 +0000 (GMT)

Hi, Martin!

On Tue, 14 Feb 2006, martin rudalics wrote:

> > Huh?  Why would window-start matter?

>Because fontification triggered by redisplay will fontify the displayed
>area first.  `jit-lock-context-fontify' would reset the fontified
>property for everything after the "<<".  Redisplay now would trigger
>refontification below window-start.  It won't care about the "<<".

> > I'm not sure which hook you're talking about.  The code I wrote above is
> > meant to be used on font-lock-keywords when finding a ">>".

>The hook that would trigger searching for the "<<" after a buffer
>change, `before-font-lock-after-change-function' or whatever it will be
>called.  I simply believe that searching some 1000 characters every time
>you type one single character may slow down editing noticeably.  But
>maybe I didn't understand the scenario correctly.

Surely it would be possible to arrange for this searching to be done only
when one of these delimiters is inserted or deleted?

In a before-change function, you check whether or not a change is
happening around a ">>", ">", "<" or "<<", and record this in some
variables.  In the after-change you see if a delimiter has actually been
inserted or deleted.  Only then need you search.  Since this searching
will be done only rarely, you probably don't need to worry about
searching even the entire buffer.

-- 
Alan.






reply via email to

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