unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Theodor Thornhill <theo@thornhill.no>
To: Yuan Fu <casouri@gmail.com>
Cc: emacs-devel <emacs-devel@gnu.org>,
	"Simen Heggestøyl" <simenheg@runbox.com>
Subject: Re: Mode names for C-like tree-sitter modes
Date: Mon, 14 Nov 2022 11:07:22 +0100	[thread overview]
Message-ID: <87tu3126jp.fsf@thornhill.no> (raw)
In-Reply-To: <2D2E7C73-87BB-4298-B7E1-6D813F8AF407@thornhill.no>

>>> 
>>>> c-ts-mode--base-mode should probably be a public mode, since the intention (IIUC) is enable users to configure C and C++ together, by adding hooks to this base-mode. So something like c-base-mode or c-ts-base-mode?
>>>> 
>>> 
>>> Sure!
>>> 
>>>> CSS and JSON could be merged with current modes, I think. Css-ts-mode could merge with css-mode, and json-ts-mode could be merged with js-json-mode. Or we can just have a dedicated json-mode.
>>>> 
>>>> Theo, WDYT?
>>>> 
>>> 
>>> That's fine with me. In any case I think we should remove tree-sitter support from js-json-mode (or merge them). I think there exist a json-mode  in both elpa and melpa, adding another isn't the best idea I think. 
>>> 
>>> Not sure what is best, really.
>>
>>Js-json-mode inherits from js-mode, which complicates the matter if tree-sitter is enabled for js-mode… Probably should remove tree-sitter from js-json-mode. Also if we decided cc-mode and tree-sitter should be mutually exclusive (which we kind of have), we should remove some cc-mode init in js-mode that runs even when tree-sitter is enabled.
>>
>
> Strong agree there :)
>
>>The json-mode you mentioned is on ELPA, and is fairly small, we might be able to merge json-ts-mode with it. Simen, WDYT?
>>
>>> 
>>> My vote goes to merging css and keeping others separate, but I don't have the strongest opinion there. 
>>> 
>>> I can prepare such a patch after we decide on something.
>>
>>I can also do it, that’ll save us some patching and merging ;-)
>>
>>Yuan
>
> If that causes you less work just go ahead :)
>

I actually think it makes the most sense to extract javascript ts
support into ts-mode.el.  And then rename ts-mode.el to js-ts-mode.el.
Keep js.el vanilla, avoid tree-sitter altogether there, and keep
ourselves headache free. Then these modes also will follow the naming
scheme we have now, and will possibly make migration to a different
naming scheme easier.  It actually makes sense from a tree-sitter
perspective, considering that the typescript tree-sitter grammar
inherits javascript.  We also require js in ts-mode.el, but _only_ for
the exported tree-sitter convenience functions. js-ts-mode could also
imply javascript-typescript-mode, not just javascript-tree-sitter-mode,
which also kindof make sense.

What do you think?


-- 
Theo



  reply	other threads:[~2022-11-14 10:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-14  1:16 Mode names for C-like tree-sitter modes Yuan Fu
2022-11-14  6:34 ` Theodor Thornhill
2022-11-14  9:09   ` Yuan Fu
2022-11-14  9:49     ` Theodor Thornhill
2022-11-14 10:07       ` Theodor Thornhill [this message]
2022-11-14 10:17     ` Simen Heggestøyl
2022-11-15  2:49     ` Stefan Monnier
2022-11-14 19:04 ` Eli Zaretskii
2022-11-15  4:17 ` Richard Stallman
2022-11-15  6:33   ` Theodor Thornhill

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tu3126jp.fsf@thornhill.no \
    --to=theo@thornhill.no \
    --cc=casouri@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=simenheg@runbox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).