I am trying to use a certain minor mode (inferior-scheme-mode
), which is activated by M-x run-scheme
. But its key combinations are masked by another competing minor mode (geiser-mode
).
How can I configure Emacs to automatically disable the competing/conflicting minor mode when activating the one that I need?
I tried the following elisp in init.el
to no avail (I don't know much about elisp):
(autoload 'run-scheme "cmuscheme" "Run an inferior Scheme" t)
(defun enable-inf-scheme-mode()
"Turns on inferior-scheme-mode and turn off conflicting modes (geiser-mode)"
(geiser-mode 0))
(add-hook 'inferior-scheme-mode-hook 'enable-inf-scheme-mode)
However, I can manually disable the conflicting mode using M-: (geiser-mode 0)
.
Note: run-scheme
creates a new inferior-scheme-mode
buffer that hides the original scheme-mode
buffer (somewhat annoyingly). I wanted to disable the geiser-mode
on the original scheme-mode
buffer. I am not sure if this is why the code isn't working.
geiser-mode
is enabled. A quick solution is to write a function to enablegeiser-mode
, but only when your other mode isn't enabled, and use the new function in hooks.geiser-mode
is always enabled somehow in my .init.el. I actually tried to remove geiser, but unsuccessfully. Geiser is always there inC-h m
, unless I remove my whole scheme lines.geiser
) and probably spreading multiple files. I also accidentally includedgeiser
in another unrelated.el
file because of copy-and-pasting from online examples. I think this goes against minimal completeness.