]>
Commit | Line | Data |
---|---|---|
1 | ;ELC\1c\0\0\0 | |
2 | ;;; Compiled | |
3 | ;;; in Emacs version 28.2 | |
4 | ;;; with all optimizations. | |
5 | ||
6 | ||
7 | ||
8 | (byte-code "\300\301!\210\300\302!\210\300\303!\210\304\305\306\307\310\301%\210\311\312\313\314\315DD\316\317\320%\210\311\321\313\314\322DD\323\317\324%\210\311\325\313\314\326DD\327\317\324\330\331&\a\210\311\332\313\314\333DD\334\317\335%\210\311\336\313\314\337DD\340\317\341%\207" [require company company-template cl-lib custom-declare-group company-clang nil "Completion backend for Clang." :group custom-declare-variable company-clang-executable funcall function #[0 "\300\301!\207" [executable-find "clang"] 2 #1=""] "Location of clang executable." :type file company-clang-begin-after-member-access #[0 "\300\207" [t] 1 #1#] "When non-nil, start automatic completion after member access operators.\n\nAutomatic completion starts whenever the current symbol is preceded by\n\".\", \"->\" or \"::\", ignoring `company-minimum-prefix-length'.\n\nIf `company-begin-commands' is a list, it should include `c-electric-lt-gt'\nand `c-electric-colon', for automatic completion right after \">\" and\n\":\"." boolean company-clang-use-compile-flags-txt #[0 "\300\207" [nil] 1 #1#] "When non-nil, use flags from compile_flags.txt if present.\n\nThe lines from that files will be appended to `company-clang-arguments'.\n\nAnd if such file is found, Clang is called from the directory containing\nit. That allows the flags use relative file names within the project." :safe booleanp company-clang-arguments #[0 "\300\207" [nil] 1 #1#] "A list of additional arguments to pass to clang when completing.\nPrefix files (-include ...) can be selected with `company-clang-set-prefix'\nor automatically through a custom `company-clang-prefix-guesser'." (repeat (string :tag "Argument")) company-clang-prefix-guesser #[0 "\300\207" [company-clang-guess-prefix] 1 #1#] "A function to determine the prefix file for the current buffer." (function :tag "Guesser function" nil)] 8) | |
9 | #@39 Major modes which clang may complete.\1f | |
10 | (defvar company-clang-modes '(c-mode c++-mode objc-mode) (#$ . 1952)) | |
11 | (byte-code "\300\301\302\303\304DD\305\306\307\310\311&\a\207" [custom-declare-variable company-clang-insert-arguments funcall function #[0 "\300\207" [t] 1 ""] "When non-nil, insert function arguments as a template after completion." :type boolean :package-version (company . "0.8.0")] 8) | |
12 | (defvar company-clang--prefix nil) | |
13 | #@13 | |
14 | ||
15 | (fn FILE)\1f | |
16 | (defalias 'company-clang--guess-pch-file #[257 "\300\301\ 2!!\302\ 1!\303\232\203\12\0\301\ 1!\262\ 1\304\ 1\305\306\305$@\207" [directory-file-name file-name-directory file-name-nondirectory "Classes" directory-files t "\\([^.]h\\|[^h]\\).pch\\'"] 7 (#$ . 2390)]) | |
17 | (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put company-clang--guess-pch-file speed -1 put byte-optimizer byte-compile-inline-expand] 5) | |
18 | #@21 | |
19 | ||
20 | (fn FILE BEG END)\1f | |
21 | (defalias 'company-clang--file-substring #[771 "\300\301\302\"r\211q\210\303\304\ 2\"\216\305\ 4\306\ 5\ 5$\210\307 *\207" [generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \0\302\300!\207" [V0 buffer-name kill-buffer] 2] insert-file-contents-literally nil buffer-string] 9 (#$ . 2815)]) | |
22 | (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put company-clang--file-substring speed -1 put byte-optimizer byte-compile-inline-expand] 5) | |
23 | #@54 Try to guess the prefix file for the current buffer.\1f | |
24 | (defalias 'company-clang-guess-prefix #[0 "\b\301\302\ 2!!\303\ 1!\304\232\203\13\0\302\ 1!\262\ 1\305\ 1\306\307\306$@\266\202\211\205<\0\211\310\311\312\313\306\"r\211q\210\314\315\ 2\"\216\316\ 4\317\ 5\ 5$\210\320 *\266\204\211\321\235?\205D\0\ 1\207" [buffer-file-name directory-file-name file-name-directory file-name-nondirectory "Classes" directory-files t "\\([^.]h\\|[^h]\\).pch\\'" 0 4 generate-new-buffer " *temp*" make-closure #[0 "\301\300!\205 \0\302\300!\207" [V0 buffer-name kill-buffer] 2] insert-file-contents-literally nil buffer-string ("CPCH" "gpch")] 10 (#$ . 3290)]) | |
25 | #@89 Use PREFIX as a prefix (-include ...) file for clang completion. | |
26 | ||
27 | (fn &optional PREFIX)\1f | |
28 | (defalias 'company-clang-set-prefix #[256 "\211;\205\f\0\301\ 1!\205\f\0\211\211\10\207" [company-clang--prefix file-regular-p] 3 (#$ . 3913) (byte-code "\b \211;\204\n\0 \262\ 1\302\303\ 2\205\13\0\304\ 3!\ 3\305\ 5\205\1d\0\306\ 6\ 6!%C\207" [company-clang-prefix-guesser default-directory read-file-name "Prefix file: " file-name-directory t file-name-nondirectory] 8)]) | |
29 | (add-hook 'kill-emacs-hook 'company-clang-set-prefix) | |
30 | (defconst company-clang--completion-pattern "^COMPLETION: \\_<\\(%s[a-zA-Z0-9_:]*\\|Pattern\\)\\(?:\\(?: (InBase)\\)? : \\(.*\\)$\\)?$") | |
31 | (defconst company-clang--error-buffer-name "*clang-error*") | |
32 | (defalias 'company-clang--lang-option #[0 "\b\302=\203\12\0\303 !\304\230\203\10\0\305\207\306\207\307\b!\310\311O\207" [major-mode buffer-file-name objc-mode file-name-extension "m" "objective-c" "objective-c++" symbol-name 0 -5] 3]) | |
33 | #@20 | |
34 | ||
35 | (fn PREFIX OBJC)\1f | |
36 | (defalias 'company-clang--parse-output #[514 "eb\210\302\b\303\ 4!\"\304\305\306\307\310d\311\245$\304C\ 2\19\312\ 4\304\313#\203d\0\314\315!\314\316!\ 1\317\232\203/\0\320\ 1!\262\ 2\321\322\ 3\"\203=\0\ 1\323\211\224O\262\ 2\ 1\ 1\232\204N\0\324\ 2\ 2\ 6\ 6#\266\ 3\202\16\0\325\ 2\ 5\326#\326=\203_\0\324\ 2\304\ 6\ 6#\210\266\ 2\202\16\0\327\330\331\ 3\"\ 3\"\210\211\242)\207" [company-clang--completion-pattern case-fold-search format regexp-quote nil make-hash-table :test equal :size 100 re-search-forward t match-string-no-properties 1 2 "Pattern" company-clang--pattern-to-match string-match ":" 0 puthash gethash none maphash make-closure #[514 "\211\203\ f\0\301\302\303\304\305\ 5!\ 6\ 6%\210\300\ 2\300\242B\240\207" [V0 put-text-property 0 1 meta company-clang--strip-formatting] 8 "\n\n(fn MATCH META)"]] 12 (#$ . 4831)]) | |
37 | #@12 | |
38 | ||
39 | (fn PAT)\1f | |
40 | (defalias 'company-clang--pattern-to-match #[257 "\300\301\302\303\ 4\"\203\r\0\300\225\262\ 2\302\304\ 4\ 4#\203\19\0\300\224\262\ 1\ 2\ 2\ 2O\207" [0 nil string-match "#]" "[ (]<#"] 7 (#$ . 5621)]) | |
41 | #@18 | |
42 | ||
43 | (fn CANDIDATE)\1f | |
44 | (defalias 'company-clang--meta #[257 "\300\301\302\ 3#\207" [get-text-property 0 meta] 5 (#$ . 5817)]) | |
45 | #@18 | |
46 | ||
47 | (fn CANDIDATE)\1f | |
48 | (defalias 'company-clang--annotation #[257 "\300\ 1!\211\203\ e\0\301\302\ 2\"\204\ f\0\207\303\304\305\"r\211q\210\306\307\ 2\"\216\ 1c\210\310\311!\210`T\312\313\314\305#\210\211`|\266\ 2\315 *\207" [company-clang--annotation-1 string-prefix-p "(*)" generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \0\302\300!\207" [V0 buffer-name kill-buffer] 2] search-backward ")" re-search-forward ".\\_>" nil buffer-string] 8 (#$ . 5941)]) | |
49 | #@18 | |
50 | ||
51 | (fn CANDIDATE)\1f | |
52 | (defalias 'company-clang--annotation-1 #[257 "\300\ 1!\211\204 \0\301\207\302\303\ 2\"\203\17\0\211\304\224T\301O\207\302\305\ 2\"\203 \0\301\207\302\306\ 2\"\205X\0\307\224\ 1\ 1SH\310=\2049\0\311\307\ 3\"\202V\0\312\313\314\"r\211q\210\315\316\ 2\"\216\ 2c\210\ 1b\210\ 2\317\320!S\301O*\262\ 1\262\ 1\207" [company-clang--meta nil string-match "[^:]:[^:]" 0 "(anonymous)" "\\((.*)[ a-z]*\\'\\)" 1 62 match-string generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \0\302\300!\207" [V0 buffer-name kill-buffer] 2] search-backward "<"] 7 (#$ . 6393)]) | |
53 | #@13 | |
54 | ||
55 | (fn TEXT)\1f | |
56 | (defalias 'company-clang--strip-formatting #[257 "\300\301\302\300\303\304\ 6\ 6\305$\305$\207" [replace-regexp-in-string "#]" " " "[<{[]#\\|#[>}]" "" t] 9 (#$ . 6947)]) | |
57 | #@17 | |
58 | ||
59 | (fn RES ARGS)\1f | |
60 | (defalias 'company-clang--handle-error #[514 "eb\210\306\b! \307\310\311\ 5\307#Q\312\n\313\"\314\e\315\ 1\316\314#\203,\0\317\224eV\203,\0\320e\317\224S\"\2025\0\321\322\ 6\ 6\ 4#\210\323 r\ 3q\210\314\1c\324 \210\325 \312\326\ 6\b\"\ 4\327\261\ 4\210\211c\210\314\15eb+\207" [company-clang--error-buffer-name company-clang-executable company-clang--completion-pattern message-truncate-lines inhibit-read-only buffer-read-only get-buffer-create " " mapconcat identity format "" t re-search-forward nil 0 buffer-substring-no-properties message "clang failed with error %d: %s" buffer-string erase-buffer current-time-string "\nclang failed with error %d:\n" "\n\n"] 10 (#$ . 7131)]) | |
61 | #@35 | |
62 | ||
63 | (fn PREFIX CALLBACK &rest ARGS)\1f | |
64 | (defalias 'company-clang--start-process #[642 "\304\305!\306\307!\310\18\311\ 1!\211\203\13\0\312\ 1!\210r\ 1q\210\313 \210\314\11)\310\1a\315\316\317\ 4\v\ 6\b%\320\ 1\321\322\ 6\n\ 6\n\ 6\n\ 6\n\ 6\n&\ 6\"\210\323 ?\205M\0\324\ 1ed#\210\325\ 1\326\"\210\327\ 1!)\262\ 1)\207" [process-adaptive-read-buffering buffer-undo-list process-connection-type company-clang-executable derived-mode-p objc-mode get-buffer-create "*clang-output*" nil get-buffer-process kill-process erase-buffer t apply start-file-process "company-clang" set-process-sentinel make-closure #[514 "\306\ 1\307\310\1d\311\ 3\ 3\ 3#)\266\203?\205,\0\301\312\ 3!r\304q\210\211\313=\204$\0\314\ 1\302\"\210\315\300\303\")\262\ 1!\207" [V0 V1 V2 V3 V4 inhibit-changing-match-data "hangup\\|killed" nil t string-match process-exit-status 0 company-clang--handle-error company-clang--parse-output] 9 "\n\n(fn PROC STATUS)"] company-clang--auto-save-p send-region send-string "\n" process-send-eof] 16 (#$ . 7808)]) | |
65 | #@12 | |
66 | ||
67 | (fn POS)\1f | |
68 | (defalias 'company-clang--build-location #[257 "\212\211b\210\301\302\303 \203\ f\0\b\202\10\0\304\305 \306\307 `\310\311$GT$)\207" [buffer-file-name format "%s:%d:%d" company-clang--auto-save-p "-" line-number-at-pos encode-coding-region line-beginning-position utf-8 t] 10 (#$ . 8766)]) | |
69 | (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put company-clang--build-location speed -1 put byte-optimizer byte-compile-inline-expand] 5) | |
70 | #@12 | |
71 | ||
72 | (fn POS)\1f | |
73 | (defalias 'company-clang--build-complete-args #[257 "\302\303\304 ?\205\f\0\305\306 D\307 \b;\205\18\0\310\311\b!D\312\313\314\ 6\b\212\211b\210\313\315\304 \203,\0 \202-\0\316\317 \320\321 `\322\323$GT$)\262\ 1\"D\304 \203G\0 \202H\0\316C&\ 6\207" [company-clang--prefix buffer-file-name append ("-fsyntax-only" "-Xclang" "-code-completion-macros") company-clang--auto-save-p "-x" company-clang--lang-option company-clang--arguments "-include" expand-file-name "-Xclang" format "-code-completion-at=%s" "%s:%d:%d" "-" line-number-at-pos encode-coding-region line-beginning-position utf-8 t] 19 (#$ . 9220)]) | |
74 | (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put company-clang--build-complete-args speed -1 put byte-optimizer byte-compile-inline-expand] 5) | |
75 | (defalias 'company-clang--arguments #[0 "\b\303 \203F\0\304\n\305\"\211\203E\0\306\n\ 2\"\262\ 2\211\12\307\310\311\"r\211q\210\312\313\ 2\"\216\314\305!\210\315\ 4\316\317ed\"\320\311\321$\"\262\ 4*\210\ 1\322\232\204E\0\323\324\ 3\"\ 3B\262\ 3\210\ 1\207" [company-clang-arguments company-clang-use-compile-flags-txt default-directory nil locate-dominating-file "compile_flags.txt" file-relative-name generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \0\302\300!\207" [V0 buffer-name kill-buffer] 2] insert-file-contents append split-string buffer-substring-no-properties "[\n\r]+" "[ ]+" "./" format "-I%s"] 11]) | |
76 | #@24 | |
77 | ||
78 | (fn PREFIX CALLBACK)\1f | |
79 | (defalias 'company-clang--candidates #[514 "\304 \203\r\0\305 \203\r\0\306 \210\b\204\1a\0\307 \206\18\0\310!\210\n\1a\311\312\ 3\ 3\313\314\315\"\203+\0`\2020\0`\ 6\ 6GZ\316\317\304 ?\205<\0\320\321 D\322 \b;\205H\0\323\324\b!D\325\326\327\ 6\b\212\211b\210\326\330\304 \203\\\0\v\202]\0\331\332 \333\334 `\335\336$GT$)\262\ 1\"D\304 \203w\0\v\202x\0\331C&\ 6\262\ 1$)\207" [company-clang--prefix company-clang-prefix-guesser default-directory buffer-file-name company-clang--auto-save-p buffer-modified-p basic-save-buffer company-clang-set-prefix none apply company-clang--start-process company-clang--check-version 4.0 9.0 append ("-fsyntax-only" "-Xclang" "-code-completion-macros") "-x" company-clang--lang-option company-clang--arguments "-include" expand-file-name "-Xclang" format "-code-completion-at=%s" "%s:%d:%d" "-" line-number-at-pos encode-coding-region line-beginning-position utf-8 t] 25 (#$ . 10592)]) | |
80 | (defalias 'company-clang--prefix #[0 "\b\203 \0\301\302\303\"\207\304 \207" [company-clang-begin-after-member-access company-grab-symbol-cons "\\.\\|->\\|::" 2 company-grab-symbol] 3]) | |
81 | (defconst company-clang-required-version 1.1) | |
82 | (defvar company-clang--version nil) | |
83 | (defalias 'company-clang--auto-save-p #[0 "\300\301\302\"?\207" [company-clang--check-version 2.9 3.1] 3]) | |
84 | #@22 | |
85 | ||
86 | (fn MIN APPLE-MIN)\1f | |
87 | (defalias 'company-clang--check-version #[514 "\b:\203\1f\0\b\242\211\301\267\202\19\0\b\243\211\ 3Y\207\b\243\211\ 4Y\207\b\302\303\ 2\"\207\b\302\303\ 2\"\207" [company-clang--version #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (apple 13 normal 19)) error "No clause matching `%S'"] 7 (#$ . 11873)]) | |
88 | #@51 Return the version of `company-clang-executable'.\1f | |
89 | (defalias 'company-clang-version #[0 "\301\302\303\"r\211q\210\304\305\ 2\"\216\306\b\307\303\307\310%\210eb\210\311\312\307\303#\2036\0\313\314!\315\232\203,\0\316\202-\0\317\320\313\321!!B\2027\0\322*\207" [company-clang-executable generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \0\302\300!\207" [V0 buffer-name kill-buffer] 2] call-process nil "--version" re-search-forward "\\(clang\\|Apple LLVM\\|bcc32x\\|bcc64\\) version \\([0-9.]+\\)" match-string-no-properties 1 "Apple LLVM" apple normal string-to-number 2 0] 7 (#$ . 12223)]) | |
90 | (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put company-clang-version speed -1 put byte-optimizer byte-compile-inline-expand] 5) | |
91 | #@552 `company-mode' completion backend for Clang. | |
92 | Clang is a parser for C and ObjC. Clang version 1.1 or newer is required. | |
93 | ||
94 | Additional command line arguments can be specified in | |
95 | `company-clang-arguments'. Prefix files (-include ...) can be selected | |
96 | with `company-clang-set-prefix' or automatically through a custom | |
97 | `company-clang-prefix-guesser'. | |
98 | ||
99 | With Clang versions before 2.9, we have to save the buffer before | |
100 | performing completion. With Clang 2.9 and later, buffer contents are | |
101 | passed via standard input. | |
102 | ||
103 | (fn COMMAND &optional ARG &rest IGNORED)\1f | |
104 | (defalias 'company-clang #[641 "\ 2\306\267\202\256\0\307\310!\207\b >\205\257\0\n\204\18\0\311\312!\210\313\314\315\"r\211q\210\316\317\ 2\"\216\320\n\321\315\321\322%\210eb\210\323\324\321\315#\203N\0\325\326!\327\232\203D\0\330\202E\0\331\332\325\333!!B\202O\0\334*\262\ 1\13\335\f\211\"?\205_\0\311\336\f\"\207\b >\205\257\0\r\205\257\0\n\205\257\0\337 ?\205\257\0\340 \206z\0\341\207\342\316\343\ 4\"B\207\344\ 2!\207\345\ 2!\207\346\ 2!\207\346\ 2!\ e+\205\255\0\211\205\255\0\211c\210\347\350\ 2\"\203\250\0\351\ 1!\207\352\ 3\ 2P!\207\321\207" [major-mode company-clang-modes company-clang-executable company-clang--version company-clang-required-version buffer-file-name #s(hash-table size 8 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (interactive 6 init 10 prefix 96 candidates 123 meta 130 kind 134 annotation 138 post-completion 142)) company-begin-backend company-clang error "Company found no clang executable" generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \0\302\300!\207" [V0 buffer-name kill-buffer] 2] call-process nil "--version" re-search-forward "\\(clang\\|Apple LLVM\\|bcc32x\\|bcc64\\) version \\([0-9.]+\\)" match-string-no-properties 1 "Apple LLVM" apple normal string-to-number 2 0 company-clang--check-version "Company requires clang version %s" company-in-string-or-comment company-clang--prefix stop :async #[257 "\301\300\ 2\"\207" [V0 company-clang--candidates] 4 "\n\n(fn CB)"] company-clang--meta company-clang--kind company-clang--annotation string-match "\\`:[^:]" company-template-objc-templatify company-template-c-like-templatify company-clang-insert-arguments] 10 (#$ . 12973) (byte-code "\300C\207" [interactive] 1)]) | |
105 | #@12 | |
106 | ||
107 | (fn ARG)\1f | |
108 | (defalias 'company-clang--kind #[257 "\301\ 1!\211\204 \0\302\207\303\304\ 2\"\203-\0\305\306\307\ 4!\"\ 1\310\211\224O\311\312\18\303\ 3\ 3\ 3#)\266\203\203+\0\302\207\313\207\314\207" [inhibit-changing-match-data company-clang--meta keyword string-match "(" format "\\`%s *\\'" regexp-quote 0 nil t function variable] 9 (#$ . 15176)]) | |
109 | (provide 'company-clang) |