From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Marshall, Simon" Newsgroups: gmane.emacs.devel Subject: RE: Font-lock decides function call is function declaration in C+ + Date: Mon, 12 Feb 2007 14:38:59 -0000 Message-ID: <81CCA6588E60BB42BE68BD029ED4826011ED2AA1@wimex2.wim.midas-kapiti.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: sea.gmane.org 1171291483 7088 80.91.229.12 (12 Feb 2007 14:44:43 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 12 Feb 2007 14:44:43 +0000 (UTC) Cc: "'bug-cc-mode@gnu.org'" , "'emacs-devel@gnu.org'" To: "'Stefan Monnier'" , "'Chong Yidong'" , "'Alan Mackenzie'" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 12 15:44:31 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 1HGcPr-00046Y-5G for ged-emacs-devel@m.gmane.org; Mon, 12 Feb 2007 15:44:27 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HGcPq-0005Sg-Ko for ged-emacs-devel@m.gmane.org; Mon, 12 Feb 2007 09:44:26 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HGcMd-0003Hi-2l for emacs-devel@gnu.org; Mon, 12 Feb 2007 09:41:07 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HGcMa-0003Gr-Qf for emacs-devel@gnu.org; Mon, 12 Feb 2007 09:41:06 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HGcMa-0003Gm-K5 for emacs-devel@gnu.org; Mon, 12 Feb 2007 09:41:04 -0500 Original-Received: from mx20.gnu.org ([199.232.41.8]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1HGcMa-000136-AJ for emacs-devel@gnu.org; Mon, 12 Feb 2007 09:41:04 -0500 Original-Received: from cluster-b.mailcontrol.com ([217.68.146.190]) by mx20.gnu.org with esmtp (Exim 4.52) id 1HGcLY-0002m1-VS; Mon, 12 Feb 2007 09:40:01 -0500 Original-Received: from rly14b.srv.mailcontrol.com (localhost.localdomain [127.0.0.1]) by rly14b.srv.mailcontrol.com (MailControl) with ESMTP id l1CEcT2F005494 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 12 Feb 2007 14:38:57 GMT Original-Received: from submission.mailcontrol.com (submission.mailcontrol.com [86.111.216.190]) by rly14b.srv.mailcontrol.com (MailControl) id l1CEbeSh003602; Mon, 12 Feb 2007 14:37:40 GMT Original-Received: from wimex2.wim.midas-kapiti.com ([217.196.233.101]) by rly14b-eth0.srv.mailcontrol.com (envelope-sender simon.marshall@misys.com) (MIMEDefang) with ESMTP id l1CEbang003409; Mon, 12 Feb 2007 14:37:40 +0000 (GMT) Original-Received: by wimex2.wim.midas-kapiti.com with Internet Mail Service (5.5.2657.72) id ; Mon, 12 Feb 2007 14:39:06 -0000 X-Mailer: Internet Mail Service (5.5.2657.72) X-Scanned-By: MailControl A-07-06-80 (www.mailcontrol.com) on 10.66.1.124 X-detected-kernel: Linux 2.4-2.6 X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) 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:66285 Archived-At: > >> Once a variable has been inserted into c-found-types, it will stay there > >> almost for ever; it will stay there until re-fontification is done from > >> BOB (I'm not sure whether or not that also means (point-min) on a > >> narrowed buffer). This permanence seems to be the fundamental problem. > >> > >> 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. > > > For the Emacs 22 release, if no simple fix is forthcoming, could we > > simply get font-lock to avoid higlighting constructor functions? > > Or to not try to auto-learn types, 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. Perhaps cc-mode should only try to learn types when fontifying the whole buffer? 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.