[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: |
Yuan Fu |
Subject: |
bug#68246: 30.0.50; Add non-TS mode as extra parent of TS modes |
Date: |
Fri, 5 Jan 2024 19:19:46 -0800 |
I certainly welcome base-mode, I’m the one that added them in the first place.
But I also want to point out that they are only a partial solution. For one,
adding the base mode needs cooperation from all the major mode authors. For
built-in modes, that’s not a (big) problem; for countless third-party modes out
there, I don’t have high hopes for it.
The good thing about derived-mode-add-parents is that it doesn’t need major
mode author’s cooperation. Even a normal user can do it themselves.
Then there is the problem Eli pointed out, base-mode hooks runs before child
major mode body does. It’s probably fine for most of the things, but if you
want to change some buffer local variable that the major mode sets, base-mode
hook can’t help. (Arguable a niche use-case, but my point is base-mode hooks
have their limits.)
Obviously derived-mode-add-parents can’t help with hooks. But adding the config
to two hooks doesn’t seem to be too bad. Plus I haven’t come up with good
solution. So I’m not too eager to solve that inconvenience.
As for adding xxx-mode to xxx-ts-mode’s parent, I think it’s fine? Like others
in the thread, I couldn’t think of a scenarios where this will be problematic.
I thought about adding xxx-lang as the parent of both xxx-mode and xxx-ts-mode,
but that’s probably not very helpful, since the goal is to make things work for
ts-mode without needing to change the existing code, and using xxx-lang still
requires modifying existing code.
Yuan
- bug#68246: 30.0.50; Add non-TS mode as extra parent of TS modes, (continued)
- bug#68246: 30.0.50; Add non-TS mode as extra parent of TS modes, Eli Zaretskii, 2024/01/06
- bug#68246: 30.0.50; Add non-TS mode as extra parent of TS modes, Eli Zaretskii, 2024/01/06
- bug#68246: 30.0.50; Add non-TS mode as extra parent of TS modes, João Távora, 2024/01/06
- bug#68246: 30.0.50; Add non-TS mode as extra parent of TS modes, Stefan Kangas, 2024/01/05
- bug#68246: 30.0.50; Add non-TS mode as extra parent of TS modes, João Távora, 2024/01/05
- bug#68246: 30.0.50; Add non-TS mode as extra parent of TS modes, Eli Zaretskii, 2024/01/06
- bug#68246: 30.0.50; Add non-TS mode as extra parent of TS modes,
Yuan Fu <=
- bug#68246: 30.0.50; Add non-TS mode as extra parent of TS modes, Dmitry Gutov, 2024/01/05
- bug#68246: 30.0.50; Add non-TS mode as extra parent of TS modes, Stefan Monnier, 2024/01/05
- bug#68246: 30.0.50; Add non-TS mode as extra parent of TS modes, Yuan Fu, 2024/01/07
- bug#68246: 30.0.50; Add non-TS mode as extra parent of TS modes, João Távora, 2024/01/06
- bug#68246: 30.0.50; Add non-TS mode as extra parent of TS modes, Stefan Monnier, 2024/01/08
bug#68246: 30.0.50; Add non-TS mode as extra parent of TS modes, Eli Zaretskii, 2024/01/05
bug#68246: 30.0.50; Add non-TS mode as extra parent of TS modes, Stefan Kangas, 2024/01/05