From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: JD Smith Newsgroups: gmane.emacs.bugs Subject: bug#71384: treesit-font-lock-fontify-region unnecessarily re-unfontify's Date: Thu, 6 Jun 2024 07:35:03 -0400 Message-ID: <693DAC6E-26B2-4BA1-BA04-9F8F6F5C14EB@gmail.com> References: <1BA07683-10C0-4335-8C35-C260D049908B@gmail.com> <86jzj2iqi2.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.500.171.1.1\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31646"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Yuan Fu , 71384@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 06 13:36:59 2024 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 1sFBQR-00082U-9e for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 06 Jun 2024 13:36:59 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sFBQI-0005g7-Cm; Thu, 06 Jun 2024 07:36:50 -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 1sFBQG-0005fa-6C for bug-gnu-emacs@gnu.org; Thu, 06 Jun 2024 07:36:48 -0400 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 1sFBQF-0006vj-UV for bug-gnu-emacs@gnu.org; Thu, 06 Jun 2024 07:36:47 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sFBQU-0006nO-El for bug-gnu-emacs@gnu.org; Thu, 06 Jun 2024 07:37:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: JD Smith Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 06 Jun 2024 11:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71384 X-GNU-PR-Package: emacs Original-Received: via spool by 71384-submit@debbugs.gnu.org id=B71384.171767379726090 (code B ref 71384); Thu, 06 Jun 2024 11:37:02 +0000 Original-Received: (at 71384) by debbugs.gnu.org; 6 Jun 2024 11:36:37 +0000 Original-Received: from localhost ([127.0.0.1]:52584 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFBQ5-0006mk-Bn for submit@debbugs.gnu.org; Thu, 06 Jun 2024 07:36:37 -0400 Original-Received: from mail-oi1-f181.google.com ([209.85.167.181]:54394) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFBQ3-0006mV-Qp for 71384@debbugs.gnu.org; Thu, 06 Jun 2024 07:36:36 -0400 Original-Received: by mail-oi1-f181.google.com with SMTP id 5614622812f47-3d20961a467so446341b6e.0 for <71384@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) Original-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) In-Reply-To: <86jzj2iqi2.fsf@gnu.org> X-Mailer: Apple Mail (2.3774.500.171.1.1) 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:286685 Archived-At: > On Jun 6, 2024, at 1:34=E2=80=AFAM, Eli Zaretskii = wrote: >=20 >> From: JD Smith >> 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.