elisp - Emacs CEDET Hook -
i want hook cedet modes c++ mode. using following script in .emacs file:
(add-hook 'c++-mode-hook (lambda () ... (my_cedet_load) ) )
where
(defun my_cedet_load () (interactive) (semantic-mode) (global-semantic-stickyfunc-mode t) (global-semantic-idle-scheduler-mode t) (global-semantic-idle-completions-mode t) (global-semantic-highlight-edits-mode t) )
now, problem once open .cpp file, semantic-mode enabled in buffers. how enable such mode in .cpp files?
semantic global minor mode. semantic.el
to enable semantic, turn on `semantic-mode', global minor mode (m-x semantic-mode ret, or "source code parsers" tools menu). enable @ startup, put (semantic-mode 1) in init file.
as such when semantic-mode
enabled in buffers. can use semantic-inhibit-functions
restrict buffers in semantic
activated. documentation
list of functions call no arguments before semantic setup. if of these functions returns non-nil, current buffer not setup use semantic.
below example of using variable. instruct semantic
activated in c-mode
, cc-mode
, java-mode
buffers
(add-to-list 'semantic-inhibit-functions (lambda () (not (member major-mode '(java-mode c-mode c++-mode)))))
Comments
Post a Comment