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 10:43:11 -0800

Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <[email-masked]> writes:

> Many packages use the `major-mode` as a proxy for the type of content
> in the buffer.  When using the new TS modes, these packages tend to
> behave poorly because they do not understand that a buffer in `js-ts-mode`
> contains Javascript.
>
> I suggest we add the non-TS mode as an extra parent, so
> `derived-mode-all-parents` includes `js-mode` in `js-ts-mode`.

We should probably also change *Help* to displays the extra parents, or
this will be pretty confusing.  It should probably both list it as a
parent mode, and say that it will run the corresponding hook.

Here's an example:

  (progn
    (define-derived-mode python-super-mode prog-mode "SuperPython" "Doc")
    (derived-mode-add-parents 'python-super-mode '(python-mode))
    (describe-function 'python-super-mode))