emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Font Lock on-the-fly misfontification in C++


From: Marshall, Simon
Subject: Font Lock on-the-fly misfontification in C++
Date: Fri, 9 Feb 2007 10:58:21 -0000

This bites on a frustratingly regular basis.  Put the following in a
fubar.cpp:

class Fubar :
  public Foo,   // Foo fontified as a type, at first
  public Bar    // Bar fontified as a type, at first
{
  Foo bar(Snafu snafu,  // Types, function, variable fontified, at first
          Foo foo,
          Bar bar);
  Foo bar(Snafu *snafu, // Types, function, variable fontified, at first
          Foo foo,
          Bar bar);
};

Then emacs -Q fubar.cpp.  I see Foo, Bar and Snafu fontified as types even
where declaring functions and variables.  The corresponding functions and
variables are fontified correctly.  This is great!

Then do the following.

1.  Append a space to the first (or second) commented line.  Bug:
fontification of Foo (and/or Bar) is removed.

2.  Append a space to the third commented line.  Bug: fontification of Foo
and bar is removed from that line.

3.  Append a space to the fourth commented line.  Bug: fontification of Foo,
bar, Snafu and snafu is removed from that line.

Somewhat spookily, if you then repeat (2), then the fourth commented line
(3) gets fontified correctly after the deferral delay.

I think this is some sort of problem with Jit Lock mode multiline
fontification, at least for (2) and (3), since Lazy Lock mode works ok.  (Of
course, Lazy Lock mode is now depreciated and lazy-lock-mode is not
autoloaded.)

Stefan Monnier kindly posted a possible partial fix (see
http://lists.gnu.org/archive/html/emacs-devel/2006-07/msg01193.html) but
that thread went into a discussion about the font-lock-multiline text
property.  I don't know how valid the approach is now (and obviously the
patch was not checked in).

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. 




reply via email to

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