bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Stefan Monnier
Subject: bug#68246: 30.0.50; Add non-TS mode as extra parent of TS modes
Date: Wed, 10 Jan 2024 11:11:58 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

> That's very nice and concise, but it still leaves the issue of users being
> able to use a common hook for a family of major modes (for the same
> language).  So I guess some inheritance-based solution is needed?

We have `define-derived-mode` for that.
And even those major modes which don't want to inherit via
`define-derived-mode` can `run-mode-hooks` any additional hook they like.

Doing it when a mode is defined is easy and "safe".
Changing it after the fact risks introducing breakage (just like my
`derived-mode-add-parents` does) where the code run via the hook depends
on specific details of the original mode which aren't available in the
"pseudo-derived" mode.

For this reason my patch only proposes the use of
`derived-mode-add-parents` since that's the part where a clear need has
been found.


        Stefan






reply via email to

[Prev in Thread] Current Thread [Next in Thread]