emacs-devel
[Top][All Lists]
Advanced

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

Re: emacs-tree-sitter and Emacs


From: Jorge Javier Araya Navarro
Subject: Re: emacs-tree-sitter and Emacs
Date: Mon, 30 Mar 2020 11:00:05 -0600

I see, so in your opinion having a central engine won't be a bad architecture design for Emacs despite major modes having their own engine.

I wonder: is possible for any other package to "take the wheel" from major modes when it comes to indentation or a better approach would be offering facilities for package authors and maintainers to outsource their indentation to this central tree-sitter-based indentation engine?

I'm trying to picture how this would look like.

El lun., 30 de mar. de 2020 a la(s) 08:11, Stefan Monnier (address@hidden) escribió:
> First off, in the issue tracker we have a ticket open for making this
> project available on GNU ELPA, Ubolonton seems willing to make that
> a reality

That would be neat.

> but this package has some special requirements that would make
> impossible to submit it to GNU ELPA or MELPA, for instance, we need to
> ship with grammars for some languages that require compiling and AFAIK
> there is no way to build external dependencies in *ELPA.[1]

Indeed, the GNU ELPA infrastructure is too weak to support such a thing
right now, but that's a problem we need to fix anyway, so it just means
we should work on it.

> Finally, I'm planning to tackle indentation for my next pull request.
> It come as a surprise that Emacs has no "central" indentation engine
> but that instead each major mode ships with its own indentation
> engine.

It's not so surprising if you think about it: indentation requires
parsing, so "a central indentation engine" requires something like
tree-sitter ;-)

SMIE is the closest there is so far (contrary to tree-sitter it uses
a very simple parsing strategy, which is just barely sufficient for
"typical" indentation cases).

CC-mode has another engine, which is used for several languages.

And finally, there's `wisi` on GNU ELPA, it aims to be very generic and
pretty flexible, but AFAIK it's only used by `ada-mode` so far.


        Stefan


reply via email to

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