Date: Sat, 23 Nov 2024 18:26:21 +0200
Cc: johan.myreen@gmail.com, emacs-devel@gnu.org
From: Dmitry Gutov <dmitry@gutov.dev>
. we need the ability to turn on and off selected TS-based modes,
and do it easily
Note that we don't have such capability currently.
We have, sort-of: loading the mode "turns it on" (with known caveats
and disadvantages). In any case, I think we should have this, even if
we don't have it now. It should be part of this improvement.
Both commands would be pure wrappers on top of the user option, so they
don't seem to require any advance considerations. Somebody can add those
later, or any variations on them.
We could indeed make them wrappers, but changing the user option is
not really clean. If nothing else, users will see that the option was
"modified outside Custom", which could be confusing. But if we
conclude that this is the best way, we could avoid this unpleasant
effect as well (AFAIR, it is based on some special property of the
option's symbol).
I see no reason to depart from the current approach - except I've
switched from major-mode-remap-defaults to major-mode-remap-alist (where
the former is used) because the latter corresponds to user preferences,
and it seems like that's the subject of our switcher.
This could also be discussed, but seems more of an orthogonal issue.
Not really orthogonal, since I think Stefan was against changing
auto-mode-alist, because it doesn't handle mode cookies and file-local
variables.