[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: c-ts-mode

From: João Távora
Subject: Re: c-ts-mode
Date: Thu, 7 Sep 2023 19:23:33 +0100

On Thu, Sep 7, 2023 at 7:13 PM Eli Zaretskii <eliz@gnu.org> wrote:

> > I've been doing some experiments with c-ts-mode-indent-style, which can
> > be set to a function that returns a list that adds new items in front of
> > the list returned by with:
> >
> >    (alist-get 'gnu (c-ts-mode--indent-styles 'cpp))
> >
> > It's not super clean (notice the '--'), but not very dirty either.
> My preference would be to provide the same interface as CC Mode: an
> alist with the parameters and their values, or something similar
> (e.g., a keyword/value plist).  Asking users to write Lisp functions
> to customize indentation style is less friendly, especially if the
> user comes from CC Mode.

Agree.  The function I'm writing is so simple that it needn't
really be a function.  If there was a public way to "grab"
the rules named of a indentation style (like 'gnu' in my case)
it would be almost trivial to get rid of the function.

The real challenge is writing the rules themselves.  I'm missing
a kind of "debug rule" that doesn't do anything but prints out
contextual information from the node, parent-node, grandparents.
I made one but it's not very good.  Is there something like that?
Wouldn't even need to be an indentation rule, more like a "describe
AST at point"...


PS: I see in the meantime you reproduced the c++-ts-mode-bug.  Great!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]