From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#66732: tree-sitter fontification doesn't update multi-line syntax reliably Date: Wed, 20 Dec 2023 15:50:21 -0500 Message-ID: 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> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24627"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: dmitry@gutov.dev, casouri@gmail.com, 66732@debbugs.gnu.org, dominik@honnef.co To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 20 21:52:13 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 1rG3Y2-00068s-3s for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 20 Dec 2023 21:52:10 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rG3Xt-0000lN-7o; Wed, 20 Dec 2023 15:52:01 -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 1rG3Xr-0000kh-F7 for bug-gnu-emacs@gnu.org; Wed, 20 Dec 2023 15:51:59 -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 1rG3Xr-0000kk-52 for bug-gnu-emacs@gnu.org; Wed, 20 Dec 2023 15:51:59 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rG3Xu-0004b5-IJ for bug-gnu-emacs@gnu.org; Wed, 20 Dec 2023 15:52:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Dec 2023 20:52:02 +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.170310547317611 (code B ref 66732); Wed, 20 Dec 2023 20:52:02 +0000 Original-Received: (at 66732) by debbugs.gnu.org; 20 Dec 2023 20:51:13 +0000 Original-Received: from localhost ([127.0.0.1]:41914 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rG3X6-0004Zy-Kv for submit@debbugs.gnu.org; Wed, 20 Dec 2023 15:51:12 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:3364) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rG3X4-0004Zl-HC for 66732@debbugs.gnu.org; Wed, 20 Dec 2023 15:51:11 -0500 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id AD0C381851; Wed, 20 Dec 2023 15:51:01 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1703105460; bh=V55xT952dp81ccGsvmk0AZfmBIG4Z8TfQeM1ToAB06A=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=nSI1HcUTQGJYrcdvwc8qFBbMEu7DWujrE8BEFC2xgCctjf0z3BCLIfX9pIk3o07Li Sdk2/M4NjeXp9cpV10x0uOB8M1ZO6L3mat62X2P1lq+HnKHV/opn688cA3uMOQvU80 SPk1Q/j0BZDRsOkEPOPvUhLkGnyitRX1wCVkGcqzTvuRbjTsE4Aq5jEmZ3R/fZai+w YQbkG+QqfRRJJGlP/WW7hLgfy7uZUVGx1vJoDQ6rImaL3Z/hPFityhKzddvuZmGWIe HQvyayaCoZveNQu8dyJ5O8B4169lca7v3uZxoSZtyJvL+GTQhgFjP/DAY254Pp+1/z XJJlhJNkfYECA== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 8D43681821; Wed, 20 Dec 2023 15:51:00 -0500 (EST) Original-Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 7C2CB120DB9; Wed, 20 Dec 2023 15:51:00 -0500 (EST) In-Reply-To: <83il4uicux.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 19 Dec 2023 14:41:10 +0200") 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:276594 Archived-At: >> 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. Stefan