From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Initial fontification in sh-mode with tree-sittter Date: Tue, 01 Nov 2022 11:23:29 +0200 Message-ID: <83mt9bc9ke.fsf@gnu.org> References: <6C8B0F8E-DF61-4BC3-B0D0-56DBB66BE637@gmail.com> <7AE71CCA-6F18-4DE6-8608-7D9B3E9E52FB@gmail.com> <9BA853EA-8B7F-41A0-A174-D86DF5CE7788@gmail.com> <83sfj3cfl0.fsf@gnu.org> <03309451-1AEB-458C-88FD-9715CECC27A2@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14109"; mail-complaints-to="usenet@ciao.gmane.io" Cc: mardani29@yahoo.es, jaopaulolc@gmail.com, emacs-devel@gnu.org To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Nov 01 10:24:15 2022 Return-path: Envelope-to: ged-emacs-devel@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 1opnVG-0003Tw-M0 for ged-emacs-devel@m.gmane-mx.org; Tue, 01 Nov 2022 10:24:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opnUn-0002X5-Kn; Tue, 01 Nov 2022 05:23:45 -0400 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 1opnUm-0002Uw-3j for emacs-devel@gnu.org; Tue, 01 Nov 2022 05:23:44 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opnUl-00049E-Kw; Tue, 01 Nov 2022 05:23:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=/Oyn7IZsq0aqucav0QqFa/ea8QaFR5/VZHptMv6SR1Y=; b=oPJZ0gUCYj+vu/AqfLJN s5+wUOYRwuadqBDhLRgQgGty1CsUS+KdCbKOlSw/2kVXHMO5MrpvSRVZvOvsxNfnrKObjBCT7GPj+ br0c6iPu1E/NLa+2kQqlStv48qeYVDzK4T2paiv59pkhToj76NjBK3tqowBHhizEudnt2CwGHOmA3 vcEQFUw/HTnxLISkhzmU/PUeZJOgqHYO2/lvcV3csRFi+sv/nOs/qoqmmW/E7+a5PNx3SuH+XyZX1 fHK5lx6d+ZMDeJXfF+AbTTbvZBorHxfDCeYoc8fOOnsjlDuuqfIwPcZkuPrP/pZZnn/XCOk2E1Q1x p1+Fyxw0M7QnPw==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opnUk-0003iy-Ue; Tue, 01 Nov 2022 05:23:43 -0400 In-Reply-To: <03309451-1AEB-458C-88FD-9715CECC27A2@gmail.com> (message from Yuan Fu on Tue, 1 Nov 2022 01:35:25 -0700) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: "Emacs-devel" Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:298921 Archived-At: > From: Yuan Fu > Date: Tue, 1 Nov 2022 01:35:25 -0700 > Cc: Daniel Martín , > João Paulo Labegalini de Carvalho , > emacs-devel@gnu.org > > > > > On Nov 1, 2022, at 12:13 AM, Eli Zaretskii wrote: > > > >> From: Yuan Fu > >> Date: Mon, 31 Oct 2022 17:25:01 -0700 > >> Cc: João Paulo Labegalini de Carvalho , > >> emacs-devel@gnu.org > >> > >>> Curiously, as soon as I press C-l, the text gets fontified with the > >>> string face. > >> > >> I think that’s just jit-lock & redisplay doing funny stuff. If you set treesit--font-lock-verbose to t, it should log that appropriate faces are applied when you insert the quote. > > > > Which means you don't play by redisplay's rules in this case. When > > Lisp code changes faces, it should remove the 'fontified' property > > from the text where faces changed. Does your code do that? > > I thought 'fontified should be set to t, and it is done by jit-lock? I also thought changing the ‘face property should be enough to trigger redisplay, is that true? It should, but it doesn't in your case: the display engine is for some reason not aware that faces changed in some areas, so it doesn't redisplay those areas. You need to figure out why. Or show the code which does that, and someone else will help you understand that.