emacs-devel
[Top][All Lists]
Advanced

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

Re: c-ts-mode


From: Eli Zaretskii
Subject: Re: c-ts-mode
Date: Thu, 07 Sep 2023 21:13:09 +0300

> From: João Távora <joaotavora@gmail.com>
> Cc: casouri@gmail.com,  spacibba@aol.com,  emacs-devel@gnu.org
> Date: Thu, 07 Sep 2023 18:53:58 +0100
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> From: João Távora <joaotavora@gmail.com>
> >> Date: Thu, 7 Sep 2023 16:58:29 +0100
> >> Cc: casouri@gmail.com, spacibba@aol.com, emacs-devel@gnu.org
> >> 
> > I think c-ts-mode--indent-styles needs to be refactored toallow fine
> > control on the indentation parameters that are currently hard-coded
> > for each supported style.  They will need to have different names,
> > because tree-sitter doesn't use the CC Mode terminology for the
> > syntactical constructs.  Also, there seem to be many more parameters
> > than in CC Mode.
> 
> 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.



reply via email to

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