|
From: | Clément Pit-Claudel |
Subject: | Re: Tree-sitter integration on feature/tree-sitter (severe performance issues together with linum-mode) |
Date: | Mon, 5 Sep 2022 19:53:26 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 |
On 8/20/22 07:14, Stefan Monnier wrote:
FWIW, I think specifying the highlighting rules with something akin to: (defvar <foo> '<rules>) is a mistake. It should go through some kind of macro, such as (maybe): (defvar <foo> (tree-sitter-rules <rules>)) which can thus do any preprocessing we may want, such as pre-compiling queries. It also helps evolve the syntax since we can more easily warn about obsolete uses, etc... I've had a "rewrite font-lock.el so the rules go through a macro" in my todo list for ages.
We do things this way in Flycheck, but we've been bitten a few times by the way this pattern interacts with `with-eval-after-load`, so I would be careful about adopting this pattern in tree-sitter (unless we expect it to be preloaded). In fact, I think your suggestion back then was to *not* use a macro? I can't find the exact thread, but this is close enough: https://lists.gnu.org/archive/html/emacs-devel/2018-02/msg00820.html :)
[Prev in Thread] | Current Thread | [Next in Thread] |