From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: Font-lock decides function call is function declaration in C+ + Date: Fri, 09 Feb 2007 16:25:21 -0500 Message-ID: <87hctvhvlq.fsf@stupidchicken.com> References: <81CCA6588E60BB42BE68BD029ED4826011AB3F79@wimex2.wim.midas-kapiti.com> <20070207215912.GA2324@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1171056358 31847 80.91.229.12 (9 Feb 2007 21:25:58 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 9 Feb 2007 21:25:58 +0000 (UTC) Cc: "'bug-cc-mode@gnu.org'" , "Marshall, Simon" , "'emacs-devel@gnu.org'" To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 09 22:25:52 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HFdFf-0000D0-Rk for ged-emacs-devel@m.gmane.org; Fri, 09 Feb 2007 22:25:52 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HFdFf-0004dp-Bi for ged-emacs-devel@m.gmane.org; Fri, 09 Feb 2007 16:25:51 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HFdFU-0004dk-Al for emacs-devel@gnu.org; Fri, 09 Feb 2007 16:25:40 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HFdFT-0004dc-0G for emacs-devel@gnu.org; Fri, 09 Feb 2007 16:25:39 -0500 Original-Received: from south-station-annex.mit.edu ([18.72.1.2]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1HFdFS-0003At-NP; Fri, 09 Feb 2007 16:25:38 -0500 Original-Received: from central-city-carrier-station.mit.edu (CENTRAL-CITY-CARRIER-STATION.MIT.EDU [18.7.7.72]) by south-station-annex.mit.edu (8.13.6/8.9.2) with ESMTP id l19LPWGc026203; Fri, 9 Feb 2007 16:25:32 -0500 (EST) Original-Received: from outgoing-legacy.mit.edu (OUTGOING-LEGACY.MIT.EDU [18.7.22.104]) by central-city-carrier-station.mit.edu (8.13.6/8.9.2) with ESMTP id l19LPOq0026238; Fri, 9 Feb 2007 16:25:25 -0500 (EST) Original-Received: from localhost (MAIN-TWELVE-THREE-THIRTY-FIVE.MIT.EDU [18.19.6.80]) ) by outgoing-legacy.mit.edu (8.13.6/8.12.4) with ESMTP id l19LPLnh014028; Fri, 9 Feb 2007 16:25:24 -0500 (EST) Original-Received: from cyd by localhost with local (Exim 3.36 #1 (Debian)) id 1HFdFB-0001Om-00; Fri, 09 Feb 2007 16:25:21 -0500 In-Reply-To: <20070207215912.GA2324@muc.de> (Alan Mackenzie's message of "7 Feb 2007 21\:45\:03 +0100\, Wed\, 7 Feb 2007 21\:59\:12 +0000") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.93 (gnu/linux) X-Scanned-By: MIMEDefang 2.42 X-Spam-Score: -2.599 X-detected-kernel: Solaris 9.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:66187 Archived-At: Alan Mackenzie writes: > 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. I think the problem is that when the buffer is in the state foo bar (); foo looks like a type, so it is inserted in the cache variable c-found-types. When you add the "()": foo() bar(); this guess is no longer valid, but foo is not removed from c-found-types. Therefore, when you insert the final ";", foo(); bar(); the call to foo(); is highlighted as though it were a constructor. Note that if you do M-: (c-clear-found-types) prior to inserting the final ";", the misfontification does not occur. I don't know what the Right Fix is, however.