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: [Emacs-diffs] emacs-24 d69e9f1: CC Mode: Stop Font Lock forcing fontification from BOL. Fixes debbugs#19669. Date: Thu, 19 Mar 2015 16:56:16 -0400 Message-ID: References: <20150201212213.17840.3710@vcs.savannah.gnu.org> <55076CF8.60309@dancol.org> <20150318120806.GA4160@acm.fritz.box> <550A43BB.3070904@dancol.org> <20150319093110.GA2753@acm.fritz.box> <20150319203724.GB2753@acm.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1426798607 20503 80.91.229.3 (19 Mar 2015 20:56:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Mar 2015 20:56:47 +0000 (UTC) Cc: Daniel Colascione , emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 19 21:56:39 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YYhUc-0005vL-8c for ged-emacs-devel@m.gmane.org; Thu, 19 Mar 2015 21:56:38 +0100 Original-Received: from localhost ([::1]:41243 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYhUb-00009Q-MU for ged-emacs-devel@m.gmane.org; Thu, 19 Mar 2015 16:56:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43602) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYhUO-00009J-VO for emacs-devel@gnu.org; Thu, 19 Mar 2015 16:56:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YYhUK-0007y9-DY for emacs-devel@gnu.org; Thu, 19 Mar 2015 16:56:24 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:49771) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYhUK-0007xp-8f for emacs-devel@gnu.org; Thu, 19 Mar 2015 16:56:20 -0400 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id t2JKuGMC000378; Thu, 19 Mar 2015 16:56:16 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 22EE7182C; Thu, 19 Mar 2015 16:56:16 -0400 (EDT) In-Reply-To: <20150319203724.GB2753@acm.fritz.box> (Alan Mackenzie's message of "Thu, 19 Mar 2015 20:37:25 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5250=0 X-NAI-Spam-Version: 2.3.0.9393 : core <5250> : inlines <2451> : streams <1408229> : uri <1884941> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:184029 Archived-At: >> you can handle fontification from 1,3, or 4 but not from 2. You need to >> refine the system you use to keep track of whether we're within >> a `union' so that it knows that position 2 is also "within a union". > Well, sort of. The problem I'm facing is that in Dima Kogan's bug > #19669, the following construct appears: > 1. enum xxx_xxxx_xxxxxxxxxx_x > 2. {XXX_XXXXXX_XXXX_XXX, > 3. XXX_XXXXXX_XXX_XXX, > 4. XXXX_XXXXX_XXXX_XXX, > Note that the brace on L2 is on the same line as the first XXX_.... > When the user types on line 4, 5, ... here, CC Mode sets the > fontification region start to JUST AFTER THE { ON L2. It is essential > that Font Lock doesn't change this. There's your problem: your current setup needs the starting point to be either before "union" or after the first open brace. It breaks down if it's between the two. That's the problem you need to fix. Stefan