Subject: bug#59497: closed (Re: bug#59497: 29.0.50; Wrong type argument: number-or-marker-p, nil when enabling Tree Sitter in empty buffer)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 23 Nov 2022 08:29:05 +0000

Your bug report

#59497: 29.0.50; Wrong type argument: number-or-marker-p, nil when enabling Tree Sitter in empty buffer

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
59497: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=59497
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#59497: 29.0.50; Wrong type argument: number-or-marker-p, nil when enabling Tree Sitter in empty buffer
From: Yuan Fu <[email-masked]>
To: Daniel Martín <[email-masked]>
Cc: [email-masked]
Date: Tue, 22 Nov 2022 17:33:26 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

Daniel Martín <[email-masked]> writes:

> Daniel Martín via "Bug reports for GNU Emacs, the Swiss army knife of
> text editors" <[email-masked]> writes:
>
>> Steps to reproduce:
>>
>> emacs -Q
>> C-x b foo RET
>> M-x python-ts-mode RET
>>
>> Wrong type argument: number-or-marker-p is thrown.
>>
>> The bug seems to be in treesit-ready-p, specifically at:
>>
>> (> (position-bytes (1- (point-max))) treesit-max-buffer-size)
>>
>> This check fails if the buffer is empty.
>
> I think the correct check should be:
>
> (> (1- (position-bytes (point-max))) treesit-max-buffer-size)

Thanks, this should be fixed by c69858b3f0a.

Yuan

Subject: 29.0.50; Wrong type argument: number-or-marker-p, nil when enabling Tree Sitter in empty buffer
From: Daniel Martín <[email-masked]>
To: [email-masked]
Date: Wed, 23 Nov 2022 01:37:41 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Steps to reproduce:

emacs -Q
C-x b foo RET
M-x python-ts-mode RET

Wrong type argument: number-or-marker-p is thrown.

The bug seems to be in treesit-ready-p, specifically at:

(> (position-bytes (1- (point-max))) treesit-max-buffer-size)

This check fails if the buffer is empty.