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: Yuan Fu <casouri <at> gmail.com>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: Mohammed Sadiq <sadiq <at> sadiqpk.org>, 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: Sun, 1 Jan 2023 16:24:07 -0800
Dmitry Gutov <dgutov <at> yandex.ru> writes:

> 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.

Hmm, yes, those modes live in the same file, and can be considered the
same package. c-ts-mode.el is separate from cc-mode.el so it makes less
sense to share variables.  Maybe we can say "same package, share vars,
different package, different vars", to avoid confusion?


Yuan




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.