GNU bug report logs - #60443
29.0.60; c-ts-mode: Consider re-using c-file-style and c-basic-offset

Previous Next

Package: emacs;

Reported by: Mohammed Sadiq <sadiq <at> sadiqpk.org>

Date: Sat, 31 Dec 2022 03:18:02 UTC

Severity: normal

Found in version 29.0.60

Full log


View this message in rfc822 format

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Yuan Fu <casouri <at> gmail.com>, Mohammed Sadiq <sadiq <at> sadiqpk.org>
Cc: 60443 <at> debbugs.gnu.org
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
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.




This bug report was last modified 2 years and 157 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.