all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: "Marshall, Simon" <simon.marshall@misys.com>
Cc: "'bug-cc-mode@gnu.org'" <bug-cc-mode@gnu.org>,
	"'emacs-devel@gnu.org'" <emacs-devel@gnu.org>,
	'Chong Yidong' <cyd@MIT.EDU>
Subject: Re: Font-lock decides function call is function declaration in C+ +
Date: 7 Feb 2007 21:45:02 +0100	[thread overview]
Message-ID: <20070207215912.GA2324@muc.de> (raw)
In-Reply-To: <81CCA6588E60BB42BE68BD029ED4826011AB3F79@wimex2.wim.midas-kapiti.com>

Hi, Simon!

On Mon, Feb 05, 2007 at 04:46:32PM -0000, Marshall, Simon wrote:
> > 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.

It is indeed wrong.  

Further observations:
(i) The bug doesn't happen in C Mode.
The bug happens:
(ii) in Emacs 5.21.3/CC Mode 5.31.4
(iii) With jit-lock disabled (thankfully ;-)
(iv) in Emacs 5.21.3/CC Mode 5.30.3

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.

> 2.  Here's a variation.  [ snipped ]

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

M-o M-o fixes the fontification for me.

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

I think there're also other candidates for that description.  ;-(

-- 
Alan Mackenzie (Ittersbach, Germany).

  parent reply	other threads:[~2007-02-07 20:45 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070207215912.GA2324@muc.de \
    --to=acm@muc.de \
    --cc=bug-cc-mode@gnu.org \
    --cc=cyd@MIT.EDU \
    --cc=emacs-devel@gnu.org \
    --cc=simon.marshall@misys.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.