reddit / emacs

Is there a way to enable some mode only when another mode is disabled?

[deleted] · 2022-02-14 12:40
Basically the title, thanks.
h-m-b-tu · 2022-02-14 13:11
To conditionally enable a mode you can check if the other mode is enabled by checking its mode variable. If you mean to automatically enable a mode on disabling the other mode try that mode's mode hook together with its mode variable.
[deleted] · 2022-02-14 18:07
i was looking for the second answer thank you for the answer, i completely forgot hooks.