-
Notifications
You must be signed in to change notification settings - Fork 32
/
README.html
289 lines (225 loc) · 7.34 KB
/
README.html
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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
lang="en" xml:lang="en">
<head>
<title>README</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<meta name="generator" content="Org-mode"/>
<meta name="generated" content="2012-01-06 22:28:33 CST"/>
<meta name="author" content="brianjcj"/>
<meta name="description" content=""/>
<meta name="keywords" content=""/>
<style type="text/css">
<!--/*--><![CDATA[/*><!--*/
html { font-family: Times, serif; font-size: 12pt; }
.title { text-align: center; }
.todo { color: red; }
.done { color: green; }
.tag { background-color: #add8e6; font-weight:normal }
.target { }
.timestamp { color: #bebebe; }
.timestamp-kwd { color: #5f9ea0; }
.right {margin-left:auto; margin-right:0px; text-align:right;}
.left {margin-left:0px; margin-right:auto; text-align:left;}
.center {margin-left:auto; margin-right:auto; text-align:center;}
p.verse { margin-left: 3% }
pre {
border: 1pt solid #AEBDCC;
background-color: #F3F5F7;
padding: 5pt;
font-family: courier, monospace;
font-size: 90%;
overflow:auto;
}
table { border-collapse: collapse; }
td, th { vertical-align: top; }
th.right { text-align:center; }
th.left { text-align:center; }
th.center { text-align:center; }
td.right { text-align:right; }
td.left { text-align:left; }
td.center { text-align:center; }
dt { font-weight: bold; }
div.figure { padding: 0.5em; }
div.figure p { text-align: center; }
textarea { overflow-x: auto; }
.linenr { font-size:smaller }
.code-highlighted {background-color:#ffff00;}
.org-info-js_info-navigation { border-style:none; }
#org-info-js_console-label { font-size:10px; font-weight:bold;
white-space:nowrap; }
.org-info-js_search-highlight {background-color:#ffff00; color:#000000;
font-weight:bold; }
/*]]>*/-->
</style>
<script type="text/javascript">
<!--/*--><![CDATA[/*><!--*/
function CodeHighlightOn(elem, id)
{
var target = document.getElementById(id);
if(null != target) {
elem.cacheClassElem = elem.className;
elem.cacheClassTarget = target.className;
target.className = "code-highlighted";
elem.className = "code-highlighted";
}
}
function CodeHighlightOff(elem, id)
{
var target = document.getElementById(id);
if(elem.cacheClassElem)
elem.className = elem.cacheClassElem;
if(elem.cacheClassTarget)
target.className = elem.cacheClassTarget;
}
/*]]>*///-->
</script>
</head>
<body>
<div id="preamble">
</div>
<div id="content">
<h1 class="title">README</h1>
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#sec-1">1 Introduction </a></li>
<li><a href="#sec-2">2 Install </a></li>
<li><a href="#sec-3">3 Screenshot </a></li>
<li><a href="#sec-4">4 Note </a></li>
<li><a href="#sec-5">5 Troubleshooting </a></li>
</ul>
</div>
</div>
<div id="outline-container-1" class="outline-2">
<h2 id="sec-1"><span class="section-number-2">1</span> Introduction </h2>
<div class="outline-text-2" id="text-1">
<p>
The AC sources for Clang.
Combine the power of AC, Clang and Yasnippet.
</p>
<p>
if you don't have Yasnippet, I recommend you install one.
if you don't want to install Yasnippet, you can try snippet.el instead.
if you don't install any of them, this script will still work for you any way.
</p>
</div>
</div>
<div id="outline-container-2" class="outline-2">
<h2 id="sec-2"><span class="section-number-2">2</span> Install </h2>
<div class="outline-text-2" id="text-2">
<p>
Here is my configurations for AC and auto-complete-clang for your reference.
</p>
<pre class="example">(add-to-list 'load-path (concat myoptdir "AC"))
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories (concat myoptdir "AC/ac-dict"))
(require 'auto-complete-clang)
(setq ac-auto-start nil)
(setq ac-quick-help-delay 0.5)
;; (ac-set-trigger-key "TAB")
;; (define-key ac-mode-map [(control tab)] 'auto-complete)
(define-key ac-mode-map [(control tab)] 'auto-complete)
(defun my-ac-config ()
(setq-default ac-sources '(ac-source-abbrev ac-source-dictionary ac-source-words-in-same-mode-buffers))
(add-hook 'emacs-lisp-mode-hook 'ac-emacs-lisp-mode-setup)
;; (add-hook 'c-mode-common-hook 'ac-cc-mode-setup)
(add-hook 'ruby-mode-hook 'ac-ruby-mode-setup)
(add-hook 'css-mode-hook 'ac-css-mode-setup)
(add-hook 'auto-complete-mode-hook 'ac-common-setup)
(global-auto-complete-mode t))
(defun my-ac-cc-mode-setup ()
(setq ac-sources (append '(ac-source-clang ac-source-yasnippet) ac-sources)))
(add-hook 'c-mode-common-hook 'my-ac-cc-mode-setup)
;; ac-source-gtags
(my-ac-config)
</pre>
</div>
</div>
<div id="outline-container-3" class="outline-2">
<h2 id="sec-3"><span class="section-number-2">3</span> Screenshot </h2>
<div class="outline-text-2" id="text-3">
<p>
Refer to the screenshot folder.
</p>
</div>
</div>
<div id="outline-container-4" class="outline-2">
<h2 id="sec-4"><span class="section-number-2">4</span> Note </h2>
<div class="outline-text-2" id="text-4">
<ul>
<li>Now clang is able to parse codes from standard output. Saving the
file before parsing is no longer necessary. So the default value of
ac-clang-auto-save is now changed to nil. If you still use the old
version of clang and this may not work for you. In this case, you
can change the ac-clang-auto-save back to t.
</li>
</ul>
</div>
</div>
<div id="outline-container-5" class="outline-2">
<h2 id="sec-5"><span class="section-number-2">5</span> Troubleshooting </h2>
<div class="outline-text-2" id="text-5">
<ul>
<li>clang fails to find the standard inlcude files?
<p>
It is because clang's include file search path is not correct. Here is the solution:
</p><ul>
<li>find out the include file search pathes of your g++:
<pre class="example">echo "" | g++ -v -x c++ -E -
</pre>
<p>
you wil get something like this:
</p>
<pre class="example">#include "..." search starts here:
#include <...> search starts here:
/usr/include/c++/4.6
/usr/include/c++/4.6/x86_64-linux-gnu/.
/usr/include/c++/4.6/backward
/usr/lib/gcc/x86_64-linux-gnu/4.6.1/include
/usr/local/include
/usr/lib/gcc/x86_64-linux-gnu/4.6.1/include-fixed
/usr/include/x86_64-linux-gnu
/usr/include
End of search list.
</pre>
</li>
<li>setting the ac-clang-flags to include these default include pathes.
e.g.,
<pre class="example">(setq ac-clang-flags
(mapcar (lambda (item)(concat "-I" item))
(split-string
"
/usr/include/c++/4.6
/usr/include/c++/4.6/x86_64-linux-gnu/.
/usr/include/c++/4.6/backward
/usr/lib/gcc/x86_64-linux-gnu/4.6.1/include
/usr/local/include
/usr/lib/gcc/x86_64-linux-gnu/4.6.1/include-fixed
/usr/include/x86_64-linux-gnu
/usr/include
"
)))
</pre>
</li>
</ul>
<p> You can put it into your .emacs file.
</p>
<p>
Then code completion works just fine!
</p></li>
</ul>
</div>
</div>
</div>
<div id="postamble">
<p class="date">Date: 2012-01-06 22:28:33 CST</p>
<p class="author">Author: brianjcj</p>
<p class="creator">Org version 7.7 with Emacs version 24</p>
<a href="http://validator.w3.org/check?uri=referer">Validate XHTML 1.0</a>
</div>
</body>
</html>