From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org, casouri@gmail.com
Subject: Re: master c69858b3f0: ; * lisp/treesit.el (treesit-ready-p): Guard against empty buffers.
Date: Wed, 23 Nov 2022 09:57:38 -0500 [thread overview]
Message-ID: <jwvilj5919x.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <83cz9dzt8k.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 23 Nov 2022 15:38:03 +0200")
>> But my question was not so much pointing out a problem but trying to
>> understand why we chose the more complex code.
> Because we need to compare with byte positions,
Ah, because we wrote "(in bytes)" in the docstring of
`treesit-max-buffer-size`. That's a rather unusual choice. All other
places were we use(d) a limit on the buffer size it's always been based
on the number of chars.
I doubt it would make a significant difference here either (e.g. not
only the "10 times" memory use of the tree-sitter tree is obviously
a rough approximation, but I doubt it's related to the number of bytes
more than to the number of chars or even the number of lexemes).
Stefan
next prev parent reply other threads:[~2022-11-23 14:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <166916717199.12853.3816069320355351676@vcs2.savannah.gnu.org>
[not found] ` <20221123013252.46814C004B6@vcs2.savannah.gnu.org>
2022-11-23 1:51 ` master c69858b3f0: ; * lisp/treesit.el (treesit-ready-p): Guard against empty buffers Stefan Monnier
2022-11-23 2:18 ` Yuan Fu
2022-11-23 12:27 ` Eli Zaretskii
2022-11-23 12:40 ` Stefan Monnier
2022-11-23 13:38 ` Eli Zaretskii
2022-11-23 14:57 ` Stefan Monnier [this message]
2022-11-23 15:25 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvilj5919x.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=casouri@gmail.com \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.