From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.cc-mode.general,gmane.emacs.pretest.bugs,gmane.emacs.devel Subject: Re: [simon.marshall@misys.com: Font Lock on-the-fly misfontification in C++] Date: Sun, 23 Jul 2006 15:26:30 +0100 Message-ID: <20060723142630.GB1433@muc.de> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1153661169 20492 80.91.229.2 (23 Jul 2006 13:26:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 23 Jul 2006 13:26:09 +0000 (UTC) Cc: bug-cc-mode@gnu.org, emacs-pretest-bug@gnu.org, emacs-devel@gnu.org Original-X-From: cc-mode-help-bounces@lists.sourceforge.net Sun Jul 23 15:26:05 2006 Return-path: Envelope-to: sf-cc-mode-help@m.gmane.org Original-Received: from lists-outbound.sourceforge.net ([66.35.250.225]) by ciao.gmane.org with esmtp (Exim 4.43) id 1G4dy3-0005VF-0E for sf-cc-mode-help@m.gmane.org; Sun, 23 Jul 2006 15:25:59 +0200 Original-Received: from sc8-sf-list1-new.sourceforge.net (unknown [10.3.1.93]) by sc8-sf-spam2.sourceforge.net (Postfix) with ESMTP id 71E7F123B9; Sun, 23 Jul 2006 06:25:57 -0700 (PDT) Original-Received: from sc8-sf-mx2-b.sourceforge.net ([10.3.1.92] helo=mail.sourceforge.net) by sc8-sf-list1-new.sourceforge.net with esmtp (Exim 4.43) id 1G4dxy-0004U5-V8 for cc-mode-help@lists.sourceforge.net; Sun, 23 Jul 2006 06:25:55 -0700 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by mail.sourceforge.net with esmtps (TLSv1:RC4-SHA:128) (Exim 4.44) id 1G4dxw-0000Hg-99 for cc-mode-help@lists.sourceforge.net; Sun, 23 Jul 2006 06:25:54 -0700 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by fencepost.gnu.org with esmtp (Exim 4.34) id 1G4dxr-0007k2-06 for bug-cc-mode@gnu.org; Sun, 23 Jul 2006 09:25:47 -0400 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.52) id 1G4dyh-00015f-RG for bug-cc-mode@gnu.org; Sun, 23 Jul 2006 09:26:40 -0400 Original-Received: from [193.149.48.1] (helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1G4dyh-00015F-DN for bug-cc-mode@gnu.org; Sun, 23 Jul 2006 09:26:39 -0400 Original-Received: (qmail 33201 invoked from network); 23 Jul 2006 13:25:37 -0000 Original-Received: from acm.muc.de (HELO localhost.localdomain) (Debian-exim@193.149.49.134) by mail.muc.de with SMTP; 23 Jul 2006 13:25:37 -0000 Original-Received: from acm by localhost.localdomain with local (Exim 4.50) id 1G4euc-0001a0-3S; Sun, 23 Jul 2006 15:26:30 +0100 Original-To: "Marshall, Simon" , Richard Stallman Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on monty-python X-Spam-Level: * X-Spam-Status: No, score=1.5 required=5.0 tests=ADDRESS_IN_SUBJECT, FORGED_RCVD_HELO autolearn=no version=3.0.4 X-Spam-Score: 2.4 (++) X-Spam-Report: Spam Filtering performed by sourceforge.net. See http://spamassassin.org/tag/ for more details. Report problems to http://sf.net/tracker/?func=add&group_id=1&atid=200001 1.0 FORGED_RCVD_HELO Received: contains a forged HELO 1.4 ADDRESS_IN_SUBJECT To: address appears in Subject X-BeenThere: cc-mode-help@lists.sourceforge.net X-Mailman-Version: 2.1.8 Precedence: list List-Id: "Bug reports, feature requests, and general talk about CC Mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: cc-mode-help-bounces@lists.sourceforge.net Errors-To: cc-mode-help-bounces@lists.sourceforge.net Xref: news.gmane.org gmane.emacs.cc-mode.general:3602 gmane.emacs.pretest.bugs:13092 gmane.emacs.devel:57501 Archived-At: Hi, Simon; Hi, Richard! On Wed, Jul 19, 2006 at 10:22:00PM -0400, Richard Stallman wrote: > Please DTRT. > ------- Start of forwarded message ------- > From: "Marshall, Simon" > To: "'Emacs Pretest Bug (emacs-pretest-bug@gnu.org)'" > > Date: Wed, 19 Jul 2006 16:46:04 +0100 > MIME-Version: 1.0 > Content-Type: text/plain > Subject: Font Lock on-the-fly misfontification in C++ > X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=failed > version=3.0.4 > 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 (or Bar) is removed from that line. > 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. The problem is that after a textual change, the changed line gets fontified as an atomic entity, i.e. yanked out of its context. The solution is to determine the bounds of the region to fontify by analysing the surrounding text syntactically. (Sorry about the number of big words in that sentence.) Such a determination would, in these cases, identify exactly the comments on these lines. There is a lot of work to be done here in CC Mode, and possibly some enhancements are still needed in Font Lock. I'm hoping to do the CC Mode bit for release 5.32 (the current release is 5.31.3) within a year or two. In the meantime, a workaround is M-o M-o, `font-lock-fontify-block'. > Somewhat spookily, if you then repeat (2), then the fourth commented line > (3) gets fontified correctly after the deferral delay. Yes. Changing the "public Bar" line marks all subsequent text for deferred fontification. This latter is done in the full syntactic context. Yes, it's disconcerting. > 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. Isn't Lazy Lock obsolete in Emacs 22? -- Alan Mackenzie (Munich, Germany) ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV