bug#81637: Regression: Tree-sitter font-lock drops highlighting in indirect buffers

James Cherti <[email protected]>
Newsgroups gmane.emacs.bugs
Message-ID <[email protected]>
On 2026-08-19 01:40, Yuan Fu wrote:
> 
> 
>> On Aug 17, 2026, at 3:59 AM, Eli Zaretskii <[email protected]> wrote:
>>
>>> Date: Sun, 16 Aug 2026 18:09:52 -0400
>>> From: James Cherti <[email protected]>
>>>
>>> There is a regression in tree-sitter where syntax
>>> highlighting is completely lost when creating an indirect
>>> buffer (via clone-indirect-buffer or C-x 4 c) from a base
>>> buffer running a tree-sitter major mode.
>>>
>>> This worked correctly in Emacs 29 but broke in the recent
>>> Emacs 31 and 32 changes.
>>>
>>> To reproduce:
>>>
>>> - Open a source file that uses a tree-sitter major mode.
>>> - Create an indirect buffer using
>>>    M-x clone-indirect-buffer (or 'C-x 4 c').
>>> - Observe that the syntax highlighting is entirely or
>>>    partially missing in the new indirect buffer.
>>
>> Thanks.  Yuan, could you please look into this?
> 
> Thanks for the CC. James, are you able to reproduce it with emacs -Q? Because I can’t reproduce it with either my personal Emacs session or emacs -Q. 🤔

Hello Yuan,

Yes, I can reproduce it with emacs -Q.

Please see the attached screenshot.

I used python-ts-mode in this example, but the bug also
occurs with other modes like yaml-ts-mode.

Here are the steps to reproduce the issue shown in the
screenshot:

- Open a Python file.
- Switch to python-ts-mode.
- Split the window to the right.
- Run M-x clone-indirect-buffer.
- Important: After cloning the file using
   clone-indirect-buffer, the initially displayed text is
   highlighted correctly. However, if you scroll down one to
   two pages, you will notice that the rest of the indirect
   buffer isn't highlighted.

> 
> Yuan
> 
> 

--
James Cherti
GitHub: https://github.com/jamescherti
Website: https://www.jamescherti.com/
screenshot-emacs-q.png (image/png, 313.7 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.