bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#74610: 31.0.50; Submitting mhtml-ts-mode, treesitter alternative to


From: Vincenzo Pupillo
Subject: bug#74610: 31.0.50; Submitting mhtml-ts-mode, treesitter alternative to mhtml-mode
Date: Wed, 04 Dec 2024 11:47:51 +0100

Hi Dmitry,

In data mercoledì 4 dicembre 2024 02:27:53 Ora standard dell’Europa centrale, 
hai scritto:
> On 29/11/2024 23:57, Vincenzo Pupillo wrote:
> > +;; This package provides `mhtml-ts-mode' which is a major mode
> > +;; for editing HTML files with embedded JavaScript and CSS.
> > +;; Tree Sitter is used to parse each of these languages.
> > +;;
> > +;; Please note that this package requires `html-ts-mode', which
> > +;; registers itself as the major mode for editing HTML.
> 
> Hi!
> 
> Do you foresee cases for when html-ts-mode would be preferred by the
> user instead of this advanced mhtml-ts-mode? 
For everyday use mhtml-ts-mode is better, just like mhtml-mode (which has been 
the default for html editing for a while now).

> Or maybe the former is
> better in its current shape when used by e.g. php-ts-mode?
Yes, personally I think that major modes that handle (for tree-sitters) only 
one language are easier to put together at the moment. It's Lego vs. 
Playmobil.
We are in an experimental phase, like all other editors.
See https://github.com/helix-editor/helix/pull/1170#issuecomment-997294090
In some ways, by having a different approach from other editors, we have a 
greater degree of flexibility IMHO.

> 
> In other words, I'm wondering why not update the existing mode with
> sub-parsers rather than add a new one. html-mode had such a reason -
> it's quite old, and has been used in various placed the way it is now
> (including multi-mode packages). But ts modes don't work too well with
> multi-mode packages, not currently anyway.

It's something I've thought about but haven't tried yet. 
One of the themes of the email thread (on emacs-devel) was to have a simple 
multi language major mode that was also a sort of “user's guide.”


Vincenzo.







reply via email to

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