emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reliable after-change-functions (via: Using incremental parsing in E


From: Jorge Javier Araya Navarro
Subject: Re: Reliable after-change-functions (via: Using incremental parsing in Emacs)
Date: Wed, 1 Apr 2020 09:47:48 -0600

> Did you consider using the API where an application can provide a function to return text at a given offset?  Such a function could be relatively easily implemented for Emacs.

But why not just allow access to buffers for dynamic modules, otherwise what would be the point of dynamic modules?

El mié., 1 de abr. de 2020 a la(s) 07:26, Eli Zaretskii (address@hidden) escribió:
> From: Tuấn Anh Nguyễn <address@hidden>
> Date: Wed, 1 Apr 2020 13:17:42 +0700
> Cc: address@hidden
>
> Real usage with "xdisp.c":
>
>     (define-advice tree-sitter--do-parse (:around (f &rest args) benchmark)
>       (message "%s" (benchmark-run (apply f args))))
>
>     (0.257998 1 0.13326100000000096)

And that is even without encoding the buffer text, IIUC what the
package does.

> So yes, direct access to buffer's text from dynamic modules would be nice.

Did you consider using the API where an application can provide a
function to return text at a given offset?  Such a function could be
relatively easily implemented for Emacs.

Btw, what do you do with the tree returned by the tree-sitter parser?
store it in some buffer-local variable?  If so, how much memory does
such a tree take, and when, if ever, is that memory released?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]