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

From: Stefan Kangas <[email-masked]>
Date: Fri, 5 Jan 2024 11:03:46 -0800

João Távora <[email-masked]> writes:

> In summary, my position is that regardless of Stefan's patch, which
> I'm not opposed to, we should:
>
> 1. Use add-derived-mode-parents sparingly and consider foo-base-mode when
> possible.

I agree that inheriting from a `foo-base-mode' is a good way to reuse
code between different modes.  It's easy to think of examples of where
this will be useful: looking up some documentation, running a REPL,
interacting with a debugger, and so on and so forth.

But even if we added all the base modes today (as empty stubs), AFAIU it
wouldn't solve the exact problem that Monnier's patch is addressing,
namely to make packages and customizations work in both foo-mode and
foo-ts-mode even if they only say:

    (derived-mode-p 'foo-mode)

So I'm not sure doing one excludes the other, or that one should be
considered preferred over the other.  IOW, I'm not sure about the
recommendation to use `add-derived-mode-parents' sparingly, as that
would seem to defeat the point.

Am I missing something?