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: Thu, 03 Nov 2022 08:36:24 +0200 Message-ID: <83pme48ryv.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> <83mt9bc9ke.fsf@gnu.org> <8335b19ndr.fsf@gnu.org> <39ECD413-BD10-4BF3-90AC-36F02276607E@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="21180"; mail-complaints-to="usenet@ciao.gmane.io" Cc: jaopaulolc@gmail.com, emacs-devel@gnu.org To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Nov 03 07:37:20 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 1oqTqp-0005IV-Ba for ged-emacs-devel@m.gmane-mx.org; Thu, 03 Nov 2022 07:37:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oqTqC-0008W5-TD; Thu, 03 Nov 2022 02:36:40 -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 1oqTq7-0008VU-LZ for emacs-devel@gnu.org; Thu, 03 Nov 2022 02:36:36 -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 1oqTq7-0001xA-A3; Thu, 03 Nov 2022 02:36:35 -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=hUFgDGZpcXFMHSmrvlVX8GgKMfbVtqlMcYRvshaYfkc=; b=FDWG/fBPONVNxgoQ7/TW 3JL9Q13OKApXMvxbkMaGGDVothH2dgI66RNlQUXF+jPiduOVJiO3O1F93gpXy/6OYjGoR0O+KNn84 ZQrFHIO8szkAFrs6+jdqQF4yjwm1PvKKFA0HDKOuzTfmMKaJZsbs503mbODSsYW8imwpwjhK5/SdO OFn4q4BNoO96hCDQGHn7ImePOqUCs1gISCKigiOcEkFrV0AhKIjtF4oaIYbzsPZ26kz8DaA037nDJ OrJLSPtHP6Qgbp24cGslKsQST56KBjTKvlpz+9rwLw2raIY6rEQFXZ+PJddfeFDlOw7xc2K8AaK52 ytCIfQ5bq29gkw==; 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 1oqTq5-0001oo-3M; Thu, 03 Nov 2022 02:36:34 -0400 In-Reply-To: <39ECD413-BD10-4BF3-90AC-36F02276607E@gmail.com> (message from Yuan Fu on Wed, 2 Nov 2022 18:25:13 -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@gnu.org Xref: news.gmane.io gmane.emacs.devel:299060 Archived-At: > From: Yuan Fu > Date: Wed, 2 Nov 2022 18:25:13 -0700 > Cc: João Paulo Labegalini de Carvalho , > emacs-devel@gnu.org > > What I ended up doing is to set jit-lock-context-unfontify-pos to the beginning of the string node (aka beginning of region A). Then in a timer jit-lock-context will refontify everything after that position. And I have some measure to break possible infinite recursion (fontify region -> set jit-lock-context-unfontify-pos -> cause refontification -> fontify region -> …). OK, but beware of the case where region A is very large. Could performance suffer in such cases? Thanks.