Emacs: Using and Initializing CEDET

I use Emacs with CEDET and automatically exit to complete the code. Initially, I set up CEDET to boot into Emacs every time.

However, it took quite a while, so I thought it would be wise to load it if necessary, that is - in my case - when entering C ++ - Mode.

So, I translated the original function into lambda , which is called when entering C ++ - mode:

 ; cscope for c(++) programming (finding symbols, etc.) (require 'xcscope) ; C++ stuff (add-hook 'c++-mode-hook (lambda () (load-file "/usr/share/emacs/site-lisp/cedet-common/cedet.el") (global-ede-mode 1) ; enable project management system (semantic-load-enable-code-helpers) ; enable prototype help and smart completion (require 'auto-complete-config) (add-to-list 'ac-dictionary-directories "~/elisp/ac-dict") (add-to-list 'ac-sources 'ac-source-semantic) (local-set-key (kbd "C-:") 'semantic-ia-complete-symbol-menu) ; set shortcut for auto completion. (local-set-key (kbd "C-.") 'ac-complete-semantic) (ac-config-default) ) ) 

There are no errors, but I have the following problem: when Emacs first enters C ++ mode, code completion does not work properly. But if Emacs goes into C ++ mode a second time, everything works fine.

Does anyone know what I'm doing wrong?

+6
emacs elisp hook cedet
source share
1 answer

CEDET initialization sets up its own C and C ++ hooks. If it sets it to the hook when it launches the same hook, then it will not start and your first buffer will not be initialized.

What you can do is load CEDET at startup, and then run the code assistants in C mode. Thus, C ++ mode will be initialized using local-mode, but additional functions will be set after the hook starts, so this may work. I have not tried it myself.

I think EDE mode is not slow, so this is probably normal at startup too.

+8
source share

All Articles