[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Is it possible to have a global minor mode disabled whenever a certain
Is it possible to have a global minor mode disabled whenever a certain major mode is enabled?
Wed, 14 Jul 2010 12:06:33 +0100
I have a global minor mode (highlight-symbol) that conflicts with a
major mode (js2-mode). I have seen an alternative implementation of
highlight symbol that doesn't conflict, but it has some issues of its
own. I would rather just disable highlight-symbol whenever js2-mode is
loaded, but I can't work out how to do this.
I have some code like this in my init files:
;make it a global mode, and switch it on
(defun highlight-symbol-mode-on ()
"Turn on function `highlight-symbol-mode'."
(defun highlight-symbol-mode-off ()
"Turn off function `highlight-symbol-mode'."
(add-hook 'js2-mode-hook 'highlight-symbol-mode-off)
But though the hook at the end is called, highlight-symbol is still
switched on in js2-mode buffers. I guess this might be because the
global minor mode is enabled after js2-mode has already loaded? Or
some other load-order issue.
- Is it possible to have a global minor mode disabled whenever a certain major mode is enabled?,
James Gregory <=