5

I've set up cedet/semantic code completion for my c++ projects (using this tutorial: http://alexott.net/en/writings/emacs-devenv/EmacsCedet.html) but do not want the or all the helpers it (automagically it seems to me) offers in lisp mode.

So, my question is how to disable them in lisp-mode or have them enabled in c++-mode only.

Thanks, Rene.

1 Answers1

3

I think, that you need to slightly change config that is in the article - there are many global modes are used there, for example:

(global-srecode-minor-mode 1)
(global-semantic-mru-bookmark-mode 1)

etc. you can enable corresponding semantic-mru-bookmark-mode, srecode-minor-mode, etc. in the common C mode hook, like:

(defun my-c-mode-cedet-hook ()
  (semantic-mru-bookmark-mode 1)
  ;; .....
  )
(add-hook 'c-mode-common-hook 'my-c-mode-cedet-hook)

Or disable these modes for Lisp only... The other modes include semantic-auto-parse-mode, semantic-idle-summary-mode, semantic-idle-scheduler-mode - you can get this list using M-x apropos semantic.*mode

And the main thing here - you need to use semantic-load-enable-minimum-features in your config to enable minimal number of features by default, and enable other necessary features only in C/C++ mode hook...

Alex Ott
  • 80,552
  • 8
  • 87
  • 132
  • Thanks for your answer. It pointed me in the right direction but is not quite complete. Doing it this way makes semantic complain that the _Buffer was not set up for parsing_. What I had to do was: `(add-hook 'c-mode-common-hook '(lambda () (add-hook 'semantic-init-hook 'my-c-mode-semantic-hook t t)))` This ensures that semantic is setting up the buffer for parsing and that it's init hook is buffer local (the t as fourth parameter to add-hook makes the hook buffer-local). – deepthought42 Jul 22 '11 at 20:42
  • Yes, maybe... I always used semantic/cedet in maximal to make its debugging more easier – Alex Ott Jul 23 '11 at 08:28