unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Theodor Thornhill <theo@thornhill.no>
Cc: emacs-devel@gnu.org, dev@rjt.dev, emacs-devel@gnu.org
Subject: Re: feature/tree-sitter: Where to Put C/C++ Stuff
Date: Tue, 01 Nov 2022 14:28:05 +0200	[thread overview]
Message-ID: <83h6zidfl6.fsf@gnu.org> (raw)
In-Reply-To: <8735b251so.fsf@thornhill.no> (message from Theodor Thornhill on Tue, 01 Nov 2022 12:53:11 +0100)

> From: Theodor Thornhill <theo@thornhill.no>
> Cc: emacs-devel@gnu.org, dev@rjt.dev, emacs-devel@gnu.org
> Date: Tue, 01 Nov 2022 12:53:11 +0100
> 
> > I also have hard time believing that you can reimplement those slow
> > parts of CC Mode to be much faster, but if you have code to show which
> > does that, I'm sure I'd be interested to look at it and consider
> > improving CC Mode using that code.
> >
> 
> You'd be surprised.
> 
> - https://github.com/emacs-csharp/csharp-mode/pull/251
> - https://github.com/emacs-csharp/csharp-mode/issues/207
> - https://github.com/emacs-csharp/csharp-mode/issues/164
> - https://debbugs.gnu.org/db/43/43631.html
> - https://github.com/emacs-csharp/csharp-mode/issues/151
> - https://github.com/emacs-csharp/csharp-mode/issues/200
> 
> All of these are solved with [0], no implementation needed for anything
> (apart from generic tree-sitter machinery of course). 

That's for C#, not for C/C++.

But if you can do the same for C/C++, sure, let's see the code and
judge its relative merits and demerits.

> >> 3: Confusion with where to file bugs
> >
> > Not relevant in our case: the bugs should be filed with Emacs.
> >
> 
> Well, are you sure?

You asked where to file the bugs.  The answer is: on debbugs.  If it
eventually turns out the bug is in tree-sitter, we will file a bug
there.  Just like we do with any other library we use.  Nothing new
here, IMO.

> >  . filling and breaking text in comments and strings
> >  . automatic insertion of newlines after braces, colons, commas, semi-colons
> >  . whitespace cleanups
> >  . minor modes: electric, hungry-delete, comment-style
> >  . c-offsets-alist and interactive indentation customization (related
> >    to indentation, but still extremely important, and not directly in
> >    tree-sitter)
> >
> 
> Yes, I've read the manual many times.  Filling is one nice thing,
> agreed.  electric, hungry-delete is just sitting there waiting for us to
> create a framework using tree-sitter that would benefit _all_ languages
> supported by tree-sitter, not just cc.

If tree-sitter can make these easier or faster or better, I see no
reason not to use tree-sitter for (some of) those features as well.
There's no decision to limit tree-sitter's use to fontification and
indentation, and I don't think we will ever make such decisions,
except if we have some bitter experience.

> > As they say, "show me the code".  If you can write up a C/C++ mode
> > from scratch which supports most everything in the CC Mode manual, do
> > it better/cleaner than CC Mode does, and do it before the emacs-29
> > branch is cut, in a month or so, I might change my mind.
> 
> Challenge accepted.  Can I create it for java, which is a language I'm
> writing a lot in these days?

Sorry, no.  It has to support all the languages supported by CC Mode
now.  That's the challenge.

It is fine by me to have a separate java-mode, but then I personally
will not be very interested in this, since editing the Emacs C code,
which I do a lot, will still need to use CC Mode.  Without decent
support for C/C++, CC Mode cannot be retired.

(Do people really use Emacs to develop Java?  I'd be surprised.)



  reply	other threads:[~2022-11-01 12:28 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-01  2:30 feature/tree-sitter: Where to Put C/C++ Stuff Randy Taylor
2022-11-01  5:44 ` Theodor Thornhill
2022-11-01  7:24   ` Eli Zaretskii
2022-11-01  7:55     ` Theodor Thornhill
2022-11-01  9:22       ` Yuan Fu
2022-11-01  9:41         ` Theodor Thornhill
2022-11-01  9:57       ` Eli Zaretskii
2022-11-01 11:53         ` Theodor Thornhill
2022-11-01 12:28           ` Eli Zaretskii [this message]
2022-11-01 13:05             ` Theodor Thornhill
2022-11-01 13:10               ` Eli Zaretskii
2022-11-01 13:27                 ` Theodor Thornhill
2022-11-01 13:49                   ` Eli Zaretskii
2022-11-01 13:54                     ` Theodor Thornhill
2022-11-01 14:03                       ` Eli Zaretskii
2022-11-01 14:12                         ` Theodor Thornhill
2022-11-01 16:09                 ` tomas
2022-11-01 13:12             ` Manuel Uberti
2022-11-04 14:49             ` Benjamin Riefenstahl
2022-11-04 16:17               ` Pascal Quesseveur
2022-11-01 13:32     ` Stefan Monnier
2022-11-01 14:02       ` Eli Zaretskii
2022-11-01 15:09         ` Stefan Monnier
2022-11-01 15:36           ` Theodor Thornhill
2022-11-01 16:43           ` Eli Zaretskii
2022-11-02 20:43   ` João Távora
2022-11-01  7:20 ` Eli Zaretskii
2022-11-01 12:10   ` Alan Mackenzie

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=83h6zidfl6.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=dev@rjt.dev \
    --cc=emacs-devel@gnu.org \
    --cc=theo@thornhill.no \
    /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).