Subject: [bug#49946] [WIP PATCH v3 00/26] gnu: Add tree-sitter for emacs (and neovim as well?).

From: Maxime Devos <[email-masked]>
Date: Thu, 10 Mar 2022 16:34:14 +0100

Pierre Langlois schreef op do 10-03-2022 om 13:19 [+0000]:
> I'll see what can be done, sadly so far I couldn't find a way to do
> the right thing automatically for ocaml and typescript.  These are
> packages that provide two grammars, and I didn't see a way to
> "discover" that there are multiple languages supported.  [...] maybe
> by passing new #:keyword parameters.
> 
> Another idea could be to call back into the build-system phase, for
> example something like:
> 
> --8<---------------cut here---------------start------------->8---
> (replace 'build
>   (lambda _
>     (for-each (lambda (dir)
>                 (with-directory-excursion dir
>                   ((assoc-ref tree-sitter:%standard-phases 'build))))
>               '("ocaml" "interface"))))

I would go for a keyword argument (#:languages 'auto by default,
or an explicit list like #:languages '("ocaml" "interface") for when
autodetection does not work), since it seems more declarative and
conciser than overriding the build phase.

Greetings,
Maxime.