* tree-sitter version?
@ 2022-11-24 1:54 T.V Raman
2022-11-24 3:27 ` Yuan Fu
0 siblings, 1 reply; 29+ messages in thread
From: T.V Raman @ 2022-11-24 1:54 UTC (permalink / raw)
To: emacs-devel
While building emacs from Github @HEAD, I noticed that configure
checks for two different tree-sitter versions
checking for tree-sitter >= 0.20.2... no
checking for tree-sitter >= 0.6.3... yes
Installing from apt-get on Debian, and later cloning and building
tree-sitter from github both give 0.6.3
So what is 0.20 --asking only because 20 much-greater-than 6--
--
Thanks,
--Raman(I Search, I Find, I Misplace, I Research)
♉ Id: kg:/m/0285kf1 🦮
--
Thanks,
--Raman(I Search, I Find, I Misplace, I Research)
♉ Id: kg:/m/0285kf1 🦮
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: tree-sitter version?
2022-11-24 1:54 tree-sitter version? T.V Raman
@ 2022-11-24 3:27 ` Yuan Fu
2022-11-24 4:57 ` T.V Raman
0 siblings, 1 reply; 29+ messages in thread
From: Yuan Fu @ 2022-11-24 3:27 UTC (permalink / raw)
To: T.V Raman; +Cc: emacs-devel
> On Nov 23, 2022, at 5:54 PM, T.V Raman <raman@google.com> wrote:
>
> While building emacs from Github @HEAD, I noticed that configure
> checks for two different tree-sitter versions
> checking for tree-sitter >= 0.20.2... no
> checking for tree-sitter >= 0.6.3... yes
>
>
> Installing from apt-get on Debian, and later cloning and building
> tree-sitter from github both give 0.6.3
>
>
>
> So what is 0.20 --asking only because 20 much-greater-than 6—
The official latest version of tree-sitter right now is 0.20.7, the one we want is >=0.20.2 (which has the ability to change malloc implementation on runtime). However apprantly tree-sitter’s makefile wasn’t updated after 0.6.3 so the version number on the installed library is 0.6.3. Ideally we want to require >=0.20.2 and be done with it, but since most tree-sitter libraries installed on people’s machines are 0.6.3, we also accept 0.6.3 and use autotool magic to check for the ability to change malloc implementation.
Yuan
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: tree-sitter version?
2022-11-24 3:27 ` Yuan Fu
@ 2022-11-24 4:57 ` T.V Raman
2022-11-24 5:02 ` Yuan Fu
0 siblings, 1 reply; 29+ messages in thread
From: T.V Raman @ 2022-11-24 4:57 UTC (permalink / raw)
To: Yuan Fu; +Cc: emacs-devel
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=gb18030, Size: 1575 bytes --]
Yuan Fu <casouri@gmail.com> writes:
Confusing times ahead!
So: am I supposed to install tree-sitter from github or from debian's
package manager?
I first did the package-manager version, then pulled from github and
installed that -- configure shows that tree-sitter is detected -- but
calling any of the tree-sitter modes, eg c-ts-mode barfs with an error
saying that support is not available.
>> On Nov 23, 2022, at 5:54 PM, T.V Raman <raman@google.com> wrote:
>>
>> While building emacs from Github @HEAD, I noticed that configure
>> checks for two different tree-sitter versions
>> checking for tree-sitter >= 0.20.2... no
>> checking for tree-sitter >= 0.6.3... yes
>>
>>
>> Installing from apt-get on Debian, and later cloning and building
>> tree-sitter from github both give 0.6.3
>>
>>
>>
>> So what is 0.20 --asking only because 20 much-greater-than 6¡ª
>
> The official latest version of tree-sitter right now is 0.20.7, the
> one we want is >=0.20.2 (which has the ability to change malloc
> implementation on runtime). However apprantly tree-sitter¡¯s makefile
> wasn¡¯t updated after 0.6.3 so the version number on the installed
> library is 0.6.3. Ideally we want to require >=0.20.2 and be done with
> it, but since most tree-sitter libraries installed on people¡¯s
> machines are 0.6.3, we also accept 0.6.3 and use autotool magic to
> check for the ability to change malloc implementation.
>
> Yuan
>
>
--
Thanks,
--Raman(I Search, I Find, I Misplace, I Research)
7©4 Id: kg:/m/0285kf1 0Ü8
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: tree-sitter version?
2022-11-24 4:57 ` T.V Raman
@ 2022-11-24 5:02 ` Yuan Fu
2022-11-24 5:54 ` Tassilo Horn
0 siblings, 1 reply; 29+ messages in thread
From: Yuan Fu @ 2022-11-24 5:02 UTC (permalink / raw)
To: T.V Raman; +Cc: emacs-devel
> On Nov 23, 2022, at 8:57 PM, T.V Raman <raman@google.com> wrote:
>
> Yuan Fu <casouri@gmail.com> writes:
>
>
> Confusing times ahead!
>
> So: am I supposed to install tree-sitter from github or from debian's
> package manager?
Either should be fine.
> I first did the package-manager version, then pulled from github and
> installed that -- configure shows that tree-sitter is detected -- but
> calling any of the tree-sitter modes, eg c-ts-mode barfs with an error
> saying that support is not available.
If you call tree-sitter-available-p, what do you get? Most likely you don’t have the relevant language definition/grammar for those modes. You can probably find them on package managers, or you can build with the script here:
https://github.com/casouri/tree-sitter-module
Do you think the error message could be improved? IIRC the error reporting tells you you need language definitions, but maybe it should explicitly say language definition != tree-sitter library.
Yuan
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: tree-sitter version?
2022-11-24 5:02 ` Yuan Fu
@ 2022-11-24 5:54 ` Tassilo Horn
2022-11-25 9:43 ` Yuan Fu
2022-11-25 15:06 ` T.V Raman
0 siblings, 2 replies; 29+ messages in thread
From: Tassilo Horn @ 2022-11-24 5:54 UTC (permalink / raw)
To: Yuan Fu; +Cc: T.V Raman, emacs-devel
Yuan Fu <casouri@gmail.com> writes:
Hi Yuan,
>> So: am I supposed to install tree-sitter from github or from debian's
>> package manager?
>
> Either should be fine.
Ah, I was wondering the same when I wanted to give tree-sitter a try. I
have tree-sitter 0.20.7 installed but the configure output said
">=0.20.2 no" but only reported a >= 0.6.x version. It still works
fine. :-)
>> I first did the package-manager version, then pulled from github and
>> installed that -- configure shows that tree-sitter is detected -- but
>> calling any of the tree-sitter modes, eg c-ts-mode barfs with an
>> error saying that support is not available.
>
> If you call tree-sitter-available-p, what do you get? Most likely you
> don’t have the relevant language definition/grammar for those
> modes. You can probably find them on package managers, or you can
> build with the script here:
Indeed, that was the next trap I fell in. On Arch, tree-sitter is in
the community repository (so basically almost official) whereas the
language definitions are only on the AUR. Maybe the NEWS entry should
tell more clearly that tree-sitter needs to be system-installed and also
the language definitions need to be grabbed somewhere.
BTW, how can a user decide that tree-sitter modes should be used? For
example, when I open a json file I get js-json-mode, not json-ts-mode,
which also works, so support is available. Should user's augment
auto-mode-alist? Or is there some "enable TS whenever possible and the
devs think its support is in a usable state for that language" toggle?
Bye,
Tassilo
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: tree-sitter version?
2022-11-24 5:54 ` Tassilo Horn
@ 2022-11-25 9:43 ` Yuan Fu
2022-11-25 11:52 ` Eli Zaretskii
2022-11-25 15:08 ` T.V Raman
2022-11-25 15:06 ` T.V Raman
1 sibling, 2 replies; 29+ messages in thread
From: Yuan Fu @ 2022-11-25 9:43 UTC (permalink / raw)
To: Tassilo Horn; +Cc: T.V Raman, emacs-devel
> On Nov 23, 2022, at 9:54 PM, Tassilo Horn <tsdh@gnu.org> wrote:
>
> Yuan Fu <casouri@gmail.com> writes:
>
> Hi Yuan,
>
>>> So: am I supposed to install tree-sitter from github or from debian's
>>> package manager?
>>
>> Either should be fine.
>
> Ah, I was wondering the same when I wanted to give tree-sitter a try. I
> have tree-sitter 0.20.7 installed but the configure output said
> ">=0.20.2 no" but only reported a >= 0.6.x version. It still works
> fine. :-)
>
>>> I first did the package-manager version, then pulled from github and
>>> installed that -- configure shows that tree-sitter is detected -- but
>>> calling any of the tree-sitter modes, eg c-ts-mode barfs with an
>>> error saying that support is not available.
>>
>> If you call tree-sitter-available-p, what do you get? Most likely you
>> don’t have the relevant language definition/grammar for those
>> modes. You can probably find them on package managers, or you can
>> build with the script here:
>
> Indeed, that was the next trap I fell in. On Arch, tree-sitter is in
> the community repository (so basically almost official) whereas the
> language definitions are only on the AUR. Maybe the NEWS entry should
> tell more clearly that tree-sitter needs to be system-installed and also
> the language definitions need to be grabbed somewhere.
Yeah there will be a NEWS entry for tree-sitter.
>
> BTW, how can a user decide that tree-sitter modes should be used? For
> example, when I open a json file I get js-json-mode, not json-ts-mode,
> which also works, so support is available. Should user's augment
> auto-mode-alist? Or is there some "enable TS whenever possible and the
> devs think its support is in a usable state for that language" toggle?
There is no global toggle, unfortunately. You could use auto-mode-alist or major-mode-remap-alist to enable tree-sitter modes, yes. I imagine there could be a third-party package that automatically enables tree-sitter for all supported nodes, maybe.
Yuan
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: tree-sitter version?
2022-11-25 9:43 ` Yuan Fu
@ 2022-11-25 11:52 ` Eli Zaretskii
2022-11-25 15:08 ` T.V Raman
1 sibling, 0 replies; 29+ messages in thread
From: Eli Zaretskii @ 2022-11-25 11:52 UTC (permalink / raw)
To: Yuan Fu; +Cc: tsdh, raman, emacs-devel
> From: Yuan Fu <casouri@gmail.com>
> Date: Fri, 25 Nov 2022 01:43:39 -0800
> Cc: "T.V Raman" <raman@google.com>,
> emacs-devel@gnu.org
>
> > BTW, how can a user decide that tree-sitter modes should be used? For
> > example, when I open a json file I get js-json-mode, not json-ts-mode,
> > which also works, so support is available. Should user's augment
> > auto-mode-alist? Or is there some "enable TS whenever possible and the
> > devs think its support is in a usable state for that language" toggle?
>
> There is no global toggle, unfortunately. You could use auto-mode-alist or major-mode-remap-alist to enable tree-sitter modes, yes. I imagine there could be a third-party package that automatically enables tree-sitter for all supported nodes, maybe.
I'm not sure a global toggle would make sense at this time: even if the user
has the tree-sitter library installed, there's no guarantee that the grammar
for a particular language is also installed. Only the user knows whether it
is or isn't. Enabling a mode just to get an error message makes little
sense.
Perhaps in the future distros will catch up and provide installation of
grammars that includes everything available, but until they do, we are
better off with individual toggles.
There's also a question of user preferences: some might prefer the
non-TS versions for whatever reasons.
IMO, per-mode toggles is currently the best compromise, given that we don't
yet have enough user feedback and experience to decide on more general
knobs.
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: tree-sitter version?
2022-11-24 5:54 ` Tassilo Horn
2022-11-25 9:43 ` Yuan Fu
@ 2022-11-25 15:06 ` T.V Raman
1 sibling, 0 replies; 29+ messages in thread
From: T.V Raman @ 2022-11-25 15:06 UTC (permalink / raw)
To: tsdh; +Cc: casouri, raman, emacs-devel
So I built the lang-specific modules from the script cited earlier in
the thread and copied the .so files to /usr/local/lib emacs seems
happy, but at least it doesn't complain about not knowing about C.
But for this to be usable, those modules need to be bundled with Emacs?Tassilo Horn writes:
> Yuan Fu <casouri@gmail.com> writes:
>
> Hi Yuan,
>
> >> So: am I supposed to install tree-sitter from github or from debian's
> >> package manager?
> >
> > Either should be fine.
>
> Ah, I was wondering the same when I wanted to give tree-sitter a try. I
> have tree-sitter 0.20.7 installed but the configure output said
> ">=0.20.2 no" but only reported a >= 0.6.x version. It still works
> fine. :-)
>
> >> I first did the package-manager version, then pulled from github and
> >> installed that -- configure shows that tree-sitter is detected -- but
> >> calling any of the tree-sitter modes, eg c-ts-mode barfs with an
> >> error saying that support is not available.
> >
> > If you call tree-sitter-available-p, what do you get? Most likely you
> > don’t have the relevant language definition/grammar for those
> > modes. You can probably find them on package managers, or you can
> > build with the script here:
>
> Indeed, that was the next trap I fell in. On Arch, tree-sitter is in
> the community repository (so basically almost official) whereas the
> language definitions are only on the AUR. Maybe the NEWS entry should
> tell more clearly that tree-sitter needs to be system-installed and also
> the language definitions need to be grabbed somewhere.
>
> BTW, how can a user decide that tree-sitter modes should be used? For
> example, when I open a json file I get js-json-mode, not json-ts-mode,
> which also works, so support is available. Should user's augment
> auto-mode-alist? Or is there some "enable TS whenever possible and the
> devs think its support is in a usable state for that language" toggle?
>
> Bye,
> Tassilo
--
Thanks,
--Raman(I Search, I Find, I Misplace, I Research)
♉ Id: kg:/m/0285kf1 🦮
--
Thanks,
--Raman(I Search, I Find, I Misplace, I Research)
♉ Id: kg:/m/0285kf1 🦮
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: tree-sitter version?
2022-11-25 9:43 ` Yuan Fu
2022-11-25 11:52 ` Eli Zaretskii
@ 2022-11-25 15:08 ` T.V Raman
2022-11-25 16:25 ` Rename Tree-sitter major modes from "ts" to "treesit" (was Re: tree-sitter version?) Daniel Martín
2022-11-28 21:36 ` tree-sitter version? Richard Stallman
1 sibling, 2 replies; 29+ messages in thread
From: T.V Raman @ 2022-11-25 15:08 UTC (permalink / raw)
To: casouri; +Cc: tsdh, raman, emacs-devel
also the name "ts" as part of tree-sitter is an unfortunate
confusion since ts-mode is for typescript.
I initally wrongly assumed that ts-mode was some kind of global mode
that would enable tree-support for all supported modes, given the
names c-ts-mode etc.Yuan Fu writes:
>
>
> > On Nov 23, 2022, at 9:54 PM, Tassilo Horn <tsdh@gnu.org> wrote:
> >
> > Yuan Fu <casouri@gmail.com> writes:
> >
> > Hi Yuan,
> >
> >>> So: am I supposed to install tree-sitter from github or from debian's
> >>> package manager?
> >>
> >> Either should be fine.
> >
> > Ah, I was wondering the same when I wanted to give tree-sitter a try. I
> > have tree-sitter 0.20.7 installed but the configure output said
> > ">=0.20.2 no" but only reported a >= 0.6.x version. It still works
> > fine. :-)
> >
> >>> I first did the package-manager version, then pulled from github and
> >>> installed that -- configure shows that tree-sitter is detected -- but
> >>> calling any of the tree-sitter modes, eg c-ts-mode barfs with an
> >>> error saying that support is not available.
> >>
> >> If you call tree-sitter-available-p, what do you get? Most likely you
> >> don’t have the relevant language definition/grammar for those
> >> modes. You can probably find them on package managers, or you can
> >> build with the script here:
> >
> > Indeed, that was the next trap I fell in. On Arch, tree-sitter is in
> > the community repository (so basically almost official) whereas the
> > language definitions are only on the AUR. Maybe the NEWS entry should
> > tell more clearly that tree-sitter needs to be system-installed and also
> > the language definitions need to be grabbed somewhere.
>
> Yeah there will be a NEWS entry for tree-sitter.
>
> >
> > BTW, how can a user decide that tree-sitter modes should be used? For
> > example, when I open a json file I get js-json-mode, not json-ts-mode,
> > which also works, so support is available. Should user's augment
> > auto-mode-alist? Or is there some "enable TS whenever possible and the
> > devs think its support is in a usable state for that language" toggle?
>
> There is no global toggle, unfortunately. You could use auto-mode-alist or major-mode-remap-alist to enable tree-sitter modes, yes. I imagine there could be a third-party package that automatically enables tree-sitter for all supported nodes, maybe.
>
> Yuan
--
Thanks,
--Raman(I Search, I Find, I Misplace, I Research)
♉ Id: kg:/m/0285kf1 🦮
--
Thanks,
--Raman(I Search, I Find, I Misplace, I Research)
♉ Id: kg:/m/0285kf1 🦮
^ permalink raw reply [flat|nested] 29+ messages in thread
* Rename Tree-sitter major modes from "ts" to "treesit" (was Re: tree-sitter version?)
2022-11-25 15:08 ` T.V Raman
@ 2022-11-25 16:25 ` Daniel Martín
2022-11-25 16:33 ` Eli Zaretskii
` (2 more replies)
2022-11-28 21:36 ` tree-sitter version? Richard Stallman
1 sibling, 3 replies; 29+ messages in thread
From: Daniel Martín @ 2022-11-25 16:25 UTC (permalink / raw)
To: T.V Raman; +Cc: casouri, tsdh, emacs-devel
"T.V Raman" <raman@google.com> writes:
> also the name "ts" as part of tree-sitter is an unfortunate
> confusion since ts-mode is for typescript.
>
> I initally wrongly assumed that ts-mode was some kind of global mode
> that would enable tree-support for all supported modes, given the
> names c-ts-mode etc.
This is a good point. The Tree-sitter Elisp library itself and its
commands already use the "treesit" abbreviation consistently. We're
still on time to rename the new language modes to c-treesit-mode, and so
on. Thoughts?
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: Rename Tree-sitter major modes from "ts" to "treesit" (was Re: tree-sitter version?)
2022-11-25 16:25 ` Rename Tree-sitter major modes from "ts" to "treesit" (was Re: tree-sitter version?) Daniel Martín
@ 2022-11-25 16:33 ` Eli Zaretskii
2022-11-25 16:38 ` Theodor Thornhill
2022-11-26 8:20 ` Yuan Fu
2 siblings, 0 replies; 29+ messages in thread
From: Eli Zaretskii @ 2022-11-25 16:33 UTC (permalink / raw)
To: Daniel Martín; +Cc: raman, casouri, tsdh, emacs-devel
> From: Daniel Martín <mardani29@yahoo.es>
> Cc: casouri@gmail.com, tsdh@gnu.org, emacs-devel@gnu.org
> Date: Fri, 25 Nov 2022 17:25:09 +0100
>
> "T.V Raman" <raman@google.com> writes:
>
> > also the name "ts" as part of tree-sitter is an unfortunate
> > confusion since ts-mode is for typescript.
> >
> > I initally wrongly assumed that ts-mode was some kind of global mode
> > that would enable tree-support for all supported modes, given the
> > names c-ts-mode etc.
>
> This is a good point. The Tree-sitter Elisp library itself and its
> commands already use the "treesit" abbreviation consistently. We're
> still on time to rename the new language modes to c-treesit-mode, and so
> on. Thoughts?
I don't think we should rename. There's just one ts-mode, and many
foo-ts-mode modes, so the latter win.
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: Rename Tree-sitter major modes from "ts" to "treesit" (was Re: tree-sitter version?)
2022-11-25 16:25 ` Rename Tree-sitter major modes from "ts" to "treesit" (was Re: tree-sitter version?) Daniel Martín
2022-11-25 16:33 ` Eli Zaretskii
@ 2022-11-25 16:38 ` Theodor Thornhill
2022-11-25 17:50 ` Elliott Shugerman
2022-11-25 19:40 ` Eli Zaretskii
2022-11-26 8:20 ` Yuan Fu
2 siblings, 2 replies; 29+ messages in thread
From: Theodor Thornhill @ 2022-11-25 16:38 UTC (permalink / raw)
To: emacs-devel, Daniel Martín, T.V Raman; +Cc: casouri, tsdh
On 25 November 2022 17:25:09 CET, "Daniel Martín" <mardani29@yahoo.es> wrote:
>"T.V Raman" <raman@google.com> writes:
>
>> also the name "ts" as part of tree-sitter is an unfortunate
>> confusion since ts-mode is for typescript.
>>
>> I initally wrongly assumed that ts-mode was some kind of global mode
>> that would enable tree-support for all supported modes, given the
>> names c-ts-mode etc.
>
>This is a good point. The Tree-sitter Elisp library itself and its
>commands already use the "treesit" abbreviation consistently. We're
>still on time to rename the new language modes to c-treesit-mode, and so
>on. Thoughts?
>
I'd rather change ts-mode to typescript-mode or typescript-ts-mode. But we can discuss names, of course :-)
Even better would be some construct we've discussed many times the last months: not letting a specific implementation "own" a major mode name. So c-mode could be powered by cc mode implementation _or_ treesit.el implementation, but not a merged thing.
To me the natural progression would be to keep name as-is, then later when we have such a construct just delete the *-ts-modes.
For Emacs 30 or 31.
Theo
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: Rename Tree-sitter major modes from "ts" to "treesit" (was Re: tree-sitter version?)
2022-11-25 16:38 ` Theodor Thornhill
@ 2022-11-25 17:50 ` Elliott Shugerman
2022-11-25 23:41 ` Rudolf Adamkovič
2022-11-25 19:40 ` Eli Zaretskii
1 sibling, 1 reply; 29+ messages in thread
From: Elliott Shugerman @ 2022-11-25 17:50 UTC (permalink / raw)
To: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 1704 bytes --]
I am nobody, but FWIW, I'm in favor of using "treesit" instead of "ts" in
the mode names. Even if tree sitter had a higher profile than typescript
(NB: typescript's is in fact much higher, and this is unlikely to change no
matter how much adoption tree sitter sees), the unambiguous naming scheme
is preferable. Does anyone really mind the five additional characters?
On Fri, Nov 25, 2022, 9:39 AM Theodor Thornhill <theo@thornhill.no> wrote:
>
>
> On 25 November 2022 17:25:09 CET, "Daniel Martín" <mardani29@yahoo.es>
> wrote:
> >"T.V Raman" <raman@google.com> writes:
> >
> >> also the name "ts" as part of tree-sitter is an unfortunate
> >> confusion since ts-mode is for typescript.
> >>
> >> I initally wrongly assumed that ts-mode was some kind of global mode
> >> that would enable tree-support for all supported modes, given the
> >> names c-ts-mode etc.
> >
> >This is a good point. The Tree-sitter Elisp library itself and its
> >commands already use the "treesit" abbreviation consistently. We're
> >still on time to rename the new language modes to c-treesit-mode, and so
> >on. Thoughts?
> >
>
> I'd rather change ts-mode to typescript-mode or typescript-ts-mode. But we
> can discuss names, of course :-)
>
> Even better would be some construct we've discussed many times the last
> months: not letting a specific implementation "own" a major mode name. So
> c-mode could be powered by cc mode implementation _or_ treesit.el
> implementation, but not a merged thing.
>
> To me the natural progression would be to keep name as-is, then later when
> we have such a construct just delete the *-ts-modes.
>
> For Emacs 30 or 31.
>
> Theo
>
>
[-- Attachment #2: Type: text/html, Size: 2410 bytes --]
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: Rename Tree-sitter major modes from "ts" to "treesit" (was Re: tree-sitter version?)
2022-11-25 16:38 ` Theodor Thornhill
2022-11-25 17:50 ` Elliott Shugerman
@ 2022-11-25 19:40 ` Eli Zaretskii
2022-11-25 19:58 ` Theodor Thornhill
1 sibling, 1 reply; 29+ messages in thread
From: Eli Zaretskii @ 2022-11-25 19:40 UTC (permalink / raw)
To: Theodor Thornhill; +Cc: emacs-devel, mardani29, raman, casouri, tsdh
> Date: Fri, 25 Nov 2022 17:38:27 +0100
> From: Theodor Thornhill <theo@thornhill.no>
> CC: casouri@gmail.com, tsdh@gnu.org
>
> I'd rather change ts-mode to typescript-mode or typescript-ts-mode.
If there was no ts-mode before, I'm okay with renaming it to
typescript-ts-mode.
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: Rename Tree-sitter major modes from "ts" to "treesit" (was Re: tree-sitter version?)
2022-11-25 19:40 ` Eli Zaretskii
@ 2022-11-25 19:58 ` Theodor Thornhill
2022-11-25 20:13 ` Theodor Thornhill via Emacs development discussions.
0 siblings, 1 reply; 29+ messages in thread
From: Theodor Thornhill @ 2022-11-25 19:58 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel, mardani29, raman, casouri, tsdh
Eli Zaretskii <eliz@gnu.org> writes:
>> Date: Fri, 25 Nov 2022 17:38:27 +0100
>> From: Theodor Thornhill <theo@thornhill.no>
>> CC: casouri@gmail.com, tsdh@gnu.org
>>
>> I'd rather change ts-mode to typescript-mode or typescript-ts-mode.
>
> If there was no ts-mode before, I'm okay with renaming it to
> typescript-ts-mode.
Ok, patch coming up
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: Rename Tree-sitter major modes from "ts" to "treesit" (was Re: tree-sitter version?)
2022-11-25 19:58 ` Theodor Thornhill
@ 2022-11-25 20:13 ` Theodor Thornhill via Emacs development discussions.
2022-11-26 1:04 ` Stefan Kangas
0 siblings, 1 reply; 29+ messages in thread
From: Theodor Thornhill via Emacs development discussions. @ 2022-11-25 20:13 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel, mardani29, raman, casouri, tsdh
[-- Attachment #1: Type: text/plain, Size: 398 bytes --]
Hi Eli,
>
>>> Date: Fri, 25 Nov 2022 17:38:27 +0100
>>> From: Theodor Thornhill <theo@thornhill.no>
>>> CC: casouri@gmail.com, tsdh@gnu.org
>>>
>>> I'd rather change ts-mode to typescript-mode or typescript-ts-mode.
>>
>> If there was no ts-mode before, I'm okay with renaming it to
>> typescript-ts-mode.
>
> Ok, patch coming up
Feel free to commit this, Eli. I've only done a rename.
Theo
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Rename-ts-mode-to-typescript-ts-mode.patch --]
[-- Type: text/x-diff, Size: 9129 bytes --]
From 5a8d0347ad4e3373ef849d9b818459121061b593 Mon Sep 17 00:00:00 2001
From: Theodor Thornhill <theo@thornhill.no>
Date: Fri, 25 Nov 2022 21:04:18 +0100
Subject: [PATCH] Rename ts-mode to typescript-ts-mode
* lisp/progmodes/ts-mode.el: File deleted.
* lisp/progmodes/typescript-ts-mode.el: New mode typescript-ts-mode.
* etc/NEWS: Mention the new mode.
---
etc/NEWS | 2 +-
.../{ts-mode.el => typescript-ts-mode.el} | 78 +++++++++----------
2 files changed, 40 insertions(+), 40 deletions(-)
rename lisp/progmodes/{ts-mode.el => typescript-ts-mode.el} (77%)
diff --git a/etc/NEWS b/etc/NEWS
index 0ffc849fec..3c9243784d 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -2969,7 +2969,7 @@ This is a lightweight variant of 'js-mode' that is used by default
when visiting JSON files.
\f
-** New mode 'ts-mode'.
+** New mode 'typescript-ts-mode'.
A major mode based on the tree-sitter library for editing programs
in the TypeScript language. It includes support for font-locking,
indentation, and navigation.
diff --git a/lisp/progmodes/ts-mode.el b/lisp/progmodes/typescript-ts-mode.el
similarity index 77%
rename from lisp/progmodes/ts-mode.el
rename to lisp/progmodes/typescript-ts-mode.el
index bdef1c4576..763686bf66 100644
--- a/lisp/progmodes/ts-mode.el
+++ b/lisp/progmodes/typescript-ts-mode.el
@@ -1,4 +1,4 @@
-;;; ts-mode.el --- tree sitter support for TypeScript -*- lexical-binding: t; -*-
+;;; typescript-ts-mode.el --- tree sitter support for TypeScript -*- lexical-binding: t; -*-
;; Copyright (C) 2022 Free Software Foundation, Inc.
@@ -30,14 +30,14 @@
(declare-function treesit-parser-create "treesit.c")
-(defcustom ts-mode-indent-offset 2
- "Number of spaces for each indentation step in `ts-mode'."
+(defcustom typescript-ts-mode-indent-offset 2
+ "Number of spaces for each indentation step in `typescript-ts-mode'."
:version "29.1"
:type 'integer
:safe 'integerp
:group 'typescript)
-(defvar ts-mode--syntax-table
+(defvar typescript-ts-mode--syntax-table
(let ((table (make-syntax-table)))
;; Taken from the cc-langs version
(modify-syntax-entry ?_ "_" table)
@@ -54,9 +54,9 @@ ts-mode--syntax-table
(modify-syntax-entry ?` "\"" table)
(modify-syntax-entry ?\240 "." table)
table)
- "Syntax table for `ts-mode'.")
+ "Syntax table for `typescript-ts-mode'.")
-(defvar ts-mode--indent-rules
+(defvar typescript-ts-mode--indent-rules
`((tsx
((parent-is "program") parent-bol 0)
((node-is "}") parent-bol 0)
@@ -65,33 +65,33 @@ ts-mode--indent-rules
((node-is ">") parent-bol 0)
((and (parent-is "comment") comment-end) comment-start -1)
((parent-is "comment") comment-start-skip 0)
- ((parent-is "ternary_expression") parent-bol ts-mode-indent-offset)
- ((parent-is "member_expression") parent-bol ts-mode-indent-offset)
- ((parent-is "named_imports") parent-bol ts-mode-indent-offset)
- ((parent-is "statement_block") parent-bol ts-mode-indent-offset)
- ((parent-is "type_arguments") parent-bol ts-mode-indent-offset)
- ((parent-is "variable_declarator") parent-bol ts-mode-indent-offset)
- ((parent-is "arguments") parent-bol ts-mode-indent-offset)
- ((parent-is "array") parent-bol ts-mode-indent-offset)
- ((parent-is "formal_parameters") parent-bol ts-mode-indent-offset)
- ((parent-is "template_substitution") parent-bol ts-mode-indent-offset)
- ((parent-is "object_pattern") parent-bol ts-mode-indent-offset)
- ((parent-is "object") parent-bol ts-mode-indent-offset)
- ((parent-is "object_type") parent-bol ts-mode-indent-offset)
- ((parent-is "enum_body") parent-bol ts-mode-indent-offset)
- ((parent-is "arrow_function") parent-bol ts-mode-indent-offset)
- ((parent-is "parenthesized_expression") parent-bol ts-mode-indent-offset)
+ ((parent-is "ternary_expression") parent-bol typescript-ts-mode-indent-offset)
+ ((parent-is "member_expression") parent-bol typescript-ts-mode-indent-offset)
+ ((parent-is "named_imports") parent-bol typescript-ts-mode-indent-offset)
+ ((parent-is "statement_block") parent-bol typescript-ts-mode-indent-offset)
+ ((parent-is "type_arguments") parent-bol typescript-ts-mode-indent-offset)
+ ((parent-is "variable_declarator") parent-bol typescript-ts-mode-indent-offset)
+ ((parent-is "arguments") parent-bol typescript-ts-mode-indent-offset)
+ ((parent-is "array") parent-bol typescript-ts-mode-indent-offset)
+ ((parent-is "formal_parameters") parent-bol typescript-ts-mode-indent-offset)
+ ((parent-is "template_substitution") parent-bol typescript-ts-mode-indent-offset)
+ ((parent-is "object_pattern") parent-bol typescript-ts-mode-indent-offset)
+ ((parent-is "object") parent-bol typescript-ts-mode-indent-offset)
+ ((parent-is "object_type") parent-bol typescript-ts-mode-indent-offset)
+ ((parent-is "enum_body") parent-bol typescript-ts-mode-indent-offset)
+ ((parent-is "arrow_function") parent-bol typescript-ts-mode-indent-offset)
+ ((parent-is "parenthesized_expression") parent-bol typescript-ts-mode-indent-offset)
;; TSX
- ((parent-is "jsx_opening_element") parent ts-mode-indent-offset)
+ ((parent-is "jsx_opening_element") parent typescript-ts-mode-indent-offset)
((node-is "jsx_closing_element") parent 0)
- ((parent-is "jsx_element") parent ts-mode-indent-offset)
+ ((parent-is "jsx_element") parent typescript-ts-mode-indent-offset)
((node-is "/") parent 0)
- ((parent-is "jsx_self_closing_element") parent ts-mode-indent-offset)
+ ((parent-is "jsx_self_closing_element") parent typescript-ts-mode-indent-offset)
(no-node parent-bol 0)))
"Tree-sitter indent rules.")
-(defvar ts-mode--keywords
+(defvar typescript-ts-mode--keywords
'("!" "abstract" "as" "async" "await" "break"
"case" "catch" "class" "const" "continue" "debugger"
"declare" "default" "delete" "do" "else" "enum"
@@ -103,14 +103,14 @@ ts-mode--keywords
"while" "with" "yield")
"TypeScript keywords for tree-sitter font-locking.")
-(defvar ts-mode--operators
+(defvar typescript-ts-mode--operators
'("=" "+=" "-=" "*=" "/=" "%=" "**=" "<<=" ">>=" ">>>=" "&=" "^="
"|=" "&&=" "||=" "??=" "==" "!=" "===" "!==" ">" ">=" "<" "<=" "+"
"-" "*" "/" "%" "++" "--" "**" "&" "|" "^" "~" "<<" ">>" ">>>"
"&&" "||" "!" "?.")
"TypeScript operators for tree-sitter font-locking.")
-(defvar ts-mode--font-lock-settings
+(defvar typescript-ts-mode--font-lock-settings
(treesit-font-lock-rules
:language 'tsx
:override t
@@ -128,7 +128,7 @@ ts-mode--font-lock-settings
:language 'tsx
:override t
:feature 'keyword
- `([,@ts-mode--keywords] @font-lock-keyword-face
+ `([,@typescript-ts-mode--keywords] @font-lock-keyword-face
[(this) (super)] @font-lock-keyword-face)
:language 'tsx
@@ -248,7 +248,7 @@ ts-mode--font-lock-settings
:language 'tsx
:feature 'operator
- `([,@ts-mode--operators] @font-lock-operator-face
+ `([,@typescript-ts-mode--operators] @font-lock-operator-face
(ternary_expression ["?" ":"] @font-lock-operator-face))
:language 'tsx
@@ -278,19 +278,19 @@ ts-mode--font-lock-settings
"Tree-sitter font-lock settings.")
;;;###autoload
-(add-to-list 'auto-mode-alist '("\\.ts\\'" . ts-mode))
+(add-to-list 'auto-mode-alist '("\\.ts\\'" . typescript-ts-mode))
;;;###autoload
-(add-to-list 'auto-mode-alist '("\\.tsx\\'" . ts-mode))
+(add-to-list 'auto-mode-alist '("\\.tsx\\'" . typescript-ts-mode))
;;;###autoload
-(define-derived-mode ts-mode prog-mode "TypeScript"
+(define-derived-mode typescript-ts-mode prog-mode "TypeScript"
"Major mode for editing TypeScript."
:group 'typescript
- :syntax-table ts-mode--syntax-table
+ :syntax-table typescript-ts-mode--syntax-table
(cond
- ;; `ts-mode' requires tree-sitter to work, so we don't check if
+ ;; `typescript-ts-mode' requires tree-sitter to work, so we don't check if
;; user enables tree-sitter for it.
((treesit-ready-p 'tsx)
;; Tree-sitter.
@@ -308,7 +308,7 @@ ts-mode
(append "{}():;," electric-indent-chars))
;; Indent.
- (setq-local treesit-simple-indent-rules ts-mode--indent-rules)
+ (setq-local treesit-simple-indent-rules typescript-ts-mode--indent-rules)
;; Navigation.
(setq-local treesit-defun-type-regexp
@@ -318,7 +318,7 @@ ts-mode
"lexical_declaration")))
;; Font-lock.
- (setq-local treesit-font-lock-settings ts-mode--font-lock-settings)
+ (setq-local treesit-font-lock-settings typescript-ts-mode--font-lock-settings)
(setq-local treesit-font-lock-feature-list
'((comment declaration)
(constant expression identifier keyword number string)
@@ -336,6 +336,6 @@ ts-mode
(js-mode)
(message "Tree-sitter for TypeScript isn't available, falling back to `js-mode'"))))
-(provide 'ts-mode)
+(provide 'typescript-ts-mode)
-;;; ts-mode.el ends here
+;;; typescript-ts-mode.el ends here
--
2.34.1
^ permalink raw reply related [flat|nested] 29+ messages in thread
* Re: Rename Tree-sitter major modes from "ts" to "treesit" (was Re: tree-sitter version?)
2022-11-25 17:50 ` Elliott Shugerman
@ 2022-11-25 23:41 ` Rudolf Adamkovič
0 siblings, 0 replies; 29+ messages in thread
From: Rudolf Adamkovič @ 2022-11-25 23:41 UTC (permalink / raw)
To: Elliott Shugerman, emacs-devel
Elliott Shugerman <eeshugerman@gmail.com> writes:
> I am nobody, but FWIW, I'm in favor of using "treesit" instead of "ts"
> in the mode names.
+1. I originally stopped following this thread by mistake because I
thought it discussed TypeScript. Also, it would never occur to me to
search M-x for the string "ts" to see all the new Tree Sitter modes.
So, 'ts' fits the bill perfectly, but in Vim and not Emacs. :)
Rudy
--
"One can begin to reason only when a clear picture has been formed in
the imagination."
-- Walter Warwick Sawyer, Mathematician's Delight, 1943
Rudolf Adamkovič <salutis@me.com> [he/him]
Studenohorská 25
84103 Bratislava
Slovakia
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: Rename Tree-sitter major modes from "ts" to "treesit" (was Re: tree-sitter version?)
2022-11-25 20:13 ` Theodor Thornhill via Emacs development discussions.
@ 2022-11-26 1:04 ` Stefan Kangas
2022-11-26 6:45 ` Theodor Thornhill
0 siblings, 1 reply; 29+ messages in thread
From: Stefan Kangas @ 2022-11-26 1:04 UTC (permalink / raw)
To: Theodor Thornhill, Eli Zaretskii
Cc: emacs-devel, mardani29, raman, casouri, tsdh
Theodor Thornhill via "Emacs development discussions."
<emacs-devel@gnu.org> writes:
> Feel free to commit this, Eli. I've only done a rename.
Thanks.
However, note that it's better to rename the file in a separate commit,
containing no other changes. That way, "git blame" provides stronger
guarantees for providing correct attribution. (BTW, "git log" does too,
but it needs a --follow flag.)
So I did the rename separately, in your name, applied your patch on top,
and pushed the result to master (commit 374f4e38c1). I also adjusted
the commit message slightly to reflect this:
Rename ts-mode to typescript-ts-mode
* lisp/progmodes/typescript-ts-mode.el: Rename from 'ts-mode' to
'typescript-ts-mode'. Rename all symbols to match new prefix.
* etc/NEWS: Mention the new mode name.
Ref: https://lists.gnu.org/r/emacs-devel/2022-11/msg01587.html
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: Rename Tree-sitter major modes from "ts" to "treesit" (was Re: tree-sitter version?)
2022-11-26 1:04 ` Stefan Kangas
@ 2022-11-26 6:45 ` Theodor Thornhill
0 siblings, 0 replies; 29+ messages in thread
From: Theodor Thornhill @ 2022-11-26 6:45 UTC (permalink / raw)
To: Stefan Kangas, Eli Zaretskii; +Cc: emacs-devel, mardani29, raman, casouri, tsdh
On 26 November 2022 02:04:49 CET, Stefan Kangas <stefankangas@gmail.com> wrote:
>Theodor Thornhill via "Emacs development discussions."
><emacs-devel@gnu.org> writes:
>
>> Feel free to commit this, Eli. I've only done a rename.
>
>Thanks.
>
>However, note that it's better to rename the file in a separate commit,
>containing no other changes. That way, "git blame" provides stronger
>guarantees for providing correct attribution. (BTW, "git log" does too,
>but it needs a --follow flag.)
>
>So I did the rename separately, in your name, applied your patch on top,
>and pushed the result to master (commit 374f4e38c1). I also adjusted
>the commit message slightly to reflect this:
>
> Rename ts-mode to typescript-ts-mode
>
> * lisp/progmodes/typescript-ts-mode.el: Rename from 'ts-mode' to
> 'typescript-ts-mode'. Rename all symbols to match new prefix.
> * etc/NEWS: Mention the new mode name.
> Ref: https://lists.gnu.org/r/emacs-devel/2022-11/msg01587.html
Ah ok - thanks for the tip! And for applying :)
Theo
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: Rename Tree-sitter major modes from "ts" to "treesit" (was Re: tree-sitter version?)
2022-11-25 16:25 ` Rename Tree-sitter major modes from "ts" to "treesit" (was Re: tree-sitter version?) Daniel Martín
2022-11-25 16:33 ` Eli Zaretskii
2022-11-25 16:38 ` Theodor Thornhill
@ 2022-11-26 8:20 ` Yuan Fu
2022-11-26 8:22 ` Theodor Thornhill
2022-11-26 8:31 ` Eli Zaretskii
2 siblings, 2 replies; 29+ messages in thread
From: Yuan Fu @ 2022-11-26 8:20 UTC (permalink / raw)
To: Daniel Martín; +Cc: T.V Raman, tsdh, emacs-devel
> On Nov 25, 2022, at 8:25 AM, Daniel Martín <mardani29@yahoo.es> wrote:
>
> "T.V Raman" <raman@google.com> writes:
>
>> also the name "ts" as part of tree-sitter is an unfortunate
>> confusion since ts-mode is for typescript.
>>
>> I initally wrongly assumed that ts-mode was some kind of global mode
>> that would enable tree-support for all supported modes, given the
>> names c-ts-mode etc.
>
> This is a good point. The Tree-sitter Elisp library itself and its
> commands already use the "treesit" abbreviation consistently. We're
> still on time to rename the new language modes to c-treesit-mode, and so
> on. Thoughts?
Yeah we should use treesit, if nothing better appears. We had a (short) discussion on better names than xxx-ts-mode, but no one had better idea, so the name stuck.
Yuan
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: Rename Tree-sitter major modes from "ts" to "treesit" (was Re: tree-sitter version?)
2022-11-26 8:20 ` Yuan Fu
@ 2022-11-26 8:22 ` Theodor Thornhill
2022-11-26 8:31 ` Eli Zaretskii
1 sibling, 0 replies; 29+ messages in thread
From: Theodor Thornhill @ 2022-11-26 8:22 UTC (permalink / raw)
To: emacs-devel, Yuan Fu, Daniel Martín; +Cc: T.V Raman, tsdh
On 26 November 2022 09:20:00 CET, Yuan Fu <casouri@gmail.com> wrote:
>
>
>> On Nov 25, 2022, at 8:25 AM, Daniel Martín <mardani29@yahoo.es> wrote:
>>
>> "T.V Raman" <raman@google.com> writes:
>>
>>> also the name "ts" as part of tree-sitter is an unfortunate
>>> confusion since ts-mode is for typescript.
>>>
>>> I initally wrongly assumed that ts-mode was some kind of global mode
>>> that would enable tree-support for all supported modes, given the
>>> names c-ts-mode etc.
>>
>> This is a good point. The Tree-sitter Elisp library itself and its
>> commands already use the "treesit" abbreviation consistently. We're
>> still on time to rename the new language modes to c-treesit-mode, and so
>> on. Thoughts?
>
>Yeah we should use treesit, if nothing better appears. We had a (short) discussion on better names than xxx-ts-mode, but no one had better idea, so the name stuck.
>
>Yuan
If nothing better appears today I can do the rename this evening :)
Theo
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: Rename Tree-sitter major modes from "ts" to "treesit" (was Re: tree-sitter version?)
2022-11-26 8:20 ` Yuan Fu
2022-11-26 8:22 ` Theodor Thornhill
@ 2022-11-26 8:31 ` Eli Zaretskii
2022-11-26 9:06 ` Theodor Thornhill
1 sibling, 1 reply; 29+ messages in thread
From: Eli Zaretskii @ 2022-11-26 8:31 UTC (permalink / raw)
To: Yuan Fu; +Cc: mardani29, raman, tsdh, emacs-devel
> From: Yuan Fu <casouri@gmail.com>
> Date: Sat, 26 Nov 2022 00:20:00 -0800
> Cc: "T.V Raman" <raman@google.com>,
> tsdh@gnu.org,
> emacs-devel@gnu.org
>
> > On Nov 25, 2022, at 8:25 AM, Daniel Martín <mardani29@yahoo.es> wrote:
> >
> > "T.V Raman" <raman@google.com> writes:
> >
> >> also the name "ts" as part of tree-sitter is an unfortunate
> >> confusion since ts-mode is for typescript.
> >>
> >> I initally wrongly assumed that ts-mode was some kind of global mode
> >> that would enable tree-support for all supported modes, given the
> >> names c-ts-mode etc.
> >
> > This is a good point. The Tree-sitter Elisp library itself and its
> > commands already use the "treesit" abbreviation consistently. We're
> > still on time to rename the new language modes to c-treesit-mode, and so
> > on. Thoughts?
>
> Yeah we should use treesit, if nothing better appears. We had a (short) discussion on better names than xxx-ts-mode, but no one had better idea, so the name stuck.
Sorry, no more renames, and that is final. The branching point for emacs-29
is almost upon us, and we cannot afford such changes anymore. The
justification is quite weak anyway. People who think "ts" means only
"typescript" will have to adapt. (The tree-sitter library has all of its
functions start with "ts_", so we didn't invent this shorthand out of thin
air.)
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: Rename Tree-sitter major modes from "ts" to "treesit" (was Re: tree-sitter version?)
2022-11-26 8:31 ` Eli Zaretskii
@ 2022-11-26 9:06 ` Theodor Thornhill
0 siblings, 0 replies; 29+ messages in thread
From: Theodor Thornhill @ 2022-11-26 9:06 UTC (permalink / raw)
To: emacs-devel, Eli Zaretskii, Yuan Fu; +Cc: mardani29, raman, tsdh
On 26 November 2022 09:31:45 CET, Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Yuan Fu <casouri@gmail.com>
>> Date: Sat, 26 Nov 2022 00:20:00 -0800
>> Cc: "T.V Raman" <raman@google.com>,
>> tsdh@gnu.org,
>> emacs-devel@gnu.org
>>
>> > On Nov 25, 2022, at 8:25 AM, Daniel Martín <mardani29@yahoo.es> wrote:
>> >
>> > "T.V Raman" <raman@google.com> writes:
>> >
>> >> also the name "ts" as part of tree-sitter is an unfortunate
>> >> confusion since ts-mode is for typescript.
>> >>
>> >> I initally wrongly assumed that ts-mode was some kind of global mode
>> >> that would enable tree-support for all supported modes, given the
>> >> names c-ts-mode etc.
>> >
>> > This is a good point. The Tree-sitter Elisp library itself and its
>> > commands already use the "treesit" abbreviation consistently. We're
>> > still on time to rename the new language modes to c-treesit-mode, and so
>> > on. Thoughts?
>>
>> Yeah we should use treesit, if nothing better appears. We had a (short) discussion on better names than xxx-ts-mode, but no one had better idea, so the name stuck.
>
>Sorry, no more renames, and that is final. The branching point for emacs-29
>is almost upon us, and we cannot afford such changes anymore. The
>justification is quite weak anyway. People who think "ts" means only
>"typescript" will have to adapt. (The tree-sitter library has all of its
>functions start with "ts_", so we didn't invent this shorthand out of thin
>air.)
>
Ok :)
Theo
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: tree-sitter version?
2022-11-25 15:08 ` T.V Raman
2022-11-25 16:25 ` Rename Tree-sitter major modes from "ts" to "treesit" (was Re: tree-sitter version?) Daniel Martín
@ 2022-11-28 21:36 ` Richard Stallman
2022-11-29 3:28 ` Eli Zaretskii
1 sibling, 1 reply; 29+ messages in thread
From: Richard Stallman @ 2022-11-28 21:36 UTC (permalink / raw)
To: T.V Raman; +Cc: casouri, tsdh, raman, emacs-devel
[[[ To any NSA and FBI agents reading my email: please consider ]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]
> also the name "ts" as part of tree-sitter is an unfortunate
> confusion since ts-mode is for typescript.
I suggest that we rename that mode to typescript-mode,
for the sake of clarity and discoverability.
That will help the people who'd want to use it
notice its existence.
--
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: tree-sitter version?
2022-11-28 21:36 ` tree-sitter version? Richard Stallman
@ 2022-11-29 3:28 ` Eli Zaretskii
2022-12-04 23:13 ` Richard Stallman
0 siblings, 1 reply; 29+ messages in thread
From: Eli Zaretskii @ 2022-11-29 3:28 UTC (permalink / raw)
To: rms; +Cc: raman, casouri, tsdh, raman, emacs-devel
> From: Richard Stallman <rms@gnu.org>
> Cc: casouri@gmail.com, tsdh@gnu.org, raman@google.com,
> emacs-devel@gnu.org
> Date: Mon, 28 Nov 2022 16:36:55 -0500
>
> > also the name "ts" as part of tree-sitter is an unfortunate
> > confusion since ts-mode is for typescript.
>
> I suggest that we rename that mode to typescript-mode,
> for the sake of clarity and discoverability.
> That will help the people who'd want to use it
> notice its existence.
It was renamed to typescript-ts-mode.
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: tree-sitter version?
2022-11-29 3:28 ` Eli Zaretskii
@ 2022-12-04 23:13 ` Richard Stallman
2022-12-05 3:27 ` Eli Zaretskii
0 siblings, 1 reply; 29+ messages in thread
From: Richard Stallman @ 2022-12-04 23:13 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel
[[[ To any NSA and FBI agents reading my email: please consider ]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]
> > I suggest that we rename that mode to typescript-mode,
> > for the sake of clarity and discoverability.
> > That will help the people who'd want to use it
> > notice its existence.
> It was renamed to typescript-ts-mode.
That eliminates the problem.
It seems that we have a series of many pairs of major mode,
FOO-mode and FOO-ts-mode, where FOO-ts-mode uses treesitter
and FOO-mode does not use it. Is that correct?
It is no disaster, but is this really the interface we want to use for
enabling or disabling treesitter? I am sure we can make it cleaner.
--
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: tree-sitter version?
2022-12-04 23:13 ` Richard Stallman
@ 2022-12-05 3:27 ` Eli Zaretskii
2022-12-06 22:35 ` Richard Stallman
0 siblings, 1 reply; 29+ messages in thread
From: Eli Zaretskii @ 2022-12-05 3:27 UTC (permalink / raw)
To: rms; +Cc: emacs-devel
> From: Richard Stallman <rms@gnu.org>
> Cc: emacs-devel@gnu.org
> Date: Sun, 04 Dec 2022 18:13:06 -0500
>
> It seems that we have a series of many pairs of major mode,
> FOO-mode and FOO-ts-mode, where FOO-ts-mode uses treesitter
> and FOO-mode does not use it. Is that correct?
Yes.
> It is no disaster, but is this really the interface we want to use for
> enabling or disabling treesitter? I am sure we can make it cleaner.
For now this was deemed the cleanest, safest approach, given that we lack
experience and user feedback. Several other ways were proposed, but we
decided to delay their implementation until we understand better both what
users prefer and how close to one another are the two varieties.
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: tree-sitter version?
2022-12-05 3:27 ` Eli Zaretskii
@ 2022-12-06 22:35 ` Richard Stallman
2022-12-07 3:31 ` Eli Zaretskii
0 siblings, 1 reply; 29+ messages in thread
From: Richard Stallman @ 2022-12-06 22:35 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel
[[[ To any NSA and FBI agents reading my email: please consider ]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]
> > It seems that we have a series of many pairs of major mode,
> > FOO-mode and FOO-ts-mode, where FOO-ts-mode uses treesitter
> > and FOO-mode does not use it. Is that correct?
> Yes.
> > It is no disaster, but is this really the interface we want to use for
> > enabling or disabling treesitter? I am sure we can make it cleaner.
> For now this was deemed the cleanest, safest approach, given that we lack
> experience and user feedback. Several other ways were proposed, but we
> decided to delay their implementation until we understand better both what
> users prefer and how close to one another are the two varieties.
That's reasonable. But sine this is an interim interface,
let's explicitly announce it that way. We could say that
people should be prepared for it to change in another Emacs
version soon.
--
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: tree-sitter version?
2022-12-06 22:35 ` Richard Stallman
@ 2022-12-07 3:31 ` Eli Zaretskii
0 siblings, 0 replies; 29+ messages in thread
From: Eli Zaretskii @ 2022-12-07 3:31 UTC (permalink / raw)
To: rms; +Cc: emacs-devel
> From: Richard Stallman <rms@gnu.org>
> Cc: emacs-devel@gnu.org
> Date: Tue, 06 Dec 2022 17:35:32 -0500
>
> > For now this was deemed the cleanest, safest approach, given that we lack
> > experience and user feedback. Several other ways were proposed, but we
> > decided to delay their implementation until we understand better both what
> > users prefer and how close to one another are the two varieties.
>
> That's reasonable. But sine this is an interim interface,
> let's explicitly announce it that way. We could say that
> people should be prepared for it to change in another Emacs
> version soon.
The user-level documentation of the tree-sitter support has yet to be
written; I've been waiting for the situation to stabilize. When it is
written, some language to this effect will be there.
^ permalink raw reply [flat|nested] 29+ messages in thread
end of thread, other threads:[~2022-12-07 3:31 UTC | newest]
Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-24 1:54 tree-sitter version? T.V Raman
2022-11-24 3:27 ` Yuan Fu
2022-11-24 4:57 ` T.V Raman
2022-11-24 5:02 ` Yuan Fu
2022-11-24 5:54 ` Tassilo Horn
2022-11-25 9:43 ` Yuan Fu
2022-11-25 11:52 ` Eli Zaretskii
2022-11-25 15:08 ` T.V Raman
2022-11-25 16:25 ` Rename Tree-sitter major modes from "ts" to "treesit" (was Re: tree-sitter version?) Daniel Martín
2022-11-25 16:33 ` Eli Zaretskii
2022-11-25 16:38 ` Theodor Thornhill
2022-11-25 17:50 ` Elliott Shugerman
2022-11-25 23:41 ` Rudolf Adamkovič
2022-11-25 19:40 ` Eli Zaretskii
2022-11-25 19:58 ` Theodor Thornhill
2022-11-25 20:13 ` Theodor Thornhill via Emacs development discussions.
2022-11-26 1:04 ` Stefan Kangas
2022-11-26 6:45 ` Theodor Thornhill
2022-11-26 8:20 ` Yuan Fu
2022-11-26 8:22 ` Theodor Thornhill
2022-11-26 8:31 ` Eli Zaretskii
2022-11-26 9:06 ` Theodor Thornhill
2022-11-28 21:36 ` tree-sitter version? Richard Stallman
2022-11-29 3:28 ` Eli Zaretskii
2022-12-04 23:13 ` Richard Stallman
2022-12-05 3:27 ` Eli Zaretskii
2022-12-06 22:35 ` Richard Stallman
2022-12-07 3:31 ` Eli Zaretskii
2022-11-25 15:06 ` T.V Raman
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).