Subject: bug#71384: treesit-font-lock-fontify-region unnecessarily re-unfontify's

From: Eli Zaretskii <[email-masked]>
Date: Thu, 06 Jun 2024 08:34:13 +0300

> From: JD Smith <[email-masked]>
> 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.