From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Font-lock decides function call is function declaration in C+ + Date: Mon, 12 Feb 2007 11:17:51 -0500 Message-ID: References: <81CCA6588E60BB42BE68BD029ED4826011ED2AA1@wimex2.wim.midas-kapiti.com> <44933.128.165.123.18.1171295633.squirrel@webmail.lanl.gov> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1171297104 1231 80.91.229.12 (12 Feb 2007 16:18:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 12 Feb 2007 16:18:24 +0000 (UTC) Cc: "'bug-cc-mode@gnu.org'" , 'Alan Mackenzie' , "Marshall, Simon" , 'Chong Yidong' , "'emacs-devel@gnu.org'" To: herring@lanl.gov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 12 17:18:12 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 1HGdsW-0002JB-Rq for ged-emacs-devel@m.gmane.org; Mon, 12 Feb 2007 17:18:09 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HGdsW-0004XB-9v for ged-emacs-devel@m.gmane.org; Mon, 12 Feb 2007 11:18:08 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HGdsK-0004Ww-KK for emacs-devel@gnu.org; Mon, 12 Feb 2007 11:17:56 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HGdsI-0004Wj-Nj for emacs-devel@gnu.org; Mon, 12 Feb 2007 11:17:55 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HGdsI-0004Wg-Ij for emacs-devel@gnu.org; Mon, 12 Feb 2007 11:17:54 -0500 Original-Received: from tomts36.bellnexxia.net ([209.226.175.93] helo=tomts36-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1HGdsH-00063J-FT; Mon, 12 Feb 2007 11:17:53 -0500 Original-Received: from pastel.home ([70.55.81.74]) by tomts36-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20070212161752.ITI1862.tomts36-srv.bellnexxia.net@pastel.home>; Mon, 12 Feb 2007 11:17:52 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id CE7E57F6D; Mon, 12 Feb 2007 11:17:51 -0500 (EST) In-Reply-To: <44933.128.165.123.18.1171295633.squirrel@webmail.lanl.gov> (Stuart D. Herring's message of "Mon\, 12 Feb 2007 07\:53\:53 -0800 \(PST\)") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.93 (gnu/linux) X-detected-kernel: Solaris 8 (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:66292 Archived-At: >> Yes, unfortunately, I think that if you try to learn types on-the-fly then >> you will always be vulnerable to this sort of problem. The issue is that >> cc-mode needs to know as soon as a change invalidates it as a candidate >> type >> (ie, deletion of some/all of the text "foo" or interruption of the >> whitespace between "foo" and its candidate identifier "bar"). I can think >> of a few ways you could attempt to do it, but they are a bit intensive and >> far from simple. > It's worse than that. Inserting a new letter that changes "foo", or > transposing two characters 3k back in the buffer that cause the whole > region to become a comment, or deleting "bar", or exchanging "foo" and > "bar", or merely exchanging 'f' and 'o', or adding #define in front of > "foo", or... any of which could be done as one change by an appropriate > Lisp helper function. Yes, of course, the case of commenting code needs to be handled as well, but re-using the font-lock machinery makes it "somewhat painless". Stefan