From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Colascione 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 18:06:55 -0700 Message-ID: <550CC42F.7050302@dancol.org> References: <20150319230136.GC2753@acm.fritz.box> <20150320160744.GA3493@acm.fritz.box> <20150321000003.GF3493@acm.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="1pJ7t7xQwf9ks3rT55p6OcQo0d09s2L6J" X-Trace: ger.gmane.org 1426900118 22826 80.91.229.3 (21 Mar 2015 01:08:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 21 Mar 2015 01:08:38 +0000 (UTC) Cc: 20146@debbugs.gnu.org To: Alan Mackenzie , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 21 02:08:27 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 1YZ7ti-000615-KR for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Mar 2015 02:08:18 +0100 Original-Received: from localhost ([::1]:46238 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YZ7tc-0007S4-G5 for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Mar 2015 21:08:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50894) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YZ7tX-0007Rn-ET for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2015 21:08:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YZ7tS-0006oJ-Dq for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2015 21:08:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41429) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YZ7tS-0006o9-6g for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2015 21:08:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YZ7tR-0002gb-Rd for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2015 21:08:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Colascione Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Mar 2015 01:08:01 +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.142690002610244 (code B ref 20146); Sat, 21 Mar 2015 01:08:01 +0000 Original-Received: (at 20146) by debbugs.gnu.org; 21 Mar 2015 01:07:06 +0000 Original-Received: from localhost ([127.0.0.1]:59438 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YZ7sX-0002fA-HE for submit@debbugs.gnu.org; Fri, 20 Mar 2015 21:07:05 -0400 Original-Received: from dancol.org ([96.126.100.184]:35746) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YZ7sV-0002f1-AB for 20146@debbugs.gnu.org; Fri, 20 Mar 2015 21:07:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Type:In-Reply-To:References:Subject:CC:To:MIME-Version:From:Date:Message-ID; bh=Zgrcv48HxTTNTlV08OTjNk8RBr9uDqBJcFvobx+674U=; b=NEIInHxpvtkxoWnDf7bZww9YqnI7+sneyhwRtMLIp1GJNz+wU+jn+gW9Cut9/shJei7+a/qFMwyBuC1iJ0cAT5nHNIF+yppQ2mJQtQp0izxdGG5o21q5L3qrYcB0IWaoojb73DBzP/8jHgmXcyYzjC74+EFfH28RFaEAhfkyv158tOzcEQftfJtumMydWB88ETDeJ9mcooP7igWJRuoaZ0G2oxcDO8b4bWEOXqVJGBT4SOONMwMeMEvAmOsTxMN+aio3i7EXTNsHvlAlPPTbgPvPQkbRAChEwJKGhX5SYZVQLK9tAvKOijdn/Sza/MPzo3SXmcfvFPzjFdZZcRRt/w==; Original-Received: from [2620:10d:c083:1004:56ee:75ff:fe20:83dc] by dancol.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84) (envelope-from ) id 1YZ7sT-00088o-1T; Fri, 20 Mar 2015 18:07:01 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 In-Reply-To: <20150321000003.GF3493@acm.fritz.box> 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:100730 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --1pJ7t7xQwf9ks3rT55p6OcQo0d09s2L6J Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 03/20/2015 05:00 PM, Alan Mackenzie wrote: >> The existence of font-lock-extend-after-change-region-function is an >> error on my part (More specifically the result of a weakness on my par= t: >> when you requested this feature, I added >> font-lock-extend-region-function (which was the right fix) and >> reluctantly accepted to also add >> font-lock-extend-after-change-region-function just out of tiredness of= >> arguing that it was the wrong solution). >=20 > Yes, it was an exhausting discussion back in 2006. But > f-l-extend-after-change-r-f works well. If you change the interface to= > have only font-lock-extend-region-functions, then you rule out what > somebody (was it Daniel?) recently called "edge triggered" fontificatio= n, > leaving only "level triggered". >=20 > AWK Mode (if not others) uses edge triggered fontification: For the > calculation of its FL region, it uses `beg' and `end' from > before-change-functions and `beg', `end', and `old-len' from > after-change-functions. If f-l-extend-after-change-r-f vanishes, some > other means will have to be found to transmit this info to Font Lock - > the ugly advice used by earlier Emacs versions, for example. Level-triggered fontification is the only correct scheme. You don't need fine-grained control over the font-lock region. You need better cache invalidation. Font-lock can ask for the right to ask for the fontification of any range of characters. If I want to, I can install customization that changes the font-lock region to a whole paragraph, a whole defun, or a whole file. None of that should matter. Some modes might have caches that reflect buffer contents --- they should invalidate these caches in before- and after-change-functions, before font-lock even runs. Let me put it another way: a highlighter's job is to find the correct face for a given buffer position. In order to not drive the user insane, that face must be a function solely of the contents of the buffer and cached information about the contents of the buffer. Otherwise, fontification will change depending on scrolling, jit-lock chunk size, and other factors. None of these things should affect the faces that we ultimately apply to characters. Maybe we should have some tests that do fontification one character at a time, or in random order. --1pJ7t7xQwf9ks3rT55p6OcQo0d09s2L6J Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCAAGBQJVDMQvAAoJEN4WImmbpWBlFVIQAKL1SNo+3jTlNZM5iTGO1YuK LWMsAq2F9vPu3+XAHxzLkWyU/k7xeQyCF3qEyPc0NYcHU4BJx9/flrWsOCcHhxsW bA2N2Zm9Vnlg3F1bbKIwKYtMAoGaWBkDk8Nz/8fD9bCCtx4bPF6rQEcYqtNbv9Bl nUUjaW7A298ebi30TaGf9hkwYvMIJGph65kstFM2j/l0nu758kneqkUiXx9DqljE fQrXvTBBWd0Mrp1VOl18nW6R3jcWDbjarIsPxxURX3flbe+7EkDbDP6DiQSxhUA6 byzX5ed5Va6suZpc5fMyGYfNkXdg2J2xajkKyacqgOjsu28UYkoiWt/ayL73aybr yVZ0ugQX3f9nNa+DtY7GOAIGlPCgrzZ4BqqwPoi4JnmbSVgiWyTkKYl8IUCVzZJ/ uPczjvyJN5f6+KgpeSwl9w2P7F90EQ9Nam/8RfzHp8C8WCjQ4uCbri4yrmyrWjL2 Sx88rP8gx9wfp/FKC2Lgbl3y/AD04gIebA+qzvxRMtX5S35WvQVrcCuOiIuJNOZ4 tewe9o5nZ6OaKwCmdB6tt53MWmXhICma4y0d2X0fK5QpoqQVHa0qioFRmD5n8xv2 1A+65Ps4a1lEmSPtLEXzA2KRDslahlISPL96xe9nIHNk/7XQxpN6pyoh7pkNlxZW xi6PD3EB1ROXWHe4IlKY =okJ2 -----END PGP SIGNATURE----- --1pJ7t7xQwf9ks3rT55p6OcQo0d09s2L6J--