Hi Dejan,
On Wednesday 06 January 2010 11:05 AM, Dejan Pangercic wrote:
> Hi there,
>
> would anyone be so nice to share his/her .emacs configuration setup
> for c++ code auto-completion using CEDET's Semantic and EDE tools? Or
> maybe point me to the corresponding tutorial(s), I namely could not
> find anything...
>
When I was starting out with CEDET, it took me a long time to understand
some these basic things despite all the resources out there. So here you
go, just something to ease your journey.
> thx in advance, D.
>
--
Suvayu
Open source is the future. It sets us free.
--------------------------------------------------
> ;; CEDET load path
> (load-file "/path/to/cedet/common/cedet.elc")
> (setq semantic-load-turn-useful-things-on t)
> (semantic-load-enable-gaudy-code-helpers)
>
> ;; loading CEDET libraries
> (require 'semantic-ia)
> (require 'semantic-gcc)
> (require 'eassist)
>
> ;; eassist-header-switches associates source files with header files
> ;; based on file name extension eassist-switch-h-cpp uses this var.
> ;; the order to specify is '(source1 source2 ... header)
> (add-to-list 'eassist-header-switches '("C" "cxx" "h"))
>
> ;; eassist keybinds
> ;; (define-key global-map (kbd "s-<tab>") 'semantic-ia-complete-tip)
> (defun my-c-mode-common-hook ()
> (define-key c-mode-base-map (kbd "M-o") 'eassist-switch-h-cpp)
> (define-key c-mode-base-map (kbd "M-m") 'eassist-list-methods)
> ;; switches b/w the implementation and prototype declaration
> (define-key c-mode-base-map (kbd "M-p") 'semantic-analyze-proto-impl-toggle)
> ;; `C-<tab>' completes symbol with semantic loaded
> (define-key c-mode-base-map (kbd "C-<tab>") 'semantic-ia-complete-symbol-menu)
> (define-key c-mode-base-map (kbd "s-<tab>") 'semantic-ia-complete-symbol))
> (add-hook 'c-mode-common-hook 'my-c-mode-common-hook)
>
> ;; CEDET parsing customisations
> (setq project-home "/path/to/headers")
> (semantic-add-system-include project-home 'c++-mode)
|