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: Fri, 20 Mar 2015 14:05:48 -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> <20150320163027.GB3493@acm.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1426874779 10948 80.91.229.3 (20 Mar 2015 18:06:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 Mar 2015 18:06:19 +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 Fri Mar 20 19:06:12 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 1YZ1JA-0002lR-Uz for ged-emacs-devel@m.gmane.org; Fri, 20 Mar 2015 19:06:09 +0100 Original-Received: from localhost ([::1]:45027 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YZ1JA-0002SS-Ap for ged-emacs-devel@m.gmane.org; Fri, 20 Mar 2015 14:06:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37684) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YZ1Ix-0002P6-6y for emacs-devel@gnu.org; Fri, 20 Mar 2015 14:05:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YZ1Iu-0003gB-1k for emacs-devel@gnu.org; Fri, 20 Mar 2015 14:05:55 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:52437) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YZ1It-0003g1-Sf for emacs-devel@gnu.org; Fri, 20 Mar 2015 14:05:51 -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 t2KI5nxG005860; Fri, 20 Mar 2015 14:05:49 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id DF1A6E57; Fri, 20 Mar 2015 14:05:48 -0400 (EDT) In-Reply-To: <20150320163027.GB3493@acm.fritz.box> (Alan Mackenzie's message of "Fri, 20 Mar 2015 16:30:28 +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 RV5251=0 X-NAI-Spam-Version: 2.3.0.9393 : core <5251> : inlines <2454> : streams <1408713> : uri <1885724> 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:184051 Archived-At: >> 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. > Not really. CC Mode is quite capable of handling the Font Lock region > starting at BOL2. You yourself told me that the region had to start after the brace. > The problem is, when that starting point needs to be > after the brace on L2, Font Lock moves the starting point somewhere > else, fouling up the font locking. I'm confused: "somewhere else" is typically BOL2. Here you say this fouls up font-locking, but above you said CC-Mode is quite capable of handling a font-lock region starting at BOL2. > One place which is causing me puzzlement is in jit-lock-fontify-now. > It's this bit: As you know, jit-lock is irrelevant to those kinds of font-lock problems (in the sense that it's always possible to trigger the same problems without the use of jit-lock, tho it may require some time to figure out a triggering sequence). > The only way `start' can be before `orig-start' is on the first line of > the fl region, and start is moved to BOL. Why is it necessary to go to > all the expense of using `run-with-timer' rather than just fixing things > inside `jit-lock-fontify-now'? What is the use case? It's explained in the comment. Which part of the comment don't you understand? By the time jit-lock is called the redisplay up to orig-start has already been done (you can assume it's already drawn on the screen). Stefan