From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#66732: tree-sitter fontification doesn't update multi-line syntax reliably Date: Sat, 23 Dec 2023 22:55:04 +0200 Message-ID: <89a10ce7-72a2-489d-a4cb-8d2445cc7e7a@gutov.dev> References: <878r7s5cdf.fsf@honnef.co> <83fs1tbou1.fsf@gnu.org> <835y1zo3rw.fsf@gnu.org> <2ce274aa-6d01-4d0a-b10c-07f821343fed@gmail.com> <50920549-006c-0153-2471-02e41a3dada7@gutov.dev> <8c7cd429-bdc3-4fac-ad1c-fbad793bf1a0@gmail.com> <231ebcd1-ec30-0432-82e7-d63e11cd65f7@gutov.dev> <765D713E-9923-4F66-9044-9D69C104C9B0@gmail.com> <33fe5d61-5022-67c5-6a65-babde4fb7f91@gutov.dev> <92CACD38-9534-4A07-8DE3-CE8408272FB6@gmail.com> <59CC46F7-867E-4C74-83EC-49B41DF0FAB8@gmail.com> <8fa0e506-6efc-57d4-6034-e938f97b1fb0@gutov.dev> <83plz3i9vv.fsf@gnu.org> <83o7emj2qd.fsf@gnu.org> <83il4uicux.fsf@gnu.org> <838r5ldxyy.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29882"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: casouri@gmail.com, 66732@debbugs.gnu.org, dominik@honnef.co To: Eli Zaretskii , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 23 21:56:10 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rH92X-0007Yt-3T for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 23 Dec 2023 21:56:09 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rH92L-0002XW-Hz; Sat, 23 Dec 2023 15:55:57 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rH92K-0002XN-QF for bug-gnu-emacs@gnu.org; Sat, 23 Dec 2023 15:55:56 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rH92K-0003iV-II for bug-gnu-emacs@gnu.org; Sat, 23 Dec 2023 15:55:56 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rH92P-0004MG-VD for bug-gnu-emacs@gnu.org; Sat, 23 Dec 2023 15:56:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Dec 2023 20:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66732 X-GNU-PR-Package: emacs Original-Received: via spool by 66732-submit@debbugs.gnu.org id=B66732.170336492216703 (code B ref 66732); Sat, 23 Dec 2023 20:56:01 +0000 Original-Received: (at 66732) by debbugs.gnu.org; 23 Dec 2023 20:55:22 +0000 Original-Received: from localhost ([127.0.0.1]:51312 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rH91m-0004LK-7G for submit@debbugs.gnu.org; Sat, 23 Dec 2023 15:55:22 -0500 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]:52375) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rH91j-0004L6-6W for 66732@debbugs.gnu.org; Sat, 23 Dec 2023 15:55:20 -0500 Original-Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailout.nyi.internal (Postfix) with ESMTP id 98BE15C0136; Sat, 23 Dec 2023 15:55:08 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Sat, 23 Dec 2023 15:55:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1703364908; x=1703451308; bh=zWnzKxvlYi0Tyxjocl2GmUknTzQqDqlaWNa9v06P0go=; b= lELuslbHrZcEdG5ZAvzwIE7E88awxMP4luXWccJheZY+A1viXLbtjKLY030tKnkP U+f5auRiHDvemaK8NserM4lMOGdp57OXocSIam5oS/01Dj/1WksjtfJD8VLLb7T3 2aIRZG8DgqR3Bl5s8CoBnMLehN6n/MzMGVpkSPwgLGSNJQ6uoi7lHjgteMjCoFov OD2n2MJg7ECzxiJo9TM2HgJvDtbTL8FEjiO5T/V1Ymqzo78plGyUkuY1nM5yXdJX QL8e9PRm35Q2ygZK2TY27vMP54F0QSN9/AmsSr3pHFaDS8QpXSz4ZGZYrENTI4ka ZKkeqV5soidyIfnI9n+nCQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1703364908; x= 1703451308; bh=zWnzKxvlYi0Tyxjocl2GmUknTzQqDqlaWNa9v06P0go=; b=C MAhK/bWv27VGWnUCFEovjp/6whQvDtclynQVMfEprMt9uYVu7Xjf3lhZyxGRe44i Riyz/7O/Jyim/rifavkyS5gAVnbMVfdWRAYd1aX2Ssj00Pm3R8UdQHyzIJk826My yOD1bkInNpkxbs2ywEkQqYb9oIvEAKZjxYJSFyp54u76Mrg6Hcjdfv0BCctQW9WL k40FwTj5BxFMJVfJxgMJpJhxEY+fZX2PydaTt4u3u+7N3W5bePFbaZd/PFjV4oN9 EZt3wp8VX8hSgNMhvGAgxOwzgezULFiwgtVB/Tuq3f9eukirccPwFa0DEb6jNyOP aUUg44DFP4oszN/GReS1A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdduledgudeghecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttddvjeenucfhrhhomhepffhm ihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrg htthgvrhhnpeetudeljeegheetgfehgeejkeeuhedvveeikeeufedtvddtveefhfdvveeg udejheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe gumhhithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 23 Dec 2023 15:55:06 -0500 (EST) Content-Language: en-US In-Reply-To: <838r5ldxyy.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:276770 Archived-At: On 23/12/2023 12:17, Eli Zaretskii wrote: >> From: Stefan Monnier >> Cc: dmitry@gutov.dev, 66732@debbugs.gnu.org, dominik@honnef.co, >> casouri@gmail.com >> Date: Wed, 20 Dec 2023 15:50:21 -0500 >> >>>> I think Dmitry is talking about the case where the faces were change >>>> after the text was rendered (but before the end of the redisplay cycle). >>>> >>>> I.e. the redisplay starts, renders up to position POS, then calls >>>> jit-lock because `fonfitied` is nil, and jit-lock modifies faces of text >>>> *before* POS. >>> >>> This can only happen if a function called from jit-lock doesn't comply >>> to the protocol wrt such changes, right? >> >> I'm talking about a problem in the interaction between the redisplay >> a jit-lock itself. >> >> Jit-lock is aware of it and uses `jit-lock-force-redisplay` as needed to >> account for it. >> >>> Because otherwise the modified region would have been re-rendered on >>> the next redisplay cycle at the latest. >> >> Yes, if the jit-lock client (e.g. font-lock) follows the protocol, then >> jit-lock should take care to re-render the regions when/where needed. >> >> *Except* that the implementation of `jit-lock-force-redisplay` is >> not effective and needs a change like the one suggested by Dmitry. > > So can we install that change and close this bug, then? That one-liner of mine was for a different feature which we ended up not using in the fix for this bug (font-lock-extend-region-functions).66732 I've pushed it to master now. Let me know if it should be backported.