Reputation: 32426
How can I stop semantic-mode
from clobbering buffer-local variables in derived modes? In my case I want semantic in C/C++, but I don't want it to setup in modes derived from these. Currently, I use semantic for the following
(setq semantic-new-buffer-setup-functions
'((c-mode . semantic-default-c-setup)
(c++-mode . semantic-default-c-setup)
(srecode-template-mode . srecode-template-setup-parser)))
and attempt to disable it with
(add-to-list 'semantic-inhibit-functions
(lambda () (not (memq major-mode '(c-mode c++-mode srecode-template-mode)))))
However, if I enter a derived mode, like bison-mode
, semantic still runs its setup since it is hooked into c/c++, clobbering any variables I set in my bison-mode-hook
, in this case imenu-create-index-function
. How can I stop semantic
from setting up derived modes?
Upvotes: 0
Views: 167