I'm writing an extension to a major mode (
coq-mode) that adds extra features, plus a few keybindings.
To makes it easy to disable or redefine these keybindings, I packaged them in a keymap. That keymap is tied to a
myplugin-keybindings-minor-mode minor mode, which gets enabled in
Most of these keybindings do not make sense outside of
coq-mode. Yet when I open new buffers from a
myplugin-keybindings-minor-mode is enabled in the newly opened buffer.
How do I prevent this from happening? How do I tie my minor mode to
coq-mode, so that
myplugin-keybindings-minor-mode is never active when
coq-mode isn't? Altenatively, which other approach should I use?
The minor mode is enabled by using
(add-hook 'coq-mode-hook #'myplugin-initialize), and
EDIT2: You can see the problem I'm talking about by opening a
diff-mode buffer (
C-x f test.diff), and then running
M-x shell from it. The shell buffer had the
Diff-Auto-Refine mode on, inherited from the diff buffer. This isn't a problem for
Diff-Auto-Refine, but it is for