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: Theodor Thornhill <theo@thornhill.no>,
	 casouri@gmail.com, spacibba@aol.com,  emacs-devel@gnu.org
Subject: Re: c-ts-mode
Date: Fri, 08 Sep 2023 08:25:50 +0100	[thread overview]
Message-ID: <871qf9ktxd.fsf@gmail.com> (raw)
In-Reply-To: <83msxxxkc0.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 08 Sep 2023 09:14:39 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

>> IMHO making c-ts-mode--indent-styles a public CL-style
>> generic function would be a good possibility.
>
> Sorry, I don't understand: since we already allow
> c-ts-mode-indent-style to be a function, why do we need any other
> function-based feature?

Not all functions are the same, and my idea is fundamentally different
than the current mechanism.  The current variable offered which can be
indeed a function has no concept of the "base set of rules" that you can
extend, modify, or splice your lists into them and neither does it
formalized way of when to do these things.

So in the current interface, the user has to specifically know where and
how to get the bae set, (which includes )exposing implementation
details).

In my proposed interface, she doesn't.  She just codes the delta and the
conditions for overridding if she so wishe.

> If the only reason is that the function form of c-ts-mode-indent-style
> looks ugly to you, then I think this is in the eyes of the beholder;
> it doesn't look ugly to me, FWIW.

You may be confusing my proposal with one of a non-generic "normal"
function that you modify with add-function.  That's more-or-less the
same as a generic funtion (with :around, :before, :after, etc...)

So if you don't like CL stuff that has a more emacsy feel (but is
generally the same).  And of course a hook has an even more emacsy feel.

The advantage of my approach is the specialization in the arguments.

>> A defcustom-style thing for customize lovers can also be added,
>> later for people that don't like defgeneric.  Seems like a pretty
>> large DSL to code up in customize, though.
>
> What I had in mind was a simple alist, like CC Mode uses, with an
> infrastructure function to install it.  Patches are welcome.

It would certainly work for me, at least for my very simple case, and I
would be happy for this.  Not sure it is half as powerful, for example
how would you make that simple alist express cases where you want to add
the rules _after_ the base set?

Two alists?  I don't know if that is useful, but I seem to have read
somewhere in ts code that ordering is important.

Anyway, looking forward to see those patches, for the moment I've
supplied one.

João



  reply	other threads:[~2023-09-08  7:25 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                         ` João Távora [this message]
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                                   ` c-ts-mode João Távora
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=871qf9ktxd.fsf@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.