From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#20146: font-lock-extend-jit-lock-region-after-change: results are discarded instead of being returned. Date: Sat, 21 Mar 2015 18:30:26 -0400 Message-ID: References: <20150319230136.GC2753@acm.fritz.box> <20150320160744.GA3493@acm.fritz.box> <20150321000003.GF3493@acm.fritz.box> <20150321210325.GC3001@acm.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1426977082 13314 80.91.229.3 (21 Mar 2015 22:31:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 21 Mar 2015 22:31:22 +0000 (UTC) Cc: 20146@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 21 23:31:11 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 1YZRvB-0003Jx-5T for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Mar 2015 23:31:09 +0100 Original-Received: from localhost ([::1]:49154 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YZRvA-00063Q-AY for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Mar 2015 18:31:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45034) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YZRv7-00063L-Ut for bug-gnu-emacs@gnu.org; Sat, 21 Mar 2015 18:31:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YZRv4-0001ha-Pd for bug-gnu-emacs@gnu.org; Sat, 21 Mar 2015 18:31:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42126) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YZRv4-0001hW-MS for bug-gnu-emacs@gnu.org; Sat, 21 Mar 2015 18:31:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YZRv4-0002RX-B6 for bug-gnu-emacs@gnu.org; Sat, 21 Mar 2015 18:31:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Mar 2015 22:31: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.14269770329350 (code B ref 20146); Sat, 21 Mar 2015 22:31:02 +0000 Original-Received: (at 20146) by debbugs.gnu.org; 21 Mar 2015 22:30:32 +0000 Original-Received: from localhost ([127.0.0.1]:60135 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YZRuZ-0002Qj-8V for submit@debbugs.gnu.org; Sat, 21 Mar 2015 18:30:31 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:45649) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YZRuV-0002Qa-BE for 20146@debbugs.gnu.org; Sat, 21 Mar 2015 18:30:27 -0400 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id t2LMUQuo001391; Sat, 21 Mar 2015 18:30:26 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 0D60CEC1; Sat, 21 Mar 2015 18:30:26 -0400 (EDT) In-Reply-To: <20150321210325.GC3001@acm.fritz.box> (Alan Mackenzie's message of "Sat, 21 Mar 2015 21:03: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 RV5252=0 X-NAI-Spam-Version: 2.3.0.9393 : core <5252> : inlines <2455> : streams <1409364> : uri <1886676> 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:100769 Archived-At: >> 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 are not under the major mode's control. What is under the major mode's control is how those bounds are extended by font-lock-extend-region-functions. > This is surely a bug. Nope. > As a better idea, why not have jit-lock-fontify-now use > f-l-extend-region-functions, and then pass the original `start' and > `next' to f-l-fontify-region. No, you have that backwards: it's f-l-fontify-region which runs f-l-extend-region-functions, specifically so that you don't need to care about what jit-lock (and other callers of f-l-fontify-region) might do (you just need to make sure that f-l-fontify-region works correctly for *any* bounds). >> But callers of font-lock-fontify-region (such as >> font-lock-after-change-function, or jit-lock) can choose *any* bounds >> they feel like and font-lock-fontify-region should behave correctly. > This seems to be true. When I (setq font-lock-support-mode nil), things > seem to behave properly. It seems a poor workaround, though. I don't see how what you say relates to what you quoted. Stefan