Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 170 lines (141 sloc) 6.208 kb
a674837 @alexott update configs
authored
1 ;;; emacs-rc-cedet.el ---
2
4fb19e9 @alexott add configuration for java
authored
3 (load-file "~/projects/cedet-bzr/cedet-devel-load.el")
acc7454 @alexott update configs
authored
4 (load-file "~/projects/cedet-bzr/contrib/cedet-contrib-load.el")
5 ;;(add-to-list 'load-path "~/projects/cedet-bzr/contrib/")
4fb19e9 @alexott add configuration for java
authored
6 (add-to-list 'Info-directory-list "~/projects/cedet-bzr/doc/info")
0fbb20b @alexott switch to new CEDET
authored
7
91c4325 @alexott update configs
authored
8 (add-to-list 'semantic-default-submodes 'global-semanticdb-minor-mode)
0fbb20b @alexott switch to new CEDET
authored
9 (add-to-list 'semantic-default-submodes 'global-semantic-mru-bookmark-mode)
10 (add-to-list 'semantic-default-submodes 'global-semanticdb-minor-mode)
11 (add-to-list 'semantic-default-submodes 'global-semantic-idle-scheduler-mode)
e8ece07 @alexott more config's optimizations
authored
12 ;(add-to-list 'semantic-default-submodes 'global-semantic-stickyfunc-mode)
0fbb20b @alexott switch to new CEDET
authored
13 (add-to-list 'semantic-default-submodes 'global-cedet-m3-minor-mode)
14 (add-to-list 'semantic-default-submodes 'global-semantic-highlight-func-mode)
15 ;;(add-to-list 'semantic-default-submodes 'global-semantic-show-unmatched-syntax-mode)
16 ;;(add-to-list 'semantic-default-submodes 'global-semantic-highlight-edits-mode)
17 ;;(add-to-list 'semantic-default-submodes 'global-semantic-show-parser-state-mode)
18
19 ;; Activate semantic
20 (semantic-mode 1)
21
22 (require 'semantic/bovine/c)
23 (require 'semantic/bovine/clang)
acc7454 @alexott update configs
authored
24
25 (require 'cedet-files)
91c4325 @alexott update configs
authored
26
27 ;; loading contrib...
a674837 @alexott update configs
authored
28 (require 'eassist)
29
30 ;; customisation of modes
36ce5dd @alexott refactoring of init file
authored
31 (defun alexott/cedet-hook ()
4fb19e9 @alexott add configuration for java
authored
32 (local-set-key [(control return)] 'semantic-ia-complete-symbol-menu)
a674837 @alexott update configs
authored
33 (local-set-key "\C-c?" 'semantic-ia-complete-symbol)
34 ;;
91fb0a1 @alexott update configs
authored
35 (local-set-key "\C-c>" 'semantic-complete-analyze-inline)
a674837 @alexott update configs
authored
36 (local-set-key "\C-c=" 'semantic-decoration-include-visit)
37
38 (local-set-key "\C-cj" 'semantic-ia-fast-jump)
39 (local-set-key "\C-cq" 'semantic-ia-show-doc)
40 (local-set-key "\C-cs" 'semantic-ia-show-summary)
41 (local-set-key "\C-cp" 'semantic-analyze-proto-impl-toggle)
91c4325 @alexott update configs
authored
42 ;; (local-set-key (kbd "C-c <left>") 'semantic-tag-folding-fold-block)
43 ;; (local-set-key (kbd "C-c <right>") 'semantic-tag-folding-show-block)
e8ece07 @alexott more config's optimizations
authored
44
45 (add-to-list 'ac-sources 'ac-source-semantic)
a674837 @alexott update configs
authored
46 )
0efeedb @alexott update configs to latest version
authored
47 ;; (add-hook 'semantic-init-hooks 'alexott/cedet-hook)
36ce5dd @alexott refactoring of init file
authored
48 (add-hook 'c-mode-common-hook 'alexott/cedet-hook)
49 (add-hook 'lisp-mode-hook 'alexott/cedet-hook)
0020615 @alexott update configs
authored
50 (add-hook 'scheme-mode-hook 'alexott/cedet-hook)
36ce5dd @alexott refactoring of init file
authored
51 (add-hook 'emacs-lisp-mode-hook 'alexott/cedet-hook)
0efeedb @alexott update configs to latest version
authored
52 (add-hook 'erlang-mode-hook 'alexott/cedet-hook)
a674837 @alexott update configs
authored
53
36ce5dd @alexott refactoring of init file
authored
54 (defun alexott/c-mode-cedet-hook ()
a674837 @alexott update configs
authored
55 ;; (local-set-key "." 'semantic-complete-self-insert)
56 ;; (local-set-key ">" 'semantic-complete-self-insert)
57 (local-set-key "\C-ct" 'eassist-switch-h-cpp)
58 (local-set-key "\C-xt" 'eassist-switch-h-cpp)
59 (local-set-key "\C-ce" 'eassist-list-methods)
60 (local-set-key "\C-c\C-r" 'semantic-symref)
e8ece07 @alexott more config's optimizations
authored
61
91c4325 @alexott update configs
authored
62 (add-to-list 'ac-sources 'ac-source-gtags)
a674837 @alexott update configs
authored
63 )
36ce5dd @alexott refactoring of init file
authored
64 (add-hook 'c-mode-common-hook 'alexott/c-mode-cedet-hook)
a674837 @alexott update configs
authored
65
91c4325 @alexott update configs
authored
66 (when (cedet-gnu-global-version-check t)
67 (semanticdb-enable-gnu-global-databases 'c-mode t)
68 (semanticdb-enable-gnu-global-databases 'c++-mode t))
a674837 @alexott update configs
authored
69
e8ece07 @alexott more config's optimizations
authored
70 (when (cedet-ectag-version-check t)
71 (semantic-load-enable-primary-ectags-support))
0fbb20b @alexott switch to new CEDET
authored
72
73 ;; SRecode
74 (global-srecode-minor-mode 1)
75
76 ;; EDE
77 (global-ede-mode 1)
78 (ede-enable-generic-projects)
a674837 @alexott update configs
authored
79
91c4325 @alexott update configs
authored
80 ;; helper for boost setup...
f79a920 @alexott update configs
authored
81 (defun c++-setup-boost (boost-root)
82 (when (file-accessible-directory-p boost-root)
acc7454 @alexott update configs
authored
83 (let ((cfiles (cedet-files-list-recursively boost-root "\\(config\\|user\\)\\.hpp")))
f79a920 @alexott update configs
authored
84 (dolist (file cfiles)
85 (add-to-list 'semantic-lex-c-preprocessor-symbol-file file)))))
0020615 @alexott update configs
authored
86
a674837 @alexott update configs
authored
87
88 ;; my functions for EDE
36ce5dd @alexott refactoring of init file
authored
89 (defun alexott/ede-get-local-var (fname var)
a674837 @alexott update configs
authored
90 "fetch given variable var from :local-variables of project of file fname"
91 (let* ((current-dir (file-name-directory fname))
92 (prj (ede-current-project current-dir)))
93 (when prj
94 (let* ((ov (oref prj local-variables))
95 (lst (assoc var ov)))
96 (when lst
97 (cdr lst))))))
98
99 ;; setup compile package
100 (require 'compile)
101 (setq compilation-disable-input nil)
102 (setq compilation-scroll-output t)
103 (setq mode-compile-always-save-buffer-p t)
36ce5dd @alexott refactoring of init file
authored
104
105 (defun alexott/compile ()
a674837 @alexott update configs
authored
106 "Saves all unsaved buffers, and runs 'compile'."
107 (interactive)
108 (save-some-buffers t)
acc7454 @alexott update configs
authored
109 (let* ((fname (or (buffer-file-name (current-buffer)) default-directory))
110 (current-dir (file-name-directory fname))
111 (prj (ede-current-project current-dir)))
112 (if prj
113 (project-compile-project prj)
114 (compile compile-command))))
36ce5dd @alexott refactoring of init file
authored
115 (global-set-key [f9] 'alexott/compile)
a674837 @alexott update configs
authored
116
117 ;;
0020615 @alexott update configs
authored
118 (defun alexott/gen-std-compile-string ()
119 "Generates compile string for compiling CMake project in debug mode"
120 (let* ((current-dir (file-name-directory
121 (or (buffer-file-name (current-buffer)) default-directory)))
122 (prj (ede-current-project current-dir))
0fbb20b @alexott switch to new CEDET
authored
123 (root-dir (ede-project-root-directory prj)))
0020615 @alexott update configs
authored
124 (concat "cd " root-dir "; make -j2")))
125
126 ;;
36ce5dd @alexott refactoring of init file
authored
127 (defun alexott/gen-cmake-debug-compile-string ()
a674837 @alexott update configs
authored
128 "Generates compile string for compiling CMake project in debug mode"
129 (let* ((current-dir (file-name-directory
130 (or (buffer-file-name (current-buffer)) default-directory)))
131 (prj (ede-current-project current-dir))
132 (root-dir (ede-project-root-directory prj))
133 (subdir "")
134 )
135 (when (string-match root-dir current-dir)
136 (setf subdir (substring current-dir (match-end 0))))
f79a920 @alexott update configs
authored
137 (concat "cd " root-dir "Debug/" "; make -j3")))
a674837 @alexott update configs
authored
138
acc7454 @alexott update configs
authored
139 ;;; Projects
0fbb20b @alexott switch to new CEDET
authored
140
141 ;; cpp-tests project definition
142 (when (file-exists-p "~/projects/lang-exp/cpp/CMakeLists.txt")
143 (setq cpp-tests-project
144 (ede-cpp-root-project "cpp-tests"
145 :file "~/projects/lang-exp/cpp/CMakeLists.txt"
146 :system-include-path '("/home/ott/exp/include"
147 boost-base-directory)
acc7454 @alexott update configs
authored
148 :compile-command "cd Debug && make -j2"
0fbb20b @alexott switch to new CEDET
authored
149 )))
150
151 (when (file-exists-p "~/projects/squid-gsb/README")
152 (setq squid-gsb-project
153 (ede-cpp-root-project "squid-gsb"
154 :file "~/projects/squid-gsb/README"
155 :system-include-path '("/home/ott/exp/include"
156 boost-base-directory)
acc7454 @alexott update configs
authored
157 :compile-command "cd Debug && make -j2"
0fbb20b @alexott switch to new CEDET
authored
158 )))
159
4fb19e9 @alexott add configuration for java
authored
160 ;; Setup JAVA....
161 (require 'semantic/db-javap)
91c4325 @alexott update configs
authored
162
163 ;; example of java-root project
164
acc7454 @alexott update configs
authored
165 ;; (ede-ant-project "Lucene"
91c4325 @alexott update configs
authored
166 ;; :file "~/work/lucene-solr/lucene-4.0.0/build.xml"
167 ;; :srcroot '("core/src")
acc7454 @alexott update configs
authored
168 ;; :classpath (cedet-files-list-recursively "~/work/lucene-solr/lucene-4.0.0/" ".*\.jar$")
91c4325 @alexott update configs
authored
169 ;; )
Something went wrong with that request. Please try again.