unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: Font-lock decides function call is function declaration in C+ + - Patch
  2007-03-01 17:19   ` Chong Yidong
@ 2007-03-08 22:07     ` Alan Mackenzie
  2007-03-08 22:58       ` Chong Yidong
  2007-03-09 21:25       ` Richard Stallman
  0 siblings, 2 replies; 6+ messages in thread
From: Alan Mackenzie @ 2007-03-08 22:07 UTC (permalink / raw)
  To: Chong Yidong, Marshall, Simon; +Cc: emacs-devel

Hi, Chong and Simon

On Thu, Mar 01, 2007 at 12:19:57PM -0500, Chong Yidong wrote:
> Hi Alan,

> Judging by the size of the patch you sent, and the time it's taking to
> write it, this seems to be a lot of work.  Once we include the time
> necessary for testing such a big change, it will probably
> significantly delay the Emacs 22 release.

int main () {
    foo         <===== type "();", then erase it.
    bar ();
}

I've just committed a patch to cc-mode.el and cc-engine.el which fixes
Simon's (first) bug.  [The "variant" he mentioned is a distinct bug.]

It's a fairly scrappy ad-hoc patch - it fixes a particular simple bug
scenario which will surely occur frequently.  Its idea is to remove
tokens from the cache `c-found-types' whenever these tokens are broken
up (e.g. by typing stuff in the middle of them, or removing space which
separated them from other tokens) or when their syntactic identity as
types ceases is disrupted.

I think this cache mechanism should to be thought through and either
abolished or amended to work consistently.

-- 
Alan Mackenzie (Ittersbach Germany).

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Font-lock decides function call is function declaration in C+ + - Patch
  2007-03-08 22:07     ` Font-lock decides function call is function declaration in C+ + - Patch Alan Mackenzie
@ 2007-03-08 22:58       ` Chong Yidong
  2007-03-09 21:25       ` Richard Stallman
  1 sibling, 0 replies; 6+ messages in thread
From: Chong Yidong @ 2007-03-08 22:58 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: Marshall, Simon, emacs-devel

Alan Mackenzie <acm@muc.de> writes:

> It's a fairly scrappy ad-hoc patch - it fixes a particular simple bug
> scenario which will surely occur frequently.  Its idea is to remove
> tokens from the cache `c-found-types' whenever these tokens are broken
> up (e.g. by typing stuff in the middle of them, or removing space which
> separated them from other tokens) or when their syntactic identity as
> types ceases is disrupted.
>
> I think this cache mechanism should to be thought through and either
> abolished or amended to work consistently.

Thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Font-lock decides function call is function declaration in C+ + - Patch
  2007-03-08 22:07     ` Font-lock decides function call is function declaration in C+ + - Patch Alan Mackenzie
  2007-03-08 22:58       ` Chong Yidong
@ 2007-03-09 21:25       ` Richard Stallman
  2007-03-09 23:23         ` Alan Mackenzie
  1 sibling, 1 reply; 6+ messages in thread
From: Richard Stallman @ 2007-03-09 21:25 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: cyd, simon.marshall, emacs-devel

    It's a fairly scrappy ad-hoc patch - it fixes a particular simple bug
    scenario which will surely occur frequently.

What I worry about is, how likely is it to cause new bugs in other
cases?

It would be safer just to turn off this cache feature.
How much would users mind that?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Font-lock decides function call is function declaration in C+ + - Patch
  2007-03-09 21:25       ` Richard Stallman
@ 2007-03-09 23:23         ` Alan Mackenzie
  2007-03-11  4:24           ` Richard Stallman
  0 siblings, 1 reply; 6+ messages in thread
From: Alan Mackenzie @ 2007-03-09 23:23 UTC (permalink / raw)
  To: Richard Stallman; +Cc: cyd, simon.marshall, emacs-devel

Hi, Richard!

On Fri, Mar 09, 2007 at 04:25:35PM -0500, Richard Stallman wrote:
>     It's a fairly scrappy ad-hoc patch - it fixes a particular simple bug
>     scenario which will surely occur frequently.

> What I worry about is, how likely is it to cause new bugs in other
> cases?

I was worrying about that all the time I was formulating the bug and
writing the patch.  The answer is, IMBO[*], not very likely.  Here's my
analysis:

(i) The patch doesn't change the buffer contents (apart from, possibly,
text properties on some characters).  It intended effect is purely to
remove type-identifiers from the cache `c-found-types'.  Removing a type
from this cache when it should stay there wouldn't be that bad.  Failing
to remove a stale type would be no worse than the code prior to the fix.

(ii) Bugs like going off the end of a buffer, getting lisp errors with
empty buffers, and such like, are possible.

(iii) Bugs like forgetting to widen are possible.

[*] "In my biassed opion"

> It would be safer just to turn off this cache feature.

That would throw out some of the fontification, and would slow things
down.  I don't know by how much; I would guess quite a lot.

> How much would users mind that?

I would guess some (like Simon ;-) would mind a lot.  Others (like me)
would hardly notice.  I think, in general, it wouldn't be good to take
this cache out, now.  It's been in place since CC Mode 5.30 (summer
2003).

How about letting Simon test it on his C++ code?

-- 
Alan Mackenzie (Ittersbach, Germany).

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Font-lock decides function call is function declaration in C+ + - Patch
  2007-03-09 23:23         ` Alan Mackenzie
@ 2007-03-11  4:24           ` Richard Stallman
  0 siblings, 0 replies; 6+ messages in thread
From: Richard Stallman @ 2007-03-11  4:24 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: cyd, simon.marshall, emacs-devel

I guess we are stuck with this fix.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: Font-lock decides function call is function declaration in C+ + - Patch
@ 2007-03-13 10:05 Marshall, Simon
  0 siblings, 0 replies; 6+ messages in thread
From: Marshall, Simon @ 2007-03-13 10:05 UTC (permalink / raw)
  To: 'Alan Mackenzie', 'Richard Stallman'
  Cc: 'cyd@stupidchicken.com', 'emacs-devel@gnu.org'

> > It would be safer just to turn off this cache feature.

Unfortunately, I don't think cc-model honours c++-font-lock-extra-types
anymore.  That was an old way of teaching font-lock about C++ types for
fontification purposes.  It's still defined, just no longer used.

> How about letting Simon test it on his C++ code?

I can't right now, as cvs.savannah.gnu.org seems uncooperative:

> cvs update
cvs [update aborted]: reading from server: Connection reset by peer
> cat CVS/Root 
:pserver:anonymous@cvs.savannah.gnu.org:/sources/emacs
> ping cvs.savannah.gnu.org
cvs.savannah.gnu.org is alive
> 


This email message is intended for the named recipient only. It may be privileged and/or confidential. If you are not the named recipient of this email please notify us immediately and do not copy it or use it for any purpose, nor disclose its contents to any other person.       Misys Banking Systems is a trading name of Misys International Banking Systems Limited which is registered in England and Wales under company registration number 00971479 and with its registered office address at Burleigh House, Chapel Oak, Salford Priors, Evesham WR11 8SP.    THIS E-MAIL DOES NOT CONSTITUTE THE COMMENCEMENT OF LEGAL RELATIONS BETWEEN YOU AND MISYS INTERNATIONAL BANKING SYSTEMS LIMITED. PLEASE REFER TO THE EXECUTED CONTRACT BETWEEN YOU AND THE RELEVANT MEMBER OF THE MISYS GROUP FOR THE IDENTITY OF THE CONTRACTING PARTY WITH WHICH YOU ARE DEALING. 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-03-13 10:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-13 10:05 Font-lock decides function call is function declaration in C+ + - Patch Marshall, Simon
  -- strict thread matches above, loose matches on Subject: below --
2007-02-05 16:46 Font-lock decides function call is function declaration in C+ + Marshall, Simon
2007-02-22 23:47 ` Font-lock decides function call is function declaration in C+ + - embryonic solution Alan Mackenzie
2007-03-01 17:19   ` Chong Yidong
2007-03-08 22:07     ` Font-lock decides function call is function declaration in C+ + - Patch Alan Mackenzie
2007-03-08 22:58       ` Chong Yidong
2007-03-09 21:25       ` Richard Stallman
2007-03-09 23:23         ` Alan Mackenzie
2007-03-11  4:24           ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).