My favorites | Sign in
Project Home Downloads Wiki Issues Source
Repository:
Checkout   Browse   Changes   Clones    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
;; Compilation
(setq compilation-scroll-output t)

;; cedet
(load-file "~/emacs/cedet-1.0/common/cedet.el")
(require 'semantic-ia)
(require 'semantic-gcc)

;; * This enables the database and idle reparse engines
;;(semantic-load-enable-minimum-features)

;; * This enables some tools useful for coding, such as summary mode
;; imenu support, and the semantic navigator
;; (semantic-load-enable-code-helpers)

;; * This enables even more coding tools such as the nascent intellisense mode
;; decoration mode, and stickyfunc mode (plus regular code helpers)
;; (semantic-load-enable-guady-code-helpers)

;; * This turns on which-func support (Plus all other code helpers)
(semantic-load-enable-excessive-code-helpers)
(setq semantic-load-turn-everything-on t)
(require 'semantic-load)


;; This turns on modes that aid in grammar writing and semantic tool
;; development. It does not enable any other features such as code
;; helpers above.
;; (semantic-load-enable-semantic-debugging-helpers)

(c-set-offset 'inline-open 0)
(c-set-offset 'friend '-)
(c-set-offset 'substatement-open 0)
;; (add-hook 'c-mode-common-hook
;; (function (lambda ()
;; (paren-toggle-open-paren-context 1))))

(setq c-basic-offset 4)

(defun my-c-mode-common-hook()
(setq tab-width 4 indent-tabs-mode nil)
;; hungry-delete and auto-newline
;; (c-toggle-auto-hungry-state 1)

(setq default-tab-width 4)
(setq column-number-mode t)

;; (define-key c-mode-base-map [(control \`)] 'hs-toggle-hiding)
;; (define-key c-mode-base-map [(return)] 'newline-and-indent)
;; (define-key c-mode-base-map [(f7)] 'compile)
;; (define-key c-mode-base-map [(meta \`)] 'c-indent-command)
;; (define-key c-mode-base-map [(tab)] 'hippie-expand)
;; (define-key c-mode-base-map [(tab)] 'my-indent-or-complete)
;; (define-key c-mode-base-map [(meta ?/)] 'semantic-ia-complete-symbol-menu)

(local-set-key [(control return)] 'semantic-ia-complete-symbol)
(local-set-key "\C-c?" 'semantic-ia-complete-symbol-menu)
(local-set-key "\C-c>" 'semantic-complete-analyze-inline)
(local-set-key "\C-cp" 'semantic-analyze-proto-impl-toggle)
(define-key company-mode-map "\t" nil)
(define-key company-mode-map [(backtab)] 'company-complete-common)
;; (local-set-key "." 'semantic-complete-self-insert)
;; (local-set-key ">" 'semantic-complete-self-insert)

(setq c-macro-shrink-window-flag t)
(setq c-macro-preprocessor "cpp")
(setq c-macro-cppflags " ")
(setq c-macro-prompt-flag t)
(setq hs-minor-mode t)
(setq abbrev-mode t)
)

(add-hook 'c-mode-common-hook 'my-c-mode-common-hook)

;; Company-mode
(add-to-list 'load-path (expand-file-name "~/emacs/company"))
(load-file "~/emacs/company/company.el")

;; (require 'company-mode)
;; (require 'company-bundled-completions)

;; (company-install-bundled-completions-rules)
(add-hook 'c++-mode-hook 'company-mode)
(add-hook 'c-mode-hook 'company-mode)
(define-key company-mode-map "\M-n" 'company-cycle)
(define-key company-mode-map "\M-p" 'company-cycle-backwards)
;; ;; after these many seconds, completions will showe up automatically
(setq company-idle-delay nil)
;; only when these many chars have been typed, the completions will show up
;; and this take higher priority on company-idle-delay which means completions will
;; not show up if the chars are too few regardless how many seconds has passed
(setq company-complete-on-idle-min-chars 100)
;; after these many seconds, company tooltip window show up where you can use M-p
;; and M-n to navigate between all the completions
(setq company-tooltip-delay 1)
;; company-complet-on-edit 3, then completion will automatically show up IMMEDIATELY
;; after u wrote 3 characters without waiting for company-idle-delay seconds,
;; for example, there will be a standstill between '#in' and 'clude' since company need
;; to find completions.
;; That's exactly why i set it to nil to turn it off.
(setq company-complete-on-edit nil)

;; (autoload 'company-mode "company" nil t)

(autoload 'senator-try-expand-semantic "senator")
(setq semanticdb-default-save-directory "~/tmp")
(setq semantic-idle-scheduler-idle-time 432000)

(setq hippie-expand-try-functions-list
'(
senator-try-expand-semantic
try-expand-dabbrev
try-expand-dabbrev-visible
try-expand-dabbrev-all-buffers
try-expand-dabbrev-from-kill
try-expand-list
try-expand-list-all-buffers
try-expand-line
try-expand-line-all-buffers
try-complete-file-name-partially
try-complete-file-name
try-expand-whole-kill
)
)

;; (global-set-key [(f11)] 'speedbar)
(global-set-key [(f11)] 'semantic-ia-show-summary)

(global-ede-mode t)

;; Danimos-specified configurations
(add-to-list 'semanticdb-project-roots "~/griffin/linux-2.6.22.19-vs2.2.0.7")

(setq semanticdb-project-roots
(list
(expand-file-name "/")))

(setq griffin-base-dir "/home/wyx/griffin/linux-2.6.22.19-vs2.2.0.7")

(add-to-list 'auto-mode-alist (cons griffin-base-dir 'c++-mode))
(add-to-list 'auto-mode-alist (cons griffin-base-dir 'c-mode))

;; (setq semanticdb-project-roots
;; (list
;; (expand-file-name "/")))
;;
;; (setq danimos-base-dir "/home/wyx/danimos")
;;
;; (add-to-list 'auto-mode-alist (cons danimos-base-dir 'c++-mode))
;; (add-to-list 'auto-mode-alist (cons danimos-base-dir 'c-mode))
;;
;; (add-to-list 'semantic-lex-c-preprocessor-symbol-file
;; (concat danimos-base-dir "/xen/include/config.h"))
;; (add-to-list 'semantic-lex-c-preprocessor-symbol-file
;; (concat danimos-base-dir "/xen/include/asm-x86/config.h"))

(ede-cpp-root-project "Griffin"
:name "Griffin"
;; Any file at root directory of the project
:file "~/griffin/linux-2.6.22.19-vs2.2.0.7/Makefile"
;; Relative to the project's root directory
:include-path '("/"
"/include/asm-x86_64"
"/include/linux"
)
)

;; (ede-cpp-root-project "Cerberus"
;; :name "Cerberus"
;; ;; Any file at root directory of the project
;; :file "~/m2-shadow/linux-2.6.18/Makefile"
;; ;; Relative to the project's root directory
;; :include-path '("/"
;; "/include/asm-x86_64"
;; "/include/xen"
;; "/include/linux"
;; )
;; ;; Pre-definds macro for preprocessing
;; :spp-table '(("__XEN__" . "")
;; ))

;; Configuration for project Nexus
;; (ede-cpp-root-project "Nexus"
;; :name "Nexus"
;; ;; Any file at root directory of the project
;; :file "~/nexus/GNUmakefile"
;; ;; Relative to the project's root directory
;; :include-path '("/"
;; "/inc"
;; )
;; ;; Pre-definds macro for preprocessing
;; ;; :spp-table '(("__XEN__" . "")
;; )

;; ECB configurations
(add-to-list 'load-path "~/emacs/ecb-2.40")

(require 'ecb)

(ecb-layout-define "my-cscope-layout" left nil
(ecb-set-methods-buffer)
(ecb-split-ver 0.5 t)
(other-window 1)
(ecb-set-cscope-buffer))

(defecb-window-dedicator ecb-set-cscope-buffer " *ECB cscope-buf*"
(switch-to-buffer "*cscope*"))

(setq ecb-layout-name "my-cscope-layout")

;; Disable buckets so that history buffer can display more entries
(setq ecb-history-make-buckets 'never)

Change log

53e5d119d594 by Wang Yuanxuan on Sep 5, 2011   Diff
Merge
Go to: 
Project members, sign in to write a code review

Older revisions

2b10a99aa294 by Wang Yuanxuan <zellux> on Mar 12, 2011   Diff
Add emac-rails
bfb2ead08feb by Wang Yuanxuan <zellux> on Nov 12, 2010   Diff
ede config for project ex-toposort
13aca3c06e4a by Wang Yuanxuan <zellux> on Apr 13, 2010   Diff
Monthly update
All revisions of this file

File info

Size: 7382 bytes, 213 lines
Powered by Google Project Hosting