Subject: bug#68246: 30.0.50; Add non-TS mode as extra parent of TS modes

From: João Távora <[email-masked]>
Date: Fri, 19 Jan 2024 12:53:22 +0000

On Fri, Jan 19, 2024 at 12:43 PM Stefan Monnier
<[email-masked]> wrote:

> In the longer term, there might be a fair bit of overlap, yes, tho it
> all depends on how your proposal works out in the end.
> My patch is a short term solution with no new API.

Problem is, as you know, there's nothing more permanent than
a short-term solution.

Now, if your patch is expressed carefully in terms of
some concepts we could save our skins, so to speak:

instead of directly:

  (derived-mode-add-parents 'foo-ts-mode '(foo-mode))

Why don't we

  (set-super-special-stefan-parent 'foo-ts-mode 'foo)

?

Then

   (provided-mode-derived-p 'foo-ts-mode '(foo-mode))

should always be true because high-minded conceptual reasons
impeccably explained somewhere :-)

Then, we can later edit the implementation of
set-super-special-stefan-parent to accommodate for 'foo'
being a language, the "preferred" or "main" language of
whatever mode is given as the first argument.

João