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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 59497 in the body.
You can then email your comments to 59497 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#59497; Package emacs. (Wed, 23 Nov 2022 00:39:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Daniel Martín <mardani29 <at> yahoo.es>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 23 Nov 2022 00:39:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#59497; Package emacs. (Wed, 23 Nov 2022 00:53:01 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Daniel Martín <mardani29 <at> yahoo.es>
To: Daniel Martín via "Bug reports for GNU Emacs, the Swiss
 army knife of text editors" <bug-gnu-emacs <at> gnu.org>
Cc: 59497 <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: Wed, 23 Nov 2022 01:51:52 +0100
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)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#59497; Package emacs. (Wed, 23 Nov 2022 00:53:02 GMT) Full text and rfc822 format available.

Reply sent to Yuan Fu <yuf011 <at> ucsd.edu>:
You have taken responsibility. (Wed, 23 Nov 2022 08:29:05 GMT) Full text and rfc822 format available.

Notification sent to Daniel Martín <mardani29 <at> yahoo.es>:
bug acknowledged by developer. (Wed, 23 Nov 2022 08:29:05 GMT) Full text and rfc822 format available.

Message #16 received at 59497-done <at> debbugs.gnu.org (full text, mbox):

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




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 21 Dec 2022 12:24:12 GMT) Full text and rfc822 format available.

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

Previous Next


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