From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#20146: font-lock-extend-jit-lock-region-after-change: results are discarded instead of being returned. Date: Wed, 25 Mar 2015 17:12:05 +0000 Message-ID: <20150325171204.GA3833@acm.fritz.box> References: <20150319230136.GC2753@acm.fritz.box> <20150320160744.GA3493@acm.fritz.box> <20150321000003.GF3493@acm.fritz.box> <20150321210325.GC3001@acm.fritz.box> <20150322141335.GA3053@acm.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1427303603 20234 80.91.229.3 (25 Mar 2015 17:13:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 25 Mar 2015 17:13:23 +0000 (UTC) Cc: 20146@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Mar 25 18:13:12 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1Yaore-0006Hn-Tq for geb-bug-gnu-emacs@m.gmane.org; Wed, 25 Mar 2015 18:13:11 +0100 Original-Received: from localhost ([::1]:40332 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yaore-0005fU-1d for geb-bug-gnu-emacs@m.gmane.org; Wed, 25 Mar 2015 13:13:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50054) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaorZ-0005f9-VF for bug-gnu-emacs@gnu.org; Wed, 25 Mar 2015 13:13:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YaorW-00019F-RG for bug-gnu-emacs@gnu.org; Wed, 25 Mar 2015 13:13:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:46785) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaorW-00019B-Np for bug-gnu-emacs@gnu.org; Wed, 25 Mar 2015 13:13:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YaorW-000474-AH for bug-gnu-emacs@gnu.org; Wed, 25 Mar 2015 13:13:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 25 Mar 2015 17:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20146 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20146-submit@debbugs.gnu.org id=B20146.142730354515763 (code B ref 20146); Wed, 25 Mar 2015 17:13:02 +0000 Original-Received: (at 20146) by debbugs.gnu.org; 25 Mar 2015 17:12:25 +0000 Original-Received: from localhost ([127.0.0.1]:36561 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yaoqv-00046A-9X for submit@debbugs.gnu.org; Wed, 25 Mar 2015 13:12:25 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:64629 helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yaoqs-00045z-Kq for 20146@debbugs.gnu.org; Wed, 25 Mar 2015 13:12:23 -0400 Original-Received: (qmail 52862 invoked by uid 3782); 25 Mar 2015 17:12:21 -0000 Original-Received: from acm.muc.de (pD9519387.dip0.t-ipconnect.de [217.81.147.135]) by colin.muc.de (tmda-ofmipd) with ESMTP; Wed, 25 Mar 2015 18:12:19 +0100 Original-Received: (qmail 5034 invoked by uid 1000); 25 Mar 2015 17:12:05 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:100925 Archived-At: Hello, Stefan. On Sun, Mar 22, 2015 at 10:01:53PM -0400, Stefan Monnier wrote: > >> >> The major mode sets font-lock-extend-region-function and this functions' > >> >> result should be (and is) respected by the rest of font-lock. > >> > If only, but this is simply not the case at the moment. > >> > jit-lock-fontify-now has a hard-coded extension to whole lines, > >> > regardless of the contents of font-lock-extend-region-functions. > >> There's no relationship between the two. The bounds that > >> font-lock-fontify-region [gets] are not under the major mode's control. > > Yes they are. They can be set by > > font-lock-extend-after-change-region-function, as described in the elisp > > manual. > That's where you're confused: > font-lock-extend-after-change-region-function affects the region that's > declared as "in need of refresh because of a change". But that doesn't > mean that this region will then be passed to font-lock-fontify-region. > For example, if that region is not currently visible in any window, then > jit-lock will typically do nothing. And if only some part of that > region is visible in a window, then maybe only that part will be then > passed to font-lock-fontify-region so as to actually refresh it. > And maybe that part will be combined with some other parts that were > also in need of refresh and are now newly visible. Or maybe that part > will actually be fontified in several steps (i.e. several calls to > font-lock-fontify-region). Yes, I was confused about that. I hope I've got it now. Thanks for the help. [ ... ] > > Looking more critically at jit-lock-fontify-now, there is simply no need > > for it to expand the region to whole lines. > I agree with this statement (I actually have such a change in my local > tree), but that won't help you. > Looking at jit-lock as the source of your pain is a waste of time. OK. But I have to be aware of how jit-lock works: in particular how the actions in after-change-functions influence those of jit-lock-fontify-now and font-lock-fontify-region. [ ... ] > Stefan -- Alan Mackenzie (Nuremberg, Germany).