From: Daniel Colascione <dancol@dancol.org>
To: Yuan Fu <casouri@gmail.com>
Cc: <emacs-devel@gnu.org>
Subject: Re: c-ts-mode style customization
Date: Thu, 23 Mar 2023 00:55:07 -0400 [thread overview]
Message-ID: <1870cd213f8.2829.cc5b3318d7e9908e2c46732289705cb0@dancol.org> (raw)
In-Reply-To: <CAB1DB9D-7FBF-4E78-9470-73E000D8E753@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1422 bytes --]
On March 22, 2023 20:21:22 Yuan Fu <casouri@gmail.com> wrote:
>> On Mar 22, 2023, at 5:05 PM, Daniel Colascione <dancol@dancol.org> wrote:
>>
>>
>>
>> On March 22, 2023 19:58:22 Yuan Fu <casouri@gmail.com> wrote:
>>
>>>> On Mar 22, 2023, at 8:53 AM, Daniel Colascione <dancol@dancol.org> wrote:
>>>>
>>>> Shouldn't customization of styles in c-ts-mode look more like cc-mode's
>>>> style machinery? Right now, the closest thing we have to defining a new
>>>> style is add-advice on c-ts-mode--indent-styles, which isn't
>>>> particularly convenient or future-proof. You can't drop a new style in,
>>>> say, .dir-locals.
>>>
>>> Actually, you can define a custom function, say, c-ts-mode-my-style, and
>>> set c-ts-mode-indent-style to the name of it.
>>>
>>> Yuan
>>
>>
>> But that doesn't add the new style to the UI selection menu and doesn't let
>> you define a style in dir-locals. IMHO, cc-mode got this right.
>
> You can set c-ts-mode-indent-style in dir-locals, no?
No, because I can set that variable only to one of the predefined styles or
to a function, and a function isn't a safe value of a directory local variable.
> You have a point for UI selection, we can add a
> c-ts-mode-indent-style-alist that maps style names to rules/functions that
> returns rules, like c-style-alist.
Why this emphasis on functions? Why would we want the alist values to be
functions instead of just lists of rules?
[-- Attachment #2: Type: text/html, Size: 3184 bytes --]
next prev parent reply other threads:[~2023-03-23 4:55 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-22 15:53 c-ts-mode style customization Daniel Colascione
2023-03-22 16:48 ` Eli Zaretskii
2023-03-22 23:58 ` Yuan Fu
2023-03-23 0:05 ` Daniel Colascione
2023-03-23 0:20 ` Yuan Fu
2023-03-23 4:55 ` Daniel Colascione [this message]
2023-03-23 19:20 ` Yuan Fu
2023-03-23 21:06 ` Daniel Colascione
2023-03-23 23:44 ` Yuan Fu
2023-03-24 6:19 ` Eli Zaretskii
2023-03-24 7:02 ` Yuan Fu
2023-03-24 11:37 ` Eli Zaretskii
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=1870cd213f8.2829.cc5b3318d7e9908e2c46732289705cb0@dancol.org \
--to=dancol@dancol.org \
--cc=casouri@gmail.com \
--cc=emacs-devel@gnu.org \
/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.