Ciao Yuan and Juri, this is an updated version of mhtml-ts-mode. I have tried to reduce as much as possible copies of parts of the major modes from which it is derived. To do this, I had to move some values that were assigned directly to treesit's own variables (in ccs-mode.el, in js.el, and in html-ts-mode.el) into new variables. I also added three new functions to treesit.el to make it easier to combine parts derived from the other major modes. So now any changes to these new variables are directly reflected in the behavior of mhtml-ts-mode. There are a few things I would like to highlight: 1. treesit-font-lock-feature-lists are not defined per parser, so simply merging the different lists will cause display differences from the original major-modes; for example “function” is defined at level 3 in css-ts-mode but at level 4 in js-ts-mode. 2. treesit-defun-type-regexp has the same problem as treesit-font-lock- feature-list, so I had to define it myself. But other than that, it works pretty well. IMHO, a global "list" where you can define "font-lock", "indent-list", "font- lock-feature", etc. by language (perhaps with getter and setter methods) might make it easier to define new multilingual major-modes. It could improve the decoupling between multilingual major-modes and the major-modes they are derived from. It could also better decouple the internal implementation of treesit.el from the treesitter-based major-modes. Let me know what you think. Thanks. Vincenzo p.s. In this version I also added support for wich-function-mode, for flymake and a pretty-print function. In data martedì 24 dicembre 2024 23:18:39 Ora standard dell’Europa centrale, Yuan Fu ha scritto: > > On Dec 24, 2024, at 12:37 AM, Yuan Fu wrote: > >> On Dec 14, 2024, at 2:37 AM, Vincenzo Pupillo > >> wrote: > >> > >> In data mercoledì 11 dicembre 2024 05:54:09 Ora standard dell’Europa > >> centrale,>> > >> Yuan Fu ha scritto: > >>>> On Dec 3, 2024, at 6:29 AM, Vincenzo Pupillo > >>>> wrote: > >>>> > >>>> In data domenica 1 dicembre 2024 07:01:21 Ora standard dell’Europa > >>>> centrale,> > >>>> > >>>> Yuan Fu ha scritto: > >>>>> It's not uncommon to see different indent offset for CSS and > >>>>> Javascript, so it's a good idea to have separate control for them. > >>>> > >>>> Is the behavior the same as mhtml-mode, or would you like something > >>>> like > >>>> this?> > >>>> > >>>> > >>>> > >>>> > >>>> The mhtml-ts-mode-js-css-indent-offset variable controls only the > >>>> indentation relative to the