From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: C font-lock bug Date: 27 Apr 2007 14:38:24 +0200 Message-ID: <20070427135917.GB3613@muc.de> References: <12799012.205971174993530168.JavaMail.www@wwinf4105> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1177677569 2275 80.91.229.12 (27 Apr 2007 12:39:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 27 Apr 2007 12:39:29 +0000 (UTC) Cc: alinsoar@voila.fr, "Emacs Dev \[emacs-devel\]" To: Francesco Potorti` Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 27 14:39:27 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 1HhPjR-0007wM-MB for ged-emacs-devel@m.gmane.org; Fri, 27 Apr 2007 14:39:26 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HhPpH-0007GN-EW for ged-emacs-devel@m.gmane.org; Fri, 27 Apr 2007 08:45:27 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HhPoP-00070a-Ex for emacs-devel@gnu.org; Fri, 27 Apr 2007 08:44:33 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HhPoO-000708-Ia for emacs-devel@gnu.org; Fri, 27 Apr 2007 08:44:33 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HhPoO-000702-F5 for emacs-devel@gnu.org; Fri, 27 Apr 2007 08:44:32 -0400 Original-Received: from colin.muc.de ([193.149.48.1] helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HhPiX-0003PB-3h for emacs-devel@gnu.org; Fri, 27 Apr 2007 08:38:29 -0400 Original-Received: (qmail 60244 invoked by uid 3782); 27 Apr 2007 12:38:24 -0000 Original-Received: from acm.muc.de (p54A3EDB3.dip.t-dialin.net [84.163.237.179]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Fri, 27 Apr 2007 14:38:21 +0200 Original-Received: (qmail 6085 invoked by uid 1000); 27 Apr 2007 13:59:17 -0000 Original-Date: Fri, 27 Apr 2007 14:59:17 +0100 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-detected-kernel: FreeBSD 4.6-4.9 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:70247 Archived-At: Hi, Francesco! On Fri, Apr 27, 2007 at 12:07:34PM +0200, Francesco Potorti` wrote: > Sorry for the big delay, I am trying ot recover my email backlog. > >> >1. Emacs -Q > >> >2. M-. Lisp_Type >> >Select then the path to your TAGS file of your emacs. The first 4 > >> >members of this enumeration are listed in yellow color to me . The > >> >last 4 members in black color . [ .... ] > At last I understand. In fact, find-tag is completely unrelated with > this. I changed the subject to reflect that this is a bug in font-lock > for C code. OK. > Specifically, if you load lisp.h from the Emacs sources and look at > enum Lisp_Type you see that the colour of the members of the enum > changes after the fourth member. Yes. A workaround is M-o M-o. (Yes, I _know_ you know this. Sorry!) This problem has been around a long time, and needs substantial work to fix. It happens in long enums, structs, and so on. The font-locking code needs to be told where to start its parsing, and after the first few lines in a long enum, the font-locking stuff no longer knows that it's inside an enum because the start of the enum is "too far away". In a solution, the CC Mode font locking routines will have to determine the place to start and stop parsing, and have to communicate this to the Font Lock code somehow. There have been extensive discussions on emacs-devel about these topics. This isn't going to get fixed for Emacs 22. Sorry! -- Alan Mackenzie (Ittersbach, Germany).