all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "João Távora" <joaotavora@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: theo@thornhill.no, casouri@gmail.com, spacibba@aol.com,
	 emacs-devel@gnu.org
Subject: Re: c-ts-mode
Date: Fri, 8 Sep 2023 16:15:09 +0100	[thread overview]
Message-ID: <CALDnm515n1rUDJVMYrRoMV3dbRbu5t1SJuTgnEJM4L6CGQktag@mail.gmail.com> (raw)
In-Reply-To: <83msxwx02s.fsf@gnu.org>

On Fri, Sep 8, 2023 at 2:32 PM Eli Zaretskii <eliz@gnu.org> wrote:
>
> > Date: Fri, 08 Sep 2023 16:11:46 +0300
> > From: Eli Zaretskii <eliz@gnu.org>
> > Cc: theo@thornhill.no, casouri@gmail.com, spacibba@aol.com, emacs-devel@gnu.org
> >
> > > From: João Távora <joaotavora@gmail.com>
> > > Date: Fri, 8 Sep 2023 13:38:58 +0100
> > > Cc: theo@thornhill.no, casouri@gmail.com, spacibba@aol.com,
> > >     emacs-devel@gnu.org
> > >
> > > Anyway, it's worth pointing out that unless you're extremely adept
> > > at crafting indentation styles for Emacs, you're always in a losing
> > > battle when working on multiple projects, since many projects
> > > nowadays (not just C/C++) use an external format definition.
> > > A .clang-format  (even we have one since 2017) or other similar
> > > files.  These are understood by other editors and tools.
> >
> > I guess this means we should add a TODO item for supporting such
> > external specifications?
>
> Done; patches welcome.

I couldn't find your TODO item (in etc/TODO at least).  But I'm curious
as to how you will phrase it: "supporting" can have many meanings.

If it means "have some kind of interface for using" then Emacs already
has one, which is `eglot-format`.  Although indirect (because LSP), it
is a pretty effective in abstracting away different specs of different
such tools (clang-format, prettier, eslint, etc).

But if "supporting" means "plug into indent-line-function and
indent-region-function", then it's going to be relatively hard, because
as I explained, these are formatters, not indenters, so it's a bit
of a round-peg, square-hole problem.  So if you want to keep the
existing interface of those two functions (which would be ideal, since
a lot of tooling already depends on them), there would have to be some
way to communicate with these tools so that they only talk about
indentation.  Not saying it's impossible, but it's hard, at least
when LSP is used for abstracting away differences.

João



  reply	other threads:[~2023-09-08 15:15 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <r6t7xfcchagyl72ltdrcavncbpvba7badcoh4yimleoynmzfvb.ref@elkspm3vozuv>
2023-08-30 23:52 ` c-ts-mode Ergus
2023-09-01  4:14   ` c-ts-mode Yuan Fu
2023-09-07  9:25     ` c-ts-mode João Távora
2023-09-07  9:37       ` c-ts-mode Eli Zaretskii
2023-09-07 15:58         ` c-ts-mode João Távora
2023-09-07 17:10           ` c-ts-mode Eli Zaretskii
2023-09-07 17:53             ` c-ts-mode João Távora
2023-09-07 18:13               ` c-ts-mode Eli Zaretskii
2023-09-07 18:23                 ` c-ts-mode João Távora
2023-09-07 18:32                   ` c-ts-mode Eli Zaretskii
2023-09-07 22:01                     ` c-ts-mode João Távora
2023-09-08  6:14                       ` c-ts-mode Eli Zaretskii
2023-09-08  7:25                         ` c-ts-mode João Távora
2023-09-08 11:25                           ` c-ts-mode Eli Zaretskii
2023-09-08 12:38                             ` c-ts-mode João Távora
2023-09-08 13:11                               ` c-ts-mode Eli Zaretskii
2023-09-08 13:32                                 ` c-ts-mode Eli Zaretskii
2023-09-08 15:15                                   ` João Távora [this message]
2023-09-08 15:34                                     ` c-ts-mode Eli Zaretskii
2023-09-08 15:56                                       ` c-ts-mode João Távora
2023-09-08 18:23                                         ` c-ts-mode Eli Zaretskii
2023-09-08 18:30                                           ` c-ts-mode João Távora
2023-09-08 18:54                                             ` c-ts-mode Eli Zaretskii
2023-09-08 19:42                                               ` c-ts-mode João Távora
2023-09-09  6:09                                                 ` c-ts-mode Eli Zaretskii
2023-09-08 19:58                               ` c-ts-mode Petteri Hintsanen
2023-09-08 20:27                                 ` c-ts-mode João Távora
2023-09-09  6:19                                 ` c-ts-mode Eli Zaretskii
2023-09-13 16:15                                   ` c-ts-mode Petteri Hintsanen
2023-09-12  0:34                             ` c-ts-mode Yuan Fu
2023-09-12  7:45                               ` c-ts-mode João Távora
2023-09-12  8:00                                 ` c-ts-mode Po Lu
2023-09-12  9:51                                   ` c-ts-mode João Távora

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

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

  git send-email \
    --in-reply-to=CALDnm515n1rUDJVMYrRoMV3dbRbu5t1SJuTgnEJM4L6CGQktag@mail.gmail.com \
    --to=joaotavora@gmail.com \
    --cc=casouri@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=spacibba@aol.com \
    --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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.