;;; CEDET (eval-when-compile (load-file "~/.emacs.d/pb-cl-path.el")) (require 'cc-mode) (require 'eldoc) ; needed for semantic-idle to work (require 'eassist) (message "<<< Loading pb-cedet") ;;--------------------- Load CEDET (load-file "~/.emacs.d/lib/cedet/common/cedet.elc") ;; use EDE project system ;(global-ede-mode t) ;(setq-mode-local c-mode semanticdb-find-default-throttle ; '(project unloaded system recursive)) ;---------------------- base + custom (only activate what we need and use) ;(semantic-load-enable-minimum-features) (semantic-load-enable-code-helpers) (global-semantic-decoration-mode 1) (require 'semantic-decorate-include) (global-semantic-highlight-func-mode 1) (if (fboundp #'which-func-mode) (add-hook 'semantic-init-hooks (lambda () (which-func-mode 1)))) ;(global-semantic-show-unmatched-syntax-mode 1) ; face for idle-tag-highlight-mode ;(setq semantic-idle-summary-highlight-face 'semantic-highlight-symbol) ;(global-semantic-idle-tag-highlight-mode 1) ;-------------------------------------------------------------------------- ; Options (enable-visual-studio-bookmarks) ;(global-semantic-tag-folding-mode 1) ;; ctags support ;(require 'semantic-ectag-util) ;(semantic-load-enable-all-exuberent-ctags-support) ; highlight compilation errors (require 'lmcompile) (add-hook 'compilation-finish-functions 'vj-compilation-finish-highlight) (defun vj-compilation-finish-highlight (buffer result-str) (interactive) (lmcompile-do-highlight) ) ; ask gcc for config for cedet (require 'semantic-gcc) (semantic-gcc-setup) ;; DEBUG: do not save ~/.semanticdb ;(setq-default semanticdb-new-database-class 'semanticdb-project-database) ; semanticdb + global (require 'semanticdb-global) (semanticdb-enable-gnu-global-databases 'c-mode) (semanticdb-enable-gnu-global-databases 'c++-mode) ; srecode ;(require 'srecode) ;(global-srecode-minor-mode 1) ;;--------------------- End of Load of CEDET ;;---------------------- Qt4 -------------------- ;; (setq qt4-base-dir "/usr/include/qt4") ;; (semantic-add-system-include qt4-base-dir 'c++-mode) ;; (add-to-list 'auto-mode-alist (cons qt4-base-dir 'c++-mode)) ;; (add-to-list 'semantic-lex-c-preprocessor-symbol-file (concat qt4-base-dir "/Qt/qconfig.h")) ;; (add-to-list 'semantic-lex-c-preprocessor-symbol-file (concat qt4-base-dir "/Qt/qconfig-dist.h")) ;;---------------------- Keyboard --------------- (add-hook 'c-initialization-hook (lambda () (define-key c-mode-base-map (kbd "M-m") 'eassist-list-methods) (define-key c-mode-base-map (kbd "M-s") 'semantic-symref) ;; (define-key c-mode-base-map "." 'semantic-complete-self-insert) ;; (define-key c-mode-base-map ">" 'semantic-complete-self-insert) )) ;;--------------------- Doc Mode (require 'doc-mode) (defun my-cedet-c++-mode-hook () ;; doc-mode (doc-mode) (setq doc-mode-template-keyword-char "\\") (setq doc-mode-template-start "/*!") (setq doc-mode-template-continue " * ") (setq doc-mode-template-end " */") (setq doc-mode-allow-single-line-comments nil) (setq doc-mode-template-empty-line-after-summary t) (setq doc-mode-template-empty-line-before-keywords t) ) (add-hook 'c++-mode-hook 'my-cedet-c++-mode-hook) (add-hook 'c-mode-hook 'my-cedet-c++-mode-hook) ;;--------------------- end of Doc Mode (message ">>> Loaded pb-cedet") (provide 'pb-cedet)