GNU bug report logs - #68246
30.0.50; Add non-TS mode as extra parent of TS modes

Previous Next

Package: emacs;

Reported by: Stefan Monnier <monnier <at> iro.umontreal.ca>

Date: Thu, 4 Jan 2024 22:12:01 UTC

Severity: wishlist

Found in version 30.0.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Kangas <stefankangas <at> gmail.com>
To: 68246 <at> debbugs.gnu.org
Cc: monnier <at> iro.umontreal.ca
Subject: bug#68246: 30.0.50; Add non-TS mode as extra parent of TS modes
Date: Fri, 5 Jan 2024 10:43:11 -0800
Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs <at> gnu.org> 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))




This bug report was last modified 1 year and 104 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.