unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* RE: Font-lock decides function call is function declaration in C+ +
@ 2007-02-05 16:46 Marshall, Simon
  2007-02-05 17:14 ` Chong Yidong
                   ` (2 more replies)
  0 siblings, 3 replies; 27+ messages in thread
From: Marshall, Simon @ 2007-02-05 16:46 UTC (permalink / raw)
  To: 'Chong Yidong'
  Cc: 'bug-cc-mode@gnu.org', 'emacs-devel@gnu.org'

> Does this bug still exist with latest CVS?  If so, please provide a
> simple test case (I couldn't find one in your previous messages).

Yes, it does, with CVS Emacs as of 05/02/2007.  Originally, I couldn't
reproduce it on demand.  That's why, originally, I was asking for help to
track it down.

But, messing around just now, I've finally managed to do it.  I can't say
that these are the only way of reproducing it, as I've seen this
misfontification in a variety of situations that do not look obviously like
these.

1.  The goal is to write the code snippet:

int main() {
  foo();
  bar();
}

emacs -Q foo.cpp
int SPC main() SPC { RET } RET C-p C-o bar();

OK so far.  Now to insert the "foo();" line:

C-a C-o foo

At this point, "foo" is fontified as a type, and "bar" as a variable.  OK.
Now:

()

The fontification of "foo" and "bar" disappears.  OK.  Now complete the
snippet:

;

Now "foo" is fontified as a variable.  This is wrong.

2.  Here's a variation.  This time, the goal is to write the code snippet:

int main() {
  foo(fubar);
  bar();
}

emacs -Q bar.cpp
int SPC main() SPC { RET } RET C-p C-o bar();

OK so far.  Now to insert the "foo(fubar);" line:

C-a C-o foo(fubar

At this point, "bar" is fontified as a type.  Not sure why, but still.  Now:

);

Now "bar" is fontified as a variable.  This is wrong.

What is worse is that in both cases I cannot get rid of the misfontification
without turning Font Lock mode off and on again.

I hope this help to fix The Most Annoying Fontification Bug Ever.  Simon.


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] 27+ messages in thread
* RE: Font-lock decides function call is function declaration in C+ +
@ 2007-02-12 14:38 Marshall, Simon
  2007-02-12 15:53 ` Stuart D. Herring
  0 siblings, 1 reply; 27+ messages in thread
From: Marshall, Simon @ 2007-02-12 14:38 UTC (permalink / raw)
  To: 'Stefan Monnier', 'Chong Yidong',
	'Alan Mackenzie'
  Cc: 'bug-cc-mode@gnu.org', 'emacs-devel@gnu.org'

> >> 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.
> >> 
> >> 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.
> 
> > For the Emacs 22 release, if no simple fix is forthcoming, could we
> > simply get font-lock to avoid higlighting constructor functions?
> 
> Or to not try to auto-learn types,

Yes, unfortunately, I think that if you try to learn types on-the-fly then
you will always be vulnerable to this sort of problem.  The issue is that
cc-mode needs to know as soon as a change invalidates it as a candidate type
(ie, deletion of some/all of the text "foo" or interruption of the
whitespace between "foo" and its candidate identifier "bar").  I can think
of a few ways you could attempt to do it, but they are a bit intensive and
far from simple.

Perhaps cc-mode should only try to learn types when fontifying the whole
buffer?

Simon.


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] 27+ messages in thread
* RE: Font-lock decides function call is function declaration in C+ +
@ 2007-02-09 10:32 Marshall, Simon
  0 siblings, 0 replies; 27+ messages in thread
From: Marshall, Simon @ 2007-02-09 10:32 UTC (permalink / raw)
  To: 'Alan Mackenzie'
  Cc: 'bug-cc-mode@gnu.org', 'emacs-devel@gnu.org',
	'Chong Yidong'

> So it seems its entirely a CC Mode bug.  I'm going to try and 
> track it down, though I suspect it could be quite tricky to 
> find.  Thanks for giving that recipe for producing the bug.

Thanks.

> > I hope this help to fix The Most Annoying Fontification Bug Ever.
> 
> I think there're also other candidates for that description.  ;-(

Don't poke the monster.

Uh-huh, he's woken.


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. 

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642


^ permalink raw reply	[flat|nested] 27+ messages in thread
[parent not found: <81CCA6588E60BB42BE68BD029ED48260105584F1@wimex2.wim.midas-kapiti.com>]
* Tetris trademark
@ 2007-01-26 21:18 Chip Coldwell
  2007-01-27  4:19 ` Richard Stallman
  0 siblings, 1 reply; 27+ messages in thread
From: Chip Coldwell @ 2007-01-26 21:18 UTC (permalink / raw)
  To: emacs-devel


Is anybody concerned that lisp/play/tetris.el might be a trademark
infringement?

Chip

-- 
Charles M. "Chip" Coldwell
Senior Software Engineer
Red Hat, Inc
978-392-2426

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

end of thread, other threads:[~2007-03-11  4:24 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-05 16:46 Font-lock decides function call is function declaration in C+ + Marshall, Simon
2007-02-05 17:14 ` Chong Yidong
2007-02-07 20:45 ` Alan Mackenzie
2007-02-09 21:25   ` Chong Yidong
2007-02-11 17:40     ` Alan Mackenzie
2007-02-11 20:11       ` Stefan Monnier
2007-02-11 23:18       ` Chong Yidong
2007-02-12  2:45         ` Stefan Monnier
2007-02-12 17:59         ` Alan Mackenzie
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-02  3:28     ` Richard Stallman
2007-03-03 10:18     ` Alan Mackenzie
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
  -- strict thread matches above, loose matches on Subject: below --
2007-02-12 14:38 Font-lock decides function call is function declaration in C+ + Marshall, Simon
2007-02-12 15:53 ` Stuart D. Herring
2007-02-12 16:17   ` Stefan Monnier
2007-02-12 17:41   ` Alan Mackenzie
2007-02-12 18:06     ` Stuart D. Herring
2007-02-13 22:22       ` Alan Mackenzie
2007-02-09 10:32 Marshall, Simon
     [not found] <81CCA6588E60BB42BE68BD029ED48260105584F1@wimex2.wim.midas-kapiti.com>
2007-02-02  4:04 ` Chong Yidong
2007-01-26 21:18 Tetris trademark Chip Coldwell
2007-01-27  4:19 ` Richard Stallman
2007-01-27 13:03   ` Chris Moore
2007-01-27 13:39     ` Alfred M. Szmidt
2007-01-28 19:54       ` Chong Yidong
2007-01-28 20:23         ` Alfred M. Szmidt
2007-01-28 21:34           ` Chong Yidong
2007-01-28 22:41             ` Alfred M. Szmidt
2007-01-29  0:54               ` Chris Moore
2007-02-02 23:57                 ` Font-lock decides function call is function declaration in C+ + Chong Yidong

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).