GNU bug report logs - #71384
treesit-font-lock-fontify-region unnecessarily re-unfontify's

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: JD Smith <jdtsmith@HIDDEN>; Keywords: wontfix moreinfo; Done: Stefan Kangas <stefankangas@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
bug closed, send any further explanations to 71384 <at> debbugs.gnu.org and JD Smith <jdtsmith@HIDDEN> Request was from Stefan Kangas <stefankangas@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Added tag(s) wontfix. Request was from Stefan Kangas <stefankangas@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 71384 <at> debbugs.gnu.org:


Received: (at 71384) by debbugs.gnu.org; 9 Mar 2025 11:14:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 09 07:14:16 2025
Received: from localhost ([127.0.0.1]:58618 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1trEbo-00042U-KH
	for submit <at> debbugs.gnu.org; Sun, 09 Mar 2025 07:14:16 -0400
Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]:51360)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <stefankangas@HIDDEN>)
 id 1trEbl-000427-SE
 for 71384 <at> debbugs.gnu.org; Sun, 09 Mar 2025 07:14:14 -0400
Received: by mail-ed1-x535.google.com with SMTP id
 4fb4d7f45d1cf-5e61da95244so1409744a12.2
 for <71384 <at> debbugs.gnu.org>; Sun, 09 Mar 2025 04:14:13 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1741518847; x=1742123647; darn=debbugs.gnu.org;
 h=cc:to:subject:message-id:date:mime-version:references:in-reply-to
 :from:from:to:cc:subject:date:message-id:reply-to;
 bh=s5B2MoBs07dE9y+65S5RBJcqhQhrUMMzO9pe301taC8=;
 b=SCzSaMvJZLx8KT9vWABHfVylBqN6doydBZAodD/UVuYsoLaELJvrtyIKHs7nP1fM/M
 fME32ZHAHKzp1Et4DgUCcB6KL7Nl+yKH0DYkPmC3dxn0BaiGZqi1561u1QrVH9AXkoM7
 l7JMjO6MXl2YWPz22+2kbHUhTOOwdo0Y1XoGWy1CJ8CP40GN4/fSDNN7Sg7/91GFtzDy
 5xxuxzOyfe67Sb52dx/1I3vhgLrD+xo/Dz+TDVXwzQXxHLH0+ZhL7VNpTGISBjWWdzEl
 5j/6MCp2RZ6+3Ecb3XAstfj+IHLvhK/Avo9O/5OMxnSWhU8tGBcAo/lcTiFHdKL13GO7
 2PSQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1741518847; x=1742123647;
 h=cc:to:subject:message-id:date:mime-version:references:in-reply-to
 :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=s5B2MoBs07dE9y+65S5RBJcqhQhrUMMzO9pe301taC8=;
 b=k/HbxhmlD3w+mqwtDXFJ1GxVpf5U5/P1oFCI70l5r2oW9JFKlrzyV4MWgGGZx8Q+H/
 0U0M3483qBZM7ecsJmTqgwkPQeF5MB/rrRQ4L5ejYleklMecPRu4y6/+jhY0XRROuYN+
 XY+aMYnTFa1o++EdSurroU02QP0VnK8cbT/UGz2cI4/Sl/QIGpYl0meUoVUfnYqZ2oaT
 XDdEJT3PGoQhAHB+1Zxd75yu0x6E2ocjkkVvu/VSE1N5o7Wz6+TFOsOzgE6A9ijQh0bE
 35d7iZsN5N2qI4wxiIRfCafBAa8bhFnBF+Wd1W+x9IKGw08ltFUW3ZPhpzIklwgIL4jn
 rK0g==
X-Forwarded-Encrypted: i=1;
 AJvYcCXbq3XBw5oiKrdAgYa9dr0Pk28XNKCMRwrd4IOecbjQ7ebTH/URa9ohzS+EZGxaG73yxNtEmg==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YwWmD49MMZWoczgiDlYQVgMNmtVdD8KlQ8H1EbjPWLi6KRmmQxX
 2LpYNE0rOjeNzcLQ3ufMDYIbelv1b9Q1uUB/FccM6oA1GqoG+nmD3Bs3uUqSQ5ZFCrTduUUc5yZ
 X8xKRrhHHzNX5NFmbowXNPtSHg8k=
X-Gm-Gg: ASbGncuTnPS1wHYlqVXedS2LulGHB9qnEAyxKSroUEJBDCMgtNaXFVZi0gRVM3sp8P6
 VcGP3hIeAu9GcC8RWIeu4FPZGMqkU9/uhfukqzydw+5GU61SjkI7JppKnTID1OfbhZCwSvceMxr
 vvZMeQVdV9Fb0uRMdhimOaM2EKDyo=
X-Google-Smtp-Source: AGHT+IGtHVhYuIrmZuwbp1uFAxKT7DdUIK5/9ap5LL1c/SQ/NY+3VRpAwo1YRs8r1F23ZrpkIdeROMlfsYFsfNKYRuk=
X-Received: by 2002:a05:6402:1d54:b0:5de:aa54:dc30 with SMTP id
 4fb4d7f45d1cf-5e5e22989dcmr11316433a12.5.1741518847257; Sun, 09 Mar 2025
 04:14:07 -0700 (PDT)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Sun, 9 Mar 2025 07:14:06 -0400
From: Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: <5F90A53F-A1ED-4B85-8170-AFE3AC4B10EA@HIDDEN>
References: <1BA07683-10C0-4335-8C35-C260D049908B@HIDDEN>
 <86jzj2iqi2.fsf@HIDDEN> <693DAC6E-26B2-4BA1-BA04-9F8F6F5C14EB@HIDDEN>
 <CADwFkmn+0hrg-215KrqkAkKRuouWguiHHqLb0SfOs20byb8LiQ@HIDDEN>
 <5F90A53F-A1ED-4B85-8170-AFE3AC4B10EA@HIDDEN>
MIME-Version: 1.0
Date: Sun, 9 Mar 2025 07:14:06 -0400
X-Gm-Features: AQ5f1Jqf_1UxQ5Vq_a2rtudXUXYLRQt97BOTw1Oby12cD18KXDfsjMiNxwyMrpo
Message-ID: <CADwFkmnFPwtBpbYjH1w6t=DU01XUqdhem3_xa69dE6Nw1J0q=w@HIDDEN>
Subject: Re: bug#71384: treesit-font-lock-fontify-region unnecessarily
 re-unfontify's
To: Yuan Fu <casouri@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 71384
Cc: Eli Zaretskii <eliz@HIDDEN>, 71384 <at> debbugs.gnu.org,
 JD Smith <jdtsmith@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

tags 71384 wontfix
close 71384
thanks

Yuan Fu <casouri@HIDDEN> writes:

> I suggest we keep it. Unless a duplicate call actually impacts performance. The call helps with debugging: you can evaluate treesit-font-lock-fontify-region with M-x eval-expression to manually update fontification for a region.

OK, I'm therefore closing this as wontfix.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71384; Package emacs. Full text available.

Message received at 71384 <at> debbugs.gnu.org:


Received: (at 71384) by debbugs.gnu.org; 5 Mar 2025 15:04:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 05 10:04:33 2025
Received: from localhost ([127.0.0.1]:39040 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tpqIT-0004Ye-9S
	for submit <at> debbugs.gnu.org; Wed, 05 Mar 2025 10:04:33 -0500
Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]:51337)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <casouri@HIDDEN>) id 1tpqIO-0004Y1-Gg
 for 71384 <at> debbugs.gnu.org; Wed, 05 Mar 2025 10:04:29 -0500
Received: by mail-pl1-x636.google.com with SMTP id
 d9443c01a7336-223594b3c6dso121455965ad.2
 for <71384 <at> debbugs.gnu.org>; Wed, 05 Mar 2025 07:04:28 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1741187062; x=1741791862; darn=debbugs.gnu.org;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:from:to:cc:subject:date
 :message-id:reply-to;
 bh=l2OINa62E3Gd21RmKy0TSEpIEMA+0VRun/9mvV3k8xs=;
 b=N4R9sMwazJDhvbn8VPQXYnPwuWBqwoKFhIKsyWIHD0haqD6Zr74FAm8rODeuqebrvC
 GMXNJFTNZ1U78jT10VbwKeYiQ2DgSWwPlxhRZ+J076C+hAYbfq1vxSPde2ej8/vMSj3/
 JnBOoLFcEaXR98qjnxRM+RR973cR+MnuyENP3UoJSLWWubYKNUDu1P8RK7ghwp4jkTaA
 F63zGbfInkp65kZ7eEQTGTZiezMqLeDmnJP3nohc8heCyQboHhLv7Ad2J3vBGSk06Pkg
 5q6GmGYkR3j/PspW3WrdmvmXcqVrRM2E4TEqCWYdzZrxtlQm6PKq/aE+qti4DVbjYi33
 v4JA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1741187062; x=1741791862;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=l2OINa62E3Gd21RmKy0TSEpIEMA+0VRun/9mvV3k8xs=;
 b=i6VAsPQ7E/mvSI9sQyvMvXIY4yB13JIPnK+9XvJBVUkH2CeMNtFukfXwCBstPyk/ES
 ctUGsPXeCJcAD2AHopfAgMOaOBkfIZUAYIm1dEbrrO3/8ZzD/TrSeNQfDc0/L3LQqaLT
 ujHn/UCoC/OLf8BCuyin4mx1s/lA51bYUYRiJX/raj+mVRYOYeZLMy8LMPtTb65csRh5
 zi7VyjN3F1iYE4OBJdPzxtk7nC5meE8v9CyxdueYFsVoW8Wg5Qg2lMWoPxoNfTcWqtt4
 34fbXqlUsWzpgAFAvNk9kNdQ8NfoApWDm6SjVjmo9Oo0/hOGydEHmFaoGJ+spV/Vewdq
 zWgw==
X-Forwarded-Encrypted: i=1;
 AJvYcCV+KeLS6HeoOcXOMb1pHKFhyWbUzCnXh+APu1ED7ji+w325iUTVf7/B5agr4euE9UrXdktXVA==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YwPQHb5WbUNteGgf3yoYkTJEGNf6qy7lLYDmMQzD0xOEZ9SKiaS
 g4rejkHq0V8zI8nLt95Tt8GDUlc//Z8yEzgbtN4yRBDOi5hIUuIp
X-Gm-Gg: ASbGncttWs7/0tfZHp5SNHnuK/ckPGC/7p5B1Qo8+2rZlv9X9ynrtkBdapiswQjDp3B
 CqR+PLsgY4K+hCPviOMOAjPSa0sVDU+Sj8Lh+MRKMW3vnM8nzMqAQ0llYDIYhwamgsRnFRfdyRn
 KMTZZIDQwGJ0sJIo/2pjDcNsgOckK3tUmraFnW/rR2kXx7nw9BAxgLWF6wP1xgcEEZ2Ac4G/RCh
 Sn4aVkb8IX933DT5dyoJQ6d0/s/jVXRD+/niNQ0mfRRxoPdMa63QFw/eQq7lDNfEaJEvV5qh+ZU
 ZwvUQgfLT2y9phhgN3oAymwxHKt+JliLcKOSAm/n/fB6Tb57oCnkUVB1wnl/7XlEuhRS
X-Google-Smtp-Source: AGHT+IF0uG9CB3oqHcqh4lA0eQoOBY2VQXXW5zx2VE0Kx7kIGe7Emhf2WvSQQAftzjKEYiK1t7iIuw==
X-Received: by 2002:a17:902:e812:b0:223:5ca1:3b0e with SMTP id
 d9443c01a7336-223f1cd9571mr61049225ad.12.1741187061959; 
 Wed, 05 Mar 2025 07:04:21 -0800 (PST)
Received: from smtpclient.apple ([2601:646:8f81:6120:99d4:b80d:b1d4:1c3f])
 by smtp.gmail.com with ESMTPSA id
 d9443c01a7336-223f73f2e41sm12886495ad.113.2025.03.05.07.04.20
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Wed, 05 Mar 2025 07:04:21 -0800 (PST)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\))
Subject: Re: bug#71384: treesit-font-lock-fontify-region unnecessarily
 re-unfontify's
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <CADwFkmn+0hrg-215KrqkAkKRuouWguiHHqLb0SfOs20byb8LiQ@HIDDEN>
Date: Wed, 5 Mar 2025 07:04:09 -0800
Content-Transfer-Encoding: quoted-printable
Message-Id: <5F90A53F-A1ED-4B85-8170-AFE3AC4B10EA@HIDDEN>
References: <1BA07683-10C0-4335-8C35-C260D049908B@HIDDEN>
 <86jzj2iqi2.fsf@HIDDEN> <693DAC6E-26B2-4BA1-BA04-9F8F6F5C14EB@HIDDEN>
 <CADwFkmn+0hrg-215KrqkAkKRuouWguiHHqLb0SfOs20byb8LiQ@HIDDEN>
To: Stefan Kangas <stefankangas@HIDDEN>
X-Mailer: Apple Mail (2.3776.700.51)
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 71384
Cc: Eli Zaretskii <eliz@HIDDEN>, 71384 <at> debbugs.gnu.org,
 JD Smith <jdtsmith@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)



> On Feb 28, 2025, at 6:08=E2=80=AFPM, Stefan Kangas =
<stefankangas@HIDDEN> wrote:
>=20
> JD Smith <jdtsmith@HIDDEN> writes:
>=20
>>> On Jun 6, 2024, at 1:34=E2=80=AFAM, Eli Zaretskii <eliz@HIDDEN> =
wrote:
>>>=20
>>>> From: JD Smith <jdtsmith@HIDDEN>
>>>> Date: Wed, 5 Jun 2024 18:06:54 -0400
>>>>=20
>>>> The function treesit-font-lock-fontify-region in treesit.el calls
>>>> (font-lock-unfontify-region start end) right away (see below).  But =
this
>>>> function is called as the value of =
font-lock-fontify-syntactically-function
>>>> from font-lock-default-fontify-region, which has just itself made =
the exact
>>>> same call to font-lock-unfontify-region. I commented out that =
superfluous
>>>> call in treesit-font-lock-fontify-region and noticed no ill =
effects.
>>>=20
>>> Why is that duplicate call a problem?
>>=20
>> I don't know if it's ever really a problem, other than the small =
amount of time spent removing properties that have just been removed.
>>=20
>>> We don't say that treesit-font-lock-fontify-region _must_ be called =
_only_ from
>>> font-lock-default-fontify-region, do we?
>>=20
>>=20
>> I presume the same logic would apply to =
font-lock-fontify-keywords-region, but
>> that does not re-run unfontify (and is obviously much older code).  =
Maybe
>> treesit reuses treesit-font-lock-fontify-region in non-font-lock =
contexts?  Feel
>> free to close if Yuan concurs.
>=20
> Yuan, WDYT?  Should we do anything here, or should we close this?

I suggest we keep it. Unless a duplicate call actually impacts =
performance. The call helps with debugging: you can evaluate =
treesit-font-lock-fontify-region with M-x eval-expression to manually =
update fontification for a region.

Yuan=




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71384; Package emacs. Full text available.
Added tag(s) moreinfo. Request was from Stefan Kangas <stefankangas@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 71384 <at> debbugs.gnu.org:


Received: (at 71384) by debbugs.gnu.org; 1 Mar 2025 02:08:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 28 21:08:38 2025
Received: from localhost ([127.0.0.1]:55967 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1toCHO-0002JD-97
	for submit <at> debbugs.gnu.org; Fri, 28 Feb 2025 21:08:38 -0500
Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]:58531)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <stefankangas@HIDDEN>)
 id 1toCHM-0002Ig-5g
 for 71384 <at> debbugs.gnu.org; Fri, 28 Feb 2025 21:08:37 -0500
Received: by mail-ed1-x530.google.com with SMTP id
 4fb4d7f45d1cf-5e4f5cc3172so1802899a12.0
 for <71384 <at> debbugs.gnu.org>; Fri, 28 Feb 2025 18:08:36 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1740794910; x=1741399710; darn=debbugs.gnu.org;
 h=content-transfer-encoding:cc:to:subject:message-id:date
 :mime-version:references:in-reply-to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=wxXBWM59UFIe28C/dXS11ka3LvIxTnFo0qiATETtmDg=;
 b=I4LYr6/fIXzhwbRSuaIb6/YBnkFXrZrHlr0qW+bY5AwGTZKmVmHT0sP9MwpURjmoKa
 Kq5WlLZs4CuZQ0PcI8ATraHaGZK4HouAJgvx3zfyw/T02vg4P3ENF9LX06q5ngldS2kK
 BWmj4M3EQX51glg97xHmIuUpO/bmA1OVnKkKsM7nDfdHLbP60AzoWkdD8q1sdvJa/+rv
 lPx7I79t5ouDY/z/RJFBHJuqoQKr3vQ9nWl0EGIx3NCq5ImtTW4bJXg92M7jDzJh2AA4
 ns2c9y/+HlBcExnLk2jT5zB5RflB2JgMiuAfbhZgxwJ+EPF8ruKV5eA2I3NUDHld7m1I
 na+A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1740794910; x=1741399710;
 h=content-transfer-encoding:cc:to:subject:message-id:date
 :mime-version:references:in-reply-to:from:x-gm-message-state:from:to
 :cc:subject:date:message-id:reply-to;
 bh=wxXBWM59UFIe28C/dXS11ka3LvIxTnFo0qiATETtmDg=;
 b=e614Y7huro4e78oImwdFa1LOij5YIYly0wY2fAUxzZjCVaIwv8QgBph1R6SuquTZpZ
 JjTgLgc/2SRIsYxDOw2KFbCs2nKrcVT7R0/rswPKB6KFueuYJ+5P/LHzqCz+DOofCNS4
 2b/Goa5DHsFkvSHZQywNFLH+ywQqoCBX+EBkYC+s3OQ9nV0Hu/eHYGPUap8nPp7xDvkb
 49IQZeo1j70he796wpOZLS0tdyyJWd+B+A5BtpogBNPG5a8mWMvv3s5HUVNQ0qvUS5Xu
 blzGrfUGsk7WhUYDrTTzS3FT1fF7cdY0cx2GvfbI4vRjC/bPbBpznLD/72xom4vMeQZG
 e6dQ==
X-Forwarded-Encrypted: i=1;
 AJvYcCWDW0xk67uEbXGkUE40KxZHifbbgIAhKgvKHPU4/32lAq5MOrPWQewk9BbnOFNVJ8Qd5FHWYw==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YwvupPve9X7xmxWeSqgOHh2KubRsN8RgPwJ6NNYdcVIr+fqvRqk
 Pm4Ls5BJNjcslT3ejWaZvzoZyIlZXvEsh934oB+Hsh8LjV2yH8Sq61Toy9GXEixcXbuQYC68170
 A1GVd/od37VcMc7LXMUQvtjMP3dE=
X-Gm-Gg: ASbGnctumZM4x4mYLh82RUnUW7pw/QbTgh/n6PueMt7R9ZJhHbeJzffx2zTRfL8MGcd
 kdISYoSYOfEHkutXoXK62zlnlsZnL5e9h4BcBN4R4CmozOzx2aMu1pYWAA8p6/jG9n3xFUF2CxY
 +FvzZ8nWcMg+X65gext6YbLIZZwQs=
X-Google-Smtp-Source: AGHT+IHmosbePQL4iThiR+Junf5nLTAbVA7lIQpRX7ufAUb8G8fFe82J44r9Irfws75SifId1YXdZFdh/Y6d9nuXKI8=
X-Received: by 2002:a05:6402:254d:b0:5e0:8007:7497 with SMTP id
 4fb4d7f45d1cf-5e4d6af1682mr5177562a12.17.1740794909924; Fri, 28 Feb 2025
 18:08:29 -0800 (PST)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Fri, 28 Feb 2025 18:08:29 -0800
From: Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: <693DAC6E-26B2-4BA1-BA04-9F8F6F5C14EB@HIDDEN>
References: <1BA07683-10C0-4335-8C35-C260D049908B@HIDDEN>
 <86jzj2iqi2.fsf@HIDDEN> <693DAC6E-26B2-4BA1-BA04-9F8F6F5C14EB@HIDDEN>
MIME-Version: 1.0
Date: Fri, 28 Feb 2025 18:08:29 -0800
X-Gm-Features: AQ5f1JquhtsWbRyzsCtNhG0csXM26wROzKqjxkg_vaEIASecMf9NfZIrdlespVk
Message-ID: <CADwFkmn+0hrg-215KrqkAkKRuouWguiHHqLb0SfOs20byb8LiQ@HIDDEN>
Subject: Re: bug#71384: treesit-font-lock-fontify-region unnecessarily
 re-unfontify's
To: JD Smith <jdtsmith@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 71384
Cc: Eli Zaretskii <eliz@HIDDEN>, 71384 <at> debbugs.gnu.org,
 Yuan Fu <casouri@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

JD Smith <jdtsmith@HIDDEN> writes:

>> On Jun 6, 2024, at 1:34=E2=80=AFAM, Eli Zaretskii <eliz@HIDDEN> wrote:
>>
>>> From: JD Smith <jdtsmith@HIDDEN>
>>> Date: Wed, 5 Jun 2024 18:06:54 -0400
>>>
>>> The function treesit-font-lock-fontify-region in treesit.el calls
>>> (font-lock-unfontify-region start end) right away (see below).  But thi=
s
>>> function is called as the value of font-lock-fontify-syntactically-func=
tion
>>> from font-lock-default-fontify-region, which has just itself made the e=
xact
>>> same call to font-lock-unfontify-region. I commented out that superfluo=
us
>>> call in treesit-font-lock-fontify-region and noticed no ill effects.
>>
>> Why is that duplicate call a problem?
>
> I don't know if it's ever really a problem, other than the small amount o=
f time spent removing properties that have just been removed.
>
>> We don't say that treesit-font-lock-fontify-region _must_ be called _onl=
y_ from
>> font-lock-default-fontify-region, do we?
>
>
> I presume the same logic would apply to font-lock-fontify-keywords-region=
, but
> that does not re-run unfontify (and is obviously much older code).  Maybe
> treesit reuses treesit-font-lock-fontify-region in non-font-lock contexts=
?  Feel
> free to close if Yuan concurs.

Yuan, WDYT?  Should we do anything here, or should we close this?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71384; Package emacs. Full text available.

Message received at 71384 <at> debbugs.gnu.org:


Received: (at 71384) by debbugs.gnu.org; 6 Jun 2024 11:36:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jun 06 07:36:37 2024
Received: from localhost ([127.0.0.1]:52584 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sFBQ5-0006mk-Bn
	for submit <at> debbugs.gnu.org; Thu, 06 Jun 2024 07:36:37 -0400
Received: from mail-oi1-f181.google.com ([209.85.167.181]:54394)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jdtsmith@HIDDEN>) id 1sFBQ3-0006mV-Qp
 for 71384 <at> debbugs.gnu.org; Thu, 06 Jun 2024 07:36:36 -0400
Received: by mail-oi1-f181.google.com with SMTP id
 5614622812f47-3d20961a467so446341b6e.0
 for <71384 <at> debbugs.gnu.org>; Thu, 06 Jun 2024 04:36:21 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1717673715; x=1718278515; darn=debbugs.gnu.org;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:from:to:cc:subject:date
 :message-id:reply-to;
 bh=Pyc2sfgpGCJwggvNwmISmy5hHsTSEAfacw/I4bByE3c=;
 b=GdpD/U2pEu4/uIREzH+9FENUmEoB2n3Wl/Mm+NPy8jO9DJi9qHCUDdCDt5Wkv554gt
 VMwOla2SVJeCvl9npJRxNNsi07SPlB2FLL/gkYPzSe8hLVihS39zZzoRlKArtMY8D51s
 zRrax80fM3RytfpkqNgMb8fnGiCUmFtTD3JbLRU6FZcJbgB8epzQAsd33nXfnU3LN7HW
 zFGLBKVnG180RIF1kSAD2frXWG0PaVGd8aAJinZ4PUM0mBk1keLgl+aGaHdivP7M1uQn
 gZ3AX0K9SxDyUdDeVvk74dgN/Tbmj5/cqyIadPK175ot681F1G2+TyrTU67YzCVrAxdm
 MupA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1717673715; x=1718278515;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=Pyc2sfgpGCJwggvNwmISmy5hHsTSEAfacw/I4bByE3c=;
 b=prV4aVpAOg9jGacQ3PdGSv9Uo9owlr6k+Z2STeJ3WwguQgDYNz0EGytye+UNm7qnci
 LqawQFxgG7O0lH9OQrXN6rHciGMGqN8UN0PWfDAhzI8kaTyCNhdWqixQzo40tSSk2ZIn
 +xDDXU1fDJdtWddTxxxtfNgEXL5mkQKMyponKZFBZZMFPkfoZuyJEyedvK/pNvtaZq4o
 GqAM1wWoaagNfhTSRcx5PdBSq4qswRawiHmwq5XQG/Qi5620a169ClxrFs4LATahRRlv
 PxiS3nHG6YDT/xDQZEfrezpAxqqxN0OjNid499ODZJNCIGssXMmgWg0XrT4YvinuufZS
 Q5Aw==
X-Forwarded-Encrypted: i=1;
 AJvYcCWYkzAerYShdEoJvDQNb90vEs1Ol4p5l7+0B7JwGpnsrUHVyi+RFVHn2XXbBu1Z9P7po2zZKD6qv7e1sxnLpPwBG7Zjhoo=
X-Gm-Message-State: AOJu0YwV21RcJ3jGfWz1aw8hMSUmtgFe8Ul7zA5lplK3lGt+a27zT227
 ffd/eIY07McF/78T6jpDW9XyqpYQwrptBBiEePwOh5DIGJSFNL0N
X-Google-Smtp-Source: AGHT+IGBmWe2Lotft+tGgScZQIvKuiawWYyDXm57MinYjO7jcRNUUzfIdFVZrE/SiVd6rXC85+h7sg==
X-Received: by 2002:a05:6808:9a1:b0:3d1:e0d6:6499 with SMTP id
 5614622812f47-3d2043d123cmr5361814b6e.40.1717673715029; 
 Thu, 06 Jun 2024 04:35:15 -0700 (PDT)
Received: from smtpclient.apple (cm-24-53-187-34.buckeyecom.net.
 [24.53.187.34]) by smtp.gmail.com with ESMTPSA id
 6a1803df08f44-6b04f62164bsm5418406d6.3.2024.06.06.04.35.13
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Thu, 06 Jun 2024 04:35:14 -0700 (PDT)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.500.171.1.1\))
Subject: Re: bug#71384: treesit-font-lock-fontify-region unnecessarily
 re-unfontify's
From: JD Smith <jdtsmith@HIDDEN>
In-Reply-To: <86jzj2iqi2.fsf@HIDDEN>
Date: Thu, 6 Jun 2024 07:35:03 -0400
Content-Transfer-Encoding: quoted-printable
Message-Id: <693DAC6E-26B2-4BA1-BA04-9F8F6F5C14EB@HIDDEN>
References: <1BA07683-10C0-4335-8C35-C260D049908B@HIDDEN>
 <86jzj2iqi2.fsf@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
X-Mailer: Apple Mail (2.3774.500.171.1.1)
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 71384
Cc: Yuan Fu <casouri@HIDDEN>, 71384 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)



> On Jun 6, 2024, at 1:34=E2=80=AFAM, Eli Zaretskii <eliz@HIDDEN> =
wrote:
>=20
>> From: JD Smith <jdtsmith@HIDDEN>
>> Date: Wed, 5 Jun 2024 18:06:54 -0400
>>=20
>> The function treesit-font-lock-fontify-region in treesit.el calls =
(font-lock-unfontify-region start end) right away (see below).  But this =
function is called as the value of =
font-lock-fontify-syntactically-function from =
font-lock-default-fontify-region, which has just itself made the exact =
same call to font-lock-unfontify-region. I commented out that =
superfluous call in treesit-font-lock-fontify-region and noticed no ill =
effects.
>=20
> Why is that duplicate call a problem? =20

I don't know if it's ever really a problem, other than the small amount =
of time spent removing properties that have just been removed.

> We don't say that treesit-font-lock-fontify-region _must_ be called =
_only_ from
> font-lock-default-fontify-region, do we?


I presume the same logic would apply to =
font-lock-fontify-keywords-region, but that does not re-run unfontify =
(and is obviously much older code).   Maybe treesit reuses =
treesit-font-lock-fontify-region in non-font-lock contexts?  Feel free =
to close if Yuan concurs.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71384; Package emacs. Full text available.

Message received at 71384 <at> debbugs.gnu.org:


Received: (at 71384) by debbugs.gnu.org; 6 Jun 2024 05:40:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jun 06 01:40:20 2024
Received: from localhost ([127.0.0.1]:39580 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sF5rH-0007hf-Sv
	for submit <at> debbugs.gnu.org; Thu, 06 Jun 2024 01:40:20 -0400
Received: from eggs.gnu.org ([209.51.188.92]:38680)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1sF5lr-0007WL-4h
 for 71384 <at> debbugs.gnu.org; Thu, 06 Jun 2024 01:34:43 -0400
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 <eliz@HIDDEN>)
 id 1sF5lX-0008Sg-4L; Thu, 06 Jun 2024 01:34:23 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=g2P0hbrm2awXx+/bOGRZpJx4NPxu5WXAb59nTav+R5c=; b=i6IDRZrwULM1
 7xS4Fu8K8uJ9yZKbfCWc4OrzeoNGZFDKk8RymSzcvCQUuohRbKnQg94Yl42HhUOzH31CGkIfDPHnR
 yxh7kjcfQrJpSFoJdPmiXmoSEXRbscd1rEL2TLn/bnSJXDe64/ZuXiogYOZwuoF9KfCqVzlrpbeSo
 qwqO0kOqMHIKbECb7IHph5BUtBn/dHcQsrdzan0NZlv3iIePz2FIbuUEBNY+QPJGbSjV7bZMQsjY6
 yEWWm7nO0nrTLEPLZoZsm2SjwtrsG77KmGKZsPFhHSSdapNPCpc1NTv7LauVV5oMaz4pjsGuqS0xT
 2WDl0w9/M9DbkDVKUsRdmA==;
Date: Thu, 06 Jun 2024 08:34:13 +0300
Message-Id: <86jzj2iqi2.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: JD Smith <jdtsmith@HIDDEN>, Yuan Fu <casouri@HIDDEN>
In-Reply-To: <1BA07683-10C0-4335-8C35-C260D049908B@HIDDEN> (message from JD
 Smith on Wed, 5 Jun 2024 18:06:54 -0400)
Subject: Re: bug#71384: treesit-font-lock-fontify-region unnecessarily
 re-unfontify's
References: <1BA07683-10C0-4335-8C35-C260D049908B@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 71384
Cc: 71384 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: JD Smith <jdtsmith@HIDDEN>
> Date: Wed, 5 Jun 2024 18:06:54 -0400
> 
> The function treesit-font-lock-fontify-region in treesit.el calls (font-lock-unfontify-region start end) right away (see below).  But this function is called as the value of font-lock-fontify-syntactically-function from font-lock-default-fontify-region, which has just itself made the exact same call to font-lock-unfontify-region. I commented out that superfluous call in treesit-font-lock-fontify-region and noticed no ill effects.

Why is that duplicate call a problem?  We don't say that
treesit-font-lock-fontify-region _must_ be called _only_ from
font-lock-default-fontify-region, do we?

Adding Yuan in case he has comments.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71384; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 5 Jun 2024 22:55:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jun 05 18:55:48 2024
Received: from localhost ([127.0.0.1]:44576 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sEzXo-0006ro-Kc
	for submit <at> debbugs.gnu.org; Wed, 05 Jun 2024 18:55:48 -0400
Received: from lists.gnu.org ([209.51.188.17]:60698)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jdtsmith@HIDDEN>) id 1sEzXm-0006re-SF
 for submit <at> debbugs.gnu.org; Wed, 05 Jun 2024 18:55:47 -0400
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 <jdtsmith@HIDDEN>)
 id 1sEymo-0001AT-SV
 for bug-gnu-emacs@HIDDEN; Wed, 05 Jun 2024 18:07:14 -0400
Received: from mail-qv1-xf31.google.com ([2607:f8b0:4864:20::f31])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <jdtsmith@HIDDEN>)
 id 1sEymm-0005q0-Q3
 for bug-gnu-emacs@HIDDEN; Wed, 05 Jun 2024 18:07:14 -0400
Received: by mail-qv1-xf31.google.com with SMTP id
 6a1803df08f44-6ad8344825cso1289506d6.0
 for <bug-gnu-emacs@HIDDEN>; Wed, 05 Jun 2024 15:07:07 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1717625226; x=1718230026; darn=gnu.org;
 h=to:date:message-id:subject:mime-version:content-transfer-encoding
 :from:from:to:cc:subject:date:message-id:reply-to;
 bh=J4ZgHfJ3S4vSRZHJxQn8J1/cjmmSpZXmXBpF/6tU6pk=;
 b=jolasxwD1FDm6/gNdX2xGEc5bkEKkb4lORFoofwej9NJUVjPqBd8GbprZWgUlQe3BQ
 puzfoPIb/G+TSYp5CP1ye001rQXc9PvuBCPRwBqGd/1/SLJAo73cUOUKzgIw0RMMbXlG
 2JVMLngt3p7yqB+lR8qeEQkLRWPzrI+SOONZgprJLxRUajwfQs+DjOyJP6m1tY/RRzwg
 WQ6ThP2z+SVsA6LYIipSCsvrYh8pvCcIuhfJ0b/xTQ/10rsCO6CRuK0X3DeTAkUOEYD0
 IQ7fmYDDSyqycGQrk9t+z/CvH5ljH3MRRjq/ocnnlFxecrD7acjb/EDLa7JO6ZvNu90M
 Mv2A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1717625226; x=1718230026;
 h=to:date:message-id:subject:mime-version:content-transfer-encoding
 :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=J4ZgHfJ3S4vSRZHJxQn8J1/cjmmSpZXmXBpF/6tU6pk=;
 b=l7qQxQ5TVxkhhoyeH66BQTw673KhIf4skLYeaihW9PRIHkOqDMID9N64WPWyu3zMJZ
 7GJvlbd+d7IbMe/wsFstVBM/RSyWxQKF6nulDMBUeRRWtcmQhzdEbCDOglrozkqs054b
 xBfmEqXh9c1Mz+Bo5LQsIWwkSYYNpWjS/+SrmiUFJjC7afFR8LYtzL3kwNU2KhowRos0
 nIZ4CQLuLFqQtERZB/nEo2er5rMQO6yiOTHy5chNKP7HrgF7ODU6NVkKh83KkDfLzGY6
 kpsHWom3FdwwYNpKXeXiPtWRmSJlYxxs9AahxVCJ3/tGcWg/fHrwuv++fVDRzdsHSaV6
 zcDw==
X-Gm-Message-State: AOJu0YwNltsz+vwl/t8LYJhHP6dPWAYsf7Zew8D8KVwaaKOinccJRlA0
 oO6RNaMe6Ac3y1OaUW5Nx5tbqQHpEKJx1DF3r7KCLNSduH3mftgbNt840g==
X-Google-Smtp-Source: AGHT+IHlFqauQ/XwOtTVtr/AruJvBLo6LScw3vAKRzerElZYUASnUCI875zhfztbKh0LcaPEgzJhKg==
X-Received: by 2002:a05:6214:3b89:b0:6af:5257:9d1b with SMTP id
 6a1803df08f44-6b031cecf16mr34239946d6.64.1717625226367; 
 Wed, 05 Jun 2024 15:07:06 -0700 (PDT)
Received: from smtpclient.apple ([131.183.131.33])
 by smtp.gmail.com with ESMTPSA id
 6a1803df08f44-6b04f62518csm147856d6.26.2024.06.05.15.07.04
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Wed, 05 Jun 2024 15:07:04 -0700 (PDT)
From: JD Smith <jdtsmith@HIDDEN>
Content-Type: text/plain;
	charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.500.171.1.1\))
Subject: treesit-font-lock-fontify-region unnecessarily re-unfontify's
Message-Id: <1BA07683-10C0-4335-8C35-C260D049908B@HIDDEN>
Date: Wed, 5 Jun 2024 18:06:54 -0400
To: bug-gnu-emacs@HIDDEN
X-Mailer: Apple Mail (2.3774.500.171.1.1)
Received-SPF: pass client-ip=2607:f8b0:4864:20::f31;
 envelope-from=jdtsmith@HIDDEN; helo=mail-qv1-xf31.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

The function treesit-font-lock-fontify-region in treesit.el calls =
(font-lock-unfontify-region start end) right away (see below).  But this =
function is called as the value of =
font-lock-fontify-syntactically-function from =
font-lock-default-fontify-region, which has just itself made the exact =
same call to font-lock-unfontify-region. I commented out that =
superfluous call in treesit-font-lock-fontify-region and noticed no ill =
effects.

(defun treesit-font-lock-fontify-region (start end &optional loudly)
  "Fontify the region between START and END.
If LOUDLY is non-nil, display some debugging information."
  (when (or loudly treesit--font-lock-verbose)
    (message "Fontifying region: %s-%s" start end))
  (treesit-update-ranges start end)
  (font-lock-unfontify-region start end)=




Acknowledgement sent to JD Smith <jdtsmith@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#71384; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 9 Mar 2025 11:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.