unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#59497: 29.0.50; Wrong type argument: number-or-marker-p, nil when enabling Tree Sitter in empty buffer
       [not found] <m1zgcia4kq.fsf.ref@yahoo.es>
@ 2022-11-23  0:37 ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-11-23  0:51   ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-11-23  1:33   ` Yuan Fu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 2 replies; 3+ messages in thread
From: Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-11-23  0:37 UTC (permalink / raw)
  To: 59497


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.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#59497: 29.0.50; Wrong type argument: number-or-marker-p, nil when enabling Tree Sitter in empty buffer
  2022-11-23  0:37 ` bug#59497: 29.0.50; Wrong type argument: number-or-marker-p, nil when enabling Tree Sitter in empty buffer Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-11-23  0:51   ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-11-23  1:33   ` Yuan Fu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-11-23  0:51 UTC (permalink / raw)
  To: 59497

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





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#59497: 29.0.50; Wrong type argument: number-or-marker-p, nil when enabling Tree Sitter in empty buffer
  2022-11-23  0:37 ` bug#59497: 29.0.50; Wrong type argument: number-or-marker-p, nil when enabling Tree Sitter in empty buffer Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-11-23  0:51   ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-11-23  1:33   ` Yuan Fu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 0 replies; 3+ messages in thread
From: Yuan Fu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-11-23  1:33 UTC (permalink / raw)
  To: Daniel Martín; +Cc: 59497-done


Daniel Martín <mardani29@yahoo.es> writes:

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





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-11-23  1:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <m1zgcia4kq.fsf.ref@yahoo.es>
2022-11-23  0:37 ` bug#59497: 29.0.50; Wrong type argument: number-or-marker-p, nil when enabling Tree Sitter in empty buffer Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-23  0:51   ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-23  1:33   ` Yuan Fu via Bug reports for GNU Emacs, the Swiss army knife of text editors

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).