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

Previous Next

Package: emacs;

Reported by: Daniel Martín <mardani29 <at> yahoo.es>

Date: Wed, 23 Nov 2022 00:39:02 UTC

Severity: normal

Found in version 29.0.50

Done: Yuan Fu <yuf011 <at> ucsd.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Yuan Fu <yuf011 <at> ucsd.edu>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#59497: closed (29.0.50; Wrong type argument: number-or-marker-p,
 nil when enabling Tree Sitter in empty buffer)
Date: Wed, 23 Nov 2022 08:29:05 +0000
[Message part 1 (text/plain, inline)]
Your message dated Tue, 22 Nov 2022 17:33:26 -0800
with message-id <46912021-BA6B-46E7-A933-542D1899D00B <at> ucsd.edu>
and subject line Re: bug#59497: 29.0.50; Wrong type argument: number-or-marker-p,  nil when enabling Tree Sitter in empty buffer
has caused the debbugs.gnu.org bug report #59497,
regarding 29.0.50; Wrong type argument: number-or-marker-p, nil when enabling Tree Sitter in empty buffer
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
59497: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=59497
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Daniel Martín <mardani29 <at> yahoo.es>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.50; Wrong type argument: number-or-marker-p, nil when enabling
 Tree Sitter in empty buffer
Date: Wed, 23 Nov 2022 01:37:41 +0100
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.


[Message part 3 (message/rfc822, inline)]
From: Yuan Fu <yuf011 <at> ucsd.edu>
To: Daniel Martín <mardani29 <at> yahoo.es>
Cc: 59497-done <at> debbugs.gnu.org
Subject: Re: bug#59497: 29.0.50; Wrong type argument: number-or-marker-p,  nil
 when enabling Tree Sitter in empty buffer
Date: Tue, 22 Nov 2022 17:33:26 -0800
Daniel Martín <mardani29 <at> yahoo.es> writes:

> Daniel Martín via "Bug reports for GNU Emacs, the Swiss army knife of
> text editors" <bug-gnu-emacs <at> gnu.org> 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


This bug report was last modified 2 years and 260 days ago.

Previous Next


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