[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Font-lock decides function call is function declaration in C+ +
From: |
Alan Mackenzie |
Subject: |
Re: Font-lock decides function call is function declaration in C+ + |
Date: |
11 Feb 2007 18:40:53 +0100 |
Date: |
Sun, 11 Feb 2007 18:55:23 +0000 |
User-agent: |
Mutt/1.5.9i |
Hi, Chong!
On Fri, Feb 09, 2007 at 04:25:21PM -0500, Chong Yidong wrote:
> Alan Mackenzie <address@hidden> writes:
> I think the problem is that when the buffer is in the state
> foo
> bar ();
> foo looks like a type, so it is inserted in the cache variable
> c-found-types.
Exactly! Thanks for that.
> When you add the "()":
> foo()
> bar();
> this guess is no longer valid, but foo is not removed from
> c-found-types. Therefore, when you insert the final ";",
> foo();
> bar();
> the call to foo(); is highlighted as though it were a constructor.
> Note that if you do M-: (c-clear-found-types) prior to inserting the
> final ";", the misfontification does not occur.
> I don't know what the Right Fix is, however.
Once a variable has been inserted into c-found-types, it will stay there
almost for ever; it will stay there until re-fontification is done from
BOB (I'm not sure whether or not that also means (point-min) on a
narrowed buffer). This permanence seems to be the fundamental problem.
To Simon: Sorry about my saying that "M-o M-o will clear the spurious
font-lock-type-face". It only does that when point is within 16 lines of
BOB. :-(
I think a solution might be to remove "foo" from c-found-types whenever
text is inserted/deleted in the vicinity of "foo\n bar ();" which
syntactically destroys its status as a type identifier. I'll need to
think a lot more about this.
--
Alan.
- Re: Font-lock decides function call is function declaration in C+ +, Chong Yidong, 2007/02/02
- RE: Font-lock decides function call is function declaration in C+ +, Marshall, Simon, 2007/02/05
- Re: Font-lock decides function call is function declaration in C+ +, Chong Yidong, 2007/02/05
- Re: Font-lock decides function call is function declaration in C+ +, Alan Mackenzie, 2007/02/07
- Re: Font-lock decides function call is function declaration in C+ +, Chong Yidong, 2007/02/09
- Re: Font-lock decides function call is function declaration in C+ +,
Alan Mackenzie <=
- Re: Font-lock decides function call is function declaration in C+ +, Stefan Monnier, 2007/02/11
- Re: Font-lock decides function call is function declaration in C+ +, Chong Yidong, 2007/02/11
- Re: Font-lock decides function call is function declaration in C+ +, Stefan Monnier, 2007/02/11
- Re: Font-lock decides function call is function declaration in C+ +, Alan Mackenzie, 2007/02/12
Re: Font-lock decides function call is function declaration in C+ + - embryonic solution., Alan Mackenzie, 2007/02/22
RE: Font-lock decides function call is function declaration in C+ +, Marshall, Simon, 2007/02/09
Re: Font-lock decides function call is function declaration in C+ +, Chong Yidong, 2007/02/11
RE: Font-lock decides function call is function declaration in C+ +, Marshall, Simon, 2007/02/12