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: Fri, 20 Mar 2015 16:07:44 +0000 Message-ID: <20150320160744.GA3493@acm.fritz.box> References: <20150319230136.GC2753@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 1426867765 19929 80.91.229.3 (20 Mar 2015 16:09:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 Mar 2015 16:09:25 +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 Fri Mar 20 17:09:14 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 1YYzTz-000185-9s for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Mar 2015 17:09:11 +0100 Original-Received: from localhost ([::1]:44640 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYzTy-0001WF-8Q for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Mar 2015 12:09:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37064) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYzTu-0001W7-MV for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2015 12:09:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YYzTr-0008Ga-Em for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2015 12:09:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41290) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYzTr-0008GR-BG for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2015 12:09:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YYzTq-0001LE-Hj for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2015 12:09: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: Fri, 20 Mar 2015 16:09: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.14268676875086 (code B ref 20146); Fri, 20 Mar 2015 16:09:02 +0000 Original-Received: (at 20146) by debbugs.gnu.org; 20 Mar 2015 16:08:07 +0000 Original-Received: from localhost ([127.0.0.1]:59299 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YYzSw-0001Jy-OB for submit@debbugs.gnu.org; Fri, 20 Mar 2015 12:08:07 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:54057 helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YYzSu-0001Jo-Ie for 20146@debbugs.gnu.org; Fri, 20 Mar 2015 12:08:05 -0400 Original-Received: (qmail 47738 invoked by uid 3782); 20 Mar 2015 16:08:03 -0000 Original-Received: from acm.muc.de (pD951ACB9.dip0.t-ipconnect.de [217.81.172.185]) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 20 Mar 2015 17:08:02 +0100 Original-Received: (qmail 4220 invoked by uid 1000); 20 Mar 2015 16:07:44 -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:100708 Archived-At: Hello, Stefan. On Fri, Mar 20, 2015 at 10:20:24AM -0400, Stefan Monnier wrote: > > In font-lock-extend-jit-lock-region-after-change in font-lock.el, the > > new fontification region is calculated by funcalling > > font-lock-extend-after-change-region-function. The result of this > > funcall is assigned to internal variables beg and end. > > To return these values to the caller, they should be written to the > > dynamically bound variables jit-lock-start and jit-lock-end. This is > > only done in the case > > (memq 'font-lock-extend-region-wholelines > > font-lock-extend-region-functions) > > . It should be done in all cases. > I'm thinking of removing font-lock-extend-after-change-region-function > altogether anyway: cc-mode is the only user and it has a workaround in > place for when the "feature" is absent, so it's really just useless. Well, I've fixed it anyhow. I don't think you should remove f-l-exent-a-c-region-function. The only alternative is, as you say, a workaround, one that involves advising functions. Back in 2006 when the facility was implemented, the need to use advice was taken to be a deficiency in Emacs, a bug to be fixed. This particular bug was fixed. Also, the fact the only one package uses something is not a good reason to remove features. If it were, Emacs might well be a lot slimmer than it is. Right at the moment I am plagued by Font/Jit Lock's messing around with the font-lock region's start position. Despite CC Mode quite definitely setting this region (via the said font-lock-extend-after-change-region-function), Font/Jit Lock insists on starting at a different place, one with a different syntactic context. Perhaps we could implement the convention that when a major mode has positively set the font-lock region's start and end points, these should be accepted by F/J-lock, but when not, F/J-lock should be free to alter them (as it typically does now). The existence of font-lock-extend-after-change-region-function makes this distinction possible. > Stefan -- Alan Mackenzie (Nuremberg, Germany).