From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.cc-mode.general,gmane.emacs.devel Subject: Re: Font-lock decides function call is function declaration in C+ + Date: Sun, 11 Feb 2007 15:11:37 -0500 Message-ID: References: <81CCA6588E60BB42BE68BD029ED4826011AB3F79@wimex2.wim.midas-kapiti.com> <20070207215912.GA2324@muc.de> <87hctvhvlq.fsf@stupidchicken.com> <20070211185523.GA7079@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1171224737 14735 80.91.229.12 (11 Feb 2007 20:12:17 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 11 Feb 2007 20:12:17 +0000 (UTC) Cc: "'bug-cc-mode@gnu.org'" , Chong Yidong , "Marshall, Simon" , "'emacs-devel@gnu.org'" To: Alan Mackenzie Original-X-From: cc-mode-help-bounces@lists.sourceforge.net Sun Feb 11 21:12:14 2007 Return-path: Envelope-to: sf-cc-mode-help@m.gmane.org Original-Received: from lists-outbound.sourceforge.net ([66.35.250.225]) by lo.gmane.org with esmtp (Exim 4.50) id 1HGL3V-0005yu-EZ for sf-cc-mode-help@m.gmane.org; Sun, 11 Feb 2007 21:12:13 +0100 Original-Received: from sc8-sf-list1-new.sourceforge.net (sc8-sf-list1-new-b.sourceforge.net [10.3.1.93]) by sc8-sf-spam2.sourceforge.net (Postfix) with ESMTP id 9E976123F4; Sun, 11 Feb 2007 12:12:12 -0800 (PST) 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 1HGL3R-0006gD-Dj for cc-mode-help@lists.sourceforge.net; Sun, 11 Feb 2007 12:12:09 -0800 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by mail.sourceforge.net with esmtps (TLSv1:AES256-SHA:256) (Exim 4.44) id 1HGL3P-0002Z7-I6 for cc-mode-help@lists.sourceforge.net; Sun, 11 Feb 2007 12:12:09 -0800 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by fencepost.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HGL1p-0000kK-7T for bug-cc-mode@gnu.org; Sun, 11 Feb 2007 15:10:29 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.52) id 1HGL32-0002AE-MY for bug-cc-mode@gnu.org; Sun, 11 Feb 2007 15:11:45 -0500 Original-Received: from tomts40.bellnexxia.net ([209.226.175.97] helo=tomts40-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1HGL32-0002A2-BD; Sun, 11 Feb 2007 15:11:44 -0500 Original-Received: from pastel.home ([70.55.81.74]) by tomts40-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20070211201138.PZQB1750.tomts40-srv.bellnexxia.net@pastel.home>; Sun, 11 Feb 2007 15:11:38 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id C33197F67; Sun, 11 Feb 2007 15:11:37 -0500 (EST) In-Reply-To: <20070211185523.GA7079@muc.de> (Alan Mackenzie's message of "11 Feb 2007 18\:40\:53 +0100\, Sun\, 11 Feb 2007 18\:55\:23 +0000") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.93 (gnu/linux) X-detected-kernel: Solaris 8 (1) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on monty-python X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=failed version=3.0.4 X-Spam-Score: 1.0 (+) 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 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:4379 gmane.emacs.devel:66269 Archived-At: > 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. I'd be interested to know what solution you end up using. I've bumped into a similar problem in sml-mode where I tried to look at the infix precedence declarations in the file while font-locking to adjust the indentation algorithm. The best solution I found so far is to add a special text property covering the "infix" declaration and whose value is the symbol whose precedence and associativity is being set, and then in font-lock-unfontify-region I begin by looking for this special property and removing the corresponding symbols from the precedence table. But this failed when the whole line was deleted since the unfontify gets called after the text (and its text-property) is removed (i.e. too late), so I ended up using before-change-functions instead, which seemed too costly compared to the importance of the feature, so it's still in the "experimental" state. Maybe a better approach is to use overlays rather than text-properties, so they don't completely disappear if the text is removed. Stefan ------------------------------------------------------------------------- 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