-
Notifications
You must be signed in to change notification settings - Fork 0
/
auto-complete.elc
460 lines (454 loc) · 58.5 KB
/
auto-complete.elc
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
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
;ELC
;;; Compiled by t@cappadonna on Mon Oct 21 22:11:08 2013
;;; from file /home/t/Downloads/auto-complete-1.3.1/auto-complete.el
;;; in Emacs version 23.3.1
;;; with all optimizations.
;;; This file uses dynamic docstrings, first added in Emacs 19.29.
;;; This file does not contain utf-8 non-ASCII characters,
;;; and so can be loaded in Emacs versions earlier than 23.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(require 'popup)
#@51 Report an error and disable `auto-complete-mode'.
(defalias 'ac-error #[(&optional var) "\300\301\302\217\207" [nil (byte-code "\301\302\"\210\303\304!\210\207" [var message "auto-complete error: %s" auto-complete-mode -1] 3) ((error))] 3 (#$ . 540)])
(custom-declare-group 'auto-complete nil "Auto completion." :group 'completion :prefix "ac-")
#@41 Delay to completions will be available.
(custom-declare-variable 'ac-delay '0.1 '(#$ . 894) :type 'float :group 'auto-complete)
#@60 Non-nil means completion menu will be automatically shown.
(custom-declare-variable 'ac-auto-show-menu '0.8 '(#$ . 1028) :type '(choice (const :tag "Yes" t) (const :tag "Never" nil) (float :tag "Timer")) :group 'auto-complete)
#@67 Non-nil means menu will be showed immediately on `auto-complete'.
(custom-declare-variable 'ac-show-menu-immediately-on-auto-complete 't '(#$ . 1261) :type 'boolean :group 'auto-complete)
#@71 Non-nil means expand whole common part on first time `auto-complete'.
(custom-declare-variable 'ac-expand-on-auto-complete 't '(#$ . 1455) :type 'boolean :group 'auto-complete)
#@64 Non-nil means disable automatic completion on specified faces.
(custom-declare-variable 'ac-disable-faces ''(font-lock-comment-face font-lock-string-face font-lock-doc-face) '(#$ . 1638) :type '(repeat symbol) :group 'auto-complete)
#@57 Non-nil means disble flymake temporarily on completing.
(custom-declare-variable 'ac-stop-flymake-on-completing 't '(#$ . 1877) :type 'boolean :group 'auto-complete)
#@35 Non-nil means use fuzzy matching.
(custom-declare-variable 'ac-use-fuzzy 't '(#$ . 2049) :type 'boolean :group 'auto-complete)
#@29 Cursor color in fuzzy mode.
(custom-declare-variable 'ac-fuzzy-cursor-color '"red" '(#$ . 2182) :type 'string :group 'auto-complete)
#@51 Non-nil means use intelligent completion history.
(custom-declare-variable 'ac-use-comphist 't '(#$ . 2321) :type 'boolean :group 'auto-complete)
#@47 Percentage of ignoring low scored candidates.
(custom-declare-variable 'ac-comphist-threshold '0.7 '(#$ . 2473) :type 'float :group 'auto-complete)
#@31 Completion history file name.
(custom-declare-variable 'ac-comphist-file '(expand-file-name (concat (if (boundp 'user-emacs-directory) user-emacs-directory "~/.emacs.d/") "/ac-comphist.dat")) '(#$ . 2627) :type 'string :group 'auto-complete)
#@31 Non-nil means use quick help.
(custom-declare-variable 'ac-use-quick-help 't '(#$ . 2875) :type 'boolean :group 'auto-complete)
#@27 Delay to show quick help.
(custom-declare-variable 'ac-quick-help-delay '1.5 '(#$ . 3009) :type 'float :group 'auto-complete)
#@31 Max height of candidate menu.
(custom-declare-variable 'ac-menu-height '10 '(#$ . 3141) :type 'integer :group 'auto-complete)
(defvaralias 'ac-candidate-menu-height 'ac-menu-height)
#@27 Max height of quick help.
(custom-declare-variable 'ac-quick-help-height '20 '(#$ . 3329) :type 'integer :group 'auto-complete)
#@64 Prefer X tooltip than overlay popup for displaying quick help.
(custom-declare-variable 'ac-quick-help-prefer-x 't '(#$ . 3463) :type 'boolean :group 'auto-complete)
#@57 Limit number of candidates. Non-integer means no limit.
(custom-declare-variable 'ac-candidate-limit 'nil '(#$ . 3635) :type 'integer :group 'auto-complete)
(defvaralias 'ac-candidate-max 'ac-candidate-limit)
#@46 Major modes `auto-complete-mode' can run on.
(custom-declare-variable 'ac-modes ''(emacs-lisp-mode lisp-interaction-mode c-mode cc-mode c++-mode java-mode clojure-mode scala-mode scheme-mode ocaml-mode tuareg-mode perl-mode cperl-mode python-mode ruby-mode ecmascript-mode javascript-mode js-mode js2-mode php-mode css-mode makefile-mode sh-mode fortran-mode f90-mode ada-mode xml-mode sgml-mode) '(#$ . 3850) :type '(repeat symbol) :group 'auto-complete)
#@63 Regexp to indicate what packages can work with auto-complete.
(custom-declare-variable 'ac-compatible-packages-regexp '"^ac-" '(#$ . 4312) :type 'string :group 'auto-complete)
#@76 Trigger commands that specify whether `auto-complete' should start or not.
(custom-declare-variable 'ac-trigger-commands ''(self-insert-command) '(#$ . 4494) :type '(repeat symbol) :group 'auto-complete)
#@79 Trigger commands that specify whether `auto-complete' should continue or not.
(custom-declare-variable 'ac-trigger-commands-on-completing ''(delete-backward-char backward-delete-char backward-delete-char-untabify) '(#$ . 4704) :type '(repeat symbol) :group 'auto-complete)
#@214 Non-nil means `auto-complete' will start by typing this key.
If you specify this TAB, for example, `auto-complete' will start by typing TAB,
and if there is no completions, an original command will be fallbacked.
(custom-declare-variable 'ac-trigger-key 'nil '(#$ . 4984) :type 'string :group 'auto-complete :set #[(symbol value) "\302 \"\210 \205 \303\304!\205 \304 !\207" [symbol value set-default fboundp ac-set-trigger-key] 3])
#@236 Non-nil means completion will be started automatically.
Positive integer means if a length of a word you entered is larger than the value,
completion will be started automatically.
If you specify `nil', never be started automatically.
(custom-declare-variable 'ac-auto-start '2 '(#$ . 5426) :type '(choice (const :tag "Yes" t) (const :tag "Never" nil) (integer :tag "Require")) :group 'auto-complete)
#@38 List of string to ignore completion.
(custom-declare-variable 'ac-ignores 'nil '(#$ . 5833) :type '(repeat string) :group 'auto-complete)
#@154 Non-nil means auto-complete ignores case.
If this value is `smart', auto-complete ignores case only when
a prefix doen't contain any upper case letters.
(custom-declare-variable 'ac-ignore-case ''smart '(#$ . 5978) :type '(choice (const :tag "Yes" t) (const :tag "Smart" smart) (const :tag "No" nil)) :group 'auto-complete)
#@62 Non-nil means `auto-complete' works based on Do What I Mean.
(custom-declare-variable 'ac-dwim 't '(#$ . 6308) :type 'boolean :group 'auto-complete)
#@79 Non-nil means a special keymap `ac-menu-map' on completing menu will be used.
(custom-declare-variable 'ac-use-menu-map 'nil '(#$ . 6463) :type 'boolean :group 'auto-complete)
#@104 Non-nil means `overriding-local-map' will be used to hack for overriding key events on auto-copletion.
(custom-declare-variable 'ac-use-overriding-local-map 'nil '(#$ . 6646) :type 'boolean :group 'auto-complete)
(byte-code "\300\301\302\303\304\305%\210\300\306\307\310\304\305%\210\300\311\312\313\304\305%\207" [custom-declare-face ac-completion-face ((t (:foreground "darkgray" :underline t))) "Face for inline completion" :group auto-complete ac-candidate-face ((t (:background "lightgray" :foreground "black"))) "Face for candidate." ac-selection-face ((t (:background "steelblue" :foreground "white"))) "Face for selected candidate."] 6)
#@32 Hook for `auto-complete-mode'.
(defvar auto-complete-mode-hook nil (#$ . 7297))
#@47 Dummy variable to suppress compiler warnings.
(defvar auto-complete-mode nil (#$ . 7383))
#@19 Old cursor color.
(defvar ac-cursor-color nil (#$ . 7479))
#@29 Inline completion instance.
(defvar ac-inline nil (#$ . 7544))
#@16 Menu instance.
(defvar ac-menu nil (#$ . 7613))
#@34 Flag to show menu on timer tick.
(defvar ac-show-menu nil (#$ . 7667))
#@61 Cons of prefix marker and selected item of last completion.
(defvar ac-last-completion nil (#$ . 7744))
#@21 Quick help instance
(defvar ac-quick-help nil (#$ . 7854))
#@66 Non-nil means `auto-complete-mode' is now working on completion.
(defvar ac-completing nil (#$ . 7919))
#@40 Buffer where auto-complete is started.
(defvar ac-buffer nil (#$ . 8029))
#@24 Start point of prefix.
(defvar ac-point nil (#$ . 8109))
#@33 Last point of updating pattern.
(defvar ac-last-point nil (#$ . 8172))
#@16 Prefix string.
(defvar ac-prefix nil (#$ . 8249))
(defvaralias 'ac-target 'ac-prefix)
#@26 Last selected candidate.
(defvar ac-selected-candidate nil (#$ . 8341))
#@92 Common part string of meaningful candidates.
If there is no common part, this will be nil.
(defvar ac-common-part nil (#$ . 8419))
#@87 Common part string of whole candidates.
If there is no common part, this will be nil.
(defvar ac-whole-common-part nil (#$ . 8556))
#@28 Overlay for prefix string.
(defvar ac-prefix-overlay nil (#$ . 8694))
#@24 Completion idle timer.
(defvar ac-timer nil (#$ . 8770))
#@23 Show menu idle timer.
(defvar ac-show-menu-timer nil (#$ . 8833))
#@24 Quick help idle timer.
(defvar ac-quick-help-timer nil (#$ . 8905))
#@17 Flag to update.
(defvar ac-triggered nil (#$ . 8979))
#@46 Limit number of candidates for each sources.
(defvar ac-limit nil (#$ . 9039))
#@21 Current candidates.
(defvar ac-candidates nil (#$ . 9124))
#@42 Candidates cache for individual sources.
(defvar ac-candidates-cache nil (#$ . 9189))
#@42 Non-nil means fuzzy matching is enabled.
(defvar ac-fuzzy-enable nil (#$ . 9281))
#@48 Non-nil means DWIM completion will be allowed.
(defvar ac-dwim-enable nil (#$ . 9369))
#@93 Auto-complete mode map. It is also used for trigger key command. See also `ac-trigger-key'.
(defvar ac-mode-map (make-sparse-keymap) (#$ . 9462))
#@24 Keymap for completion.
(defvar ac-completing-map (byte-code "\304 \305\306\307#\210\305\310\311#\210\305\312\313#\210\305\314\315#\210\305\316\317#\210\305\320\321#\210\305\322\317#\210\305\323\321#\210\305\324\325#\210\305\326\327#\210\305\330\325#\210\305\331\327#\210\305\332\333#\210\305\334\335#\210\305\336\333#\210\305\337\335#\210\340\341 \nW\203\233 \342\343\344 T\"!\211\345\346\347\350\351\352\353\354 EE\355BBFM\210\305\356\343\357 T\"!#\210) T\211\202h *)\207" [map i #1=#:--cl-dotimes-temp-- symbol make-sparse-keymap define-key " " ac-expand "" ac-complete [134217737] auto-complete "" ac-isearch "\356" ac-next "\360" ac-previous [down] [up] [f1] ac-help [M-f1] ac-persist-help [67108927] [201326655] [C-down] ac-quick-help-scroll-down [C-up] ac-quick-help-scroll-up "\216" "\220" 9 0 intern format "ac-complete-%d" lambda nil (interactive) when and (ac-menu-live-p) popup-select ac-menu ((ac-complete)) read-kbd-macro "M-%s"] 11) (#$ . 9614))
(defvaralias 'ac-complete-mode-map 'ac-completing-map)
#@43 Keymap for completion on completing menu.
(defvar ac-menu-map (byte-code "\302 \303\304\305#\210\303\306\307#\210\310 \"\210)\207" [map ac-completing-map make-sparse-keymap define-key "" ac-next "" ac-previous set-keymap-parent] 4) (#$ . 10661))
(byte-code "\303B\304\303!\204 \305\303\306 \307 \n\"\210 )\"\210\303\207" [current-load-list map ac-completing-map ac-current-map default-boundp set-default make-sparse-keymap set-keymap-parent] 5)
#@25 Default match function.
(defvar ac-match-function 'all-completions (#$ . 11123))
#@36 Prefix definitions for common use.
(defvar ac-prefix-definitions '((symbol . ac-prefix-symbol) (file . ac-prefix-file) (valid-file . ac-prefix-valid-file) (c-dot . ac-prefix-c-dot) (c-dot-ref . ac-prefix-c-dot-ref)) (#$ . 11210))
#@25 Sources for completion.
(defvar ac-sources '(ac-source-words-in-same-mode-buffers) (#$ . 11446))
(make-variable-buffer-local 'ac-sources)
#@34 Compiled source of `ac-sources'.
(defvar ac-compiled-sources nil (#$ . 11590))
#@68 Current working sources. This is sublist of `ac-compiled-sources'.
(defvar ac-current-sources nil (#$ . 11675))
#@26 Do not use this anymore.
(defvar ac-omni-completion-sources nil (#$ . 11793))
(byte-code "\301B\302\301!\204 \303\301\304\"\210\305B\302\305!\204 \303\305\304\"\210\304\207" [current-load-list ac-current-prefix-def default-boundp set-default nil ac-ignoring-prefix-def] 3)
#@33 Database of completion history.
(defvar ac-comphist nil (#$ . 12078))
(defalias 'ac-comphist-make-tab #[nil "\300\301\302\"\207" [make-hash-table :test equal] 3])
(put 'ac-comphist-make-tab 'byte-optimizer 'byte-compile-inline-expand)
(defalias 'ac-comphist-tab #[(db) "@\207" [db] 1])
(put 'ac-comphist-tab 'byte-optimizer 'byte-compile-inline-expand)
(defalias 'ac-comphist-cache #[(db) "A@\207" [db] 1])
(put 'ac-comphist-cache 'byte-optimizer 'byte-compile-inline-expand)
(defalias 'ac-comphist-make #[(&optional tab) "\206 \301\302\303\"\301\302\303\304\305$D\207" [tab make-hash-table :test equal :weakness t] 6])
(defalias 'ac-comphist-get #[(db string &optional create) "\211@)\305\n \"\f\203 \204 \306\nG\307\"\310\n #\210*\207" [db tab string index create gethash make-vector 0 puthash] 5])
(defalias 'ac-comphist-add #[(db string prefix) " GS^\304X\205( \305 !\306\n \307#\211HTI\210\310 \n\211A@)\")\207" [prefix string db stat 0 substring-no-properties ac-comphist-get t remhash] 5])
(defalias 'ac-comphist-score #[(db string prefix) " GS^\306X\203\241 \307 \n\211A@)\"\211\203 H\206\237 \310\n \"\311\211\203v \306 G\312\313\245\314\211W\203t \315Z!Z\316\317[_!T\245\fH_\\T\211\202C .\f\320\321 GZ\322\245Z]\\\204\230 \323 G\314\"\324 \n\211A@)#\210\fI\210\f*)\207\325\207" [prefix string db cache score stat 0 gethash ac-comphist-get 0.0 5 6.0 nil abs 1.0 exp 0.0 0.3 100.0 make-vector puthash 0.0 p #1=#:--cl-var-- a d x r] 6])
(defalias 'ac-comphist-sort #[(db collection prefix &optional threshold) "\306\307\211\211\310\311\312\310\313\f\"\314\"\"\203 \nB\202 ,\207" [cur total n result collection threshold nil 0 mapcar #[(a) "\203 \203 \n _Y\203 \305\202 T\fA\\\f@\207" [cur threshold total n a nil] 3] sort #[(string) "\305 \n#\f\\ )B\207" [db string prefix score total ac-comphist-score] 4] #[(a b) "A AW\207" [b a] 2]] 6])
(defalias 'ac-comphist-serialize #[(db) "\302\303\304 \211@)\"\210)C\207" [alist db nil maphash #[(k v) " B\nB\211\207" [k v alist] 2]] 4])
(defalias 'ac-comphist-deserialize #[(sexp) "\300\301\302\217\207" [nil (byte-code "\302\303\304\305\"\306\307 @\"\210)!\207" [tab sexp ac-comphist-make make-hash-table :test equal mapc #[(cons) "\302@A #\207" [cons tab puthash] 4]] 4) ((error (message "Invalid comphist db.") nil))] 3])
(defalias 'ac-comphist-init #[nil "\300 \210\301\302\303\"\207" [ac-comphist-load add-hook kill-emacs-hook ac-comphist-save] 3])
(defalias 'ac-comphist-load #[nil "\303!\205\n \304\305\306\217\211\206 \307 \211)\207" [ac-comphist-file db ac-comphist file-exists-p nil (byte-code "\302\303!rq\210\304\216\305 !\210eb\210\306\307p!!+\207" [#1=#:temp-buffer ac-comphist-file generate-new-buffer " *temp*" ((byte-code "\301!\203\n \302!\210\301\207" [#1# buffer-name kill-buffer] 2)) insert-file-contents ac-comphist-deserialize read] 3) ((error)) ac-comphist-make] 4 nil nil])
(defalias 'ac-comphist-save #[nil "\300\301!\210\302\303\304\217\207" [require pp nil (byte-code "\303\304!rq\210\305\216\306\307 !p\"\210\310ed\n#+\207" [#1=#:temp-buffer ac-comphist ac-comphist-file generate-new-buffer " *temp*" ((byte-code "\301!\203\n \302!\210\301\207" [#1# buffer-name kill-buffer] 2)) pp ac-comphist-serialize write-region] 4) ((error))] 3 nil nil])
#@73 Return non-nil if current line is long and wrapped to next visual line.
(defalias 'ac-menu-at-wrapper-line-p #[nil "?\205 \301 \212\302\303!\210\301 )=\207" [truncate-lines line-beginning-position vertical-motion 1] 3 (#$ . 15439)])
#@37 Default prefix definition function.
(defalias 'ac-prefix-symbol #[nil "\300\301!\210\302\303!\242\207" [require thingatpt bounds-of-thing-at-point symbol] 2 (#$ . 15680)])
(defalias 'ac-prefix-default 'ac-prefix-symbol)
#@14 File prefix.
(defalias 'ac-prefix-file #[nil "\301\302\303\304#\211\205\f T)\207" [point re-search-backward "[\"<>' \n]" nil t] 5 (#$ . 15906)])
#@41 Existed (or to be existed) file prefix.
(defalias 'ac-prefix-valid-file #[nil "\305 `\306\307\310#\211\205 \nT)\206 \211 {\211\205= \311\312\f\"\204<