|
From: | Dmitry Gutov |
Subject: | bug#60443: 29.0.60; c-ts-mode: Consider re-using c-file-style and c-basic-offset |
Date: | Sat, 31 Dec 2022 12:31:51 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 |
On 31/12/2022 06:02, Yuan Fu wrote:
IIUC part of the reason why we created separate major modes is that we don’t want to share configuration variables between the tree-sitter and elisp implementation. If they share some of the configuration variable but not all, it would be very confusing; it they share all variables, well that’s not possible because c-ts-mode doesn’t support all of c-mode’s features.
js-ts-mode uses js-indent-level. css-ts-mode uses css-indent-offset. python-ts-mode and bash-ts-mode don't have their own indentation settings, so I suppose they reuse the "regular" indentation code.
There are a lot of other ts modes which don't have anything to reuse ("regular" mode is not in Emacs).
FWIW, that's my plan for ruby-ts-mode: to share those options where it's feasible, to avoid random duplication, and to make comparing and switching easier. The test suite can be shared more easily too.
Also, since c-ts-mode and c-mode’s implementation differs greatly, some of c-mode’s configuration wouldn’t make sense, or is hard to recreate, in c-ts-mode.
I suppose the CC styles might be trickier to implement exactly the same.
[Prev in Thread] | Current Thread | [Next in Thread] |