;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (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&\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] "Location of clang executable." :type file company-clang-begin-after-member-access #[0 "\300\207" [t] 1] "When non-nil, automatic completion will start whenever the current\nsymbol is preceded by \".\", \"->\" or \"::\", ignoring\n`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] "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] "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] "A function to determine the prefix file for the current buffer." (function :tag "Guesser function" nil)] 8) #@39 Major modes which clang may complete. (defvar company-clang-modes '(c-mode c++-mode objc-mode) (#$ . 1867)) (byte-code "\300\301\302\303\304DD\305\306\307\310\311&\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) (defvar company-clang--prefix nil) #@13 (fn FILE) (defalias 'company-clang--guess-pch-file #[257 "\300\301!!\302!\303\232\203\301!\262\304\305\306\305$@\207" [directory-file-name file-name-directory file-name-nondirectory "Classes" directory-files t "\\([^.]h\\|[^h]\\).pch\\'"] 7 (#$ . 2302)]) (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) #@21 (fn FILE BEG END) (defalias 'company-clang--file-substring #[771 "\300\301\302\"r\211q\210\303\304\"\216\305\306$\210\307 *\207" [generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] insert-file-contents-literally nil buffer-string] 9 (#$ . 2727)]) (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) #@54 Try to guess the prefix file for the current buffer. (defalias 'company-clang-guess-prefix #[0 "\301\302!!\303!\304\232\203\302!\262\305\306\307\306$@\266\202\211\205<\211\310\311\312\313\306\"r\211q\210\314\315\"\216\316\317$\210\320 *\266\204\211\321\235?\205D\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 \302\300!\207" [V0 buffer-name kill-buffer] 2] insert-file-contents-literally nil buffer-string ("CPCH" "gpch")] 10 (#$ . 3202)]) #@89 Use PREFIX as a prefix (-include ...) file for clang completion. (fn &optional PREFIX) (defalias 'company-clang-set-prefix #[256 "\211;\205\f\301!\205\f\211\211\207" [company-clang--prefix file-regular-p] 3 (#$ . 3825) (byte-code " \211;\204\n \262\302\303\205\304!\305\205\306!%C\207" [company-clang-prefix-guesser default-directory read-file-name "Prefix file: " file-name-directory t file-name-nondirectory] 8)]) (add-hook 'kill-emacs-hook 'company-clang-set-prefix) (defconst company-clang--completion-pattern "^COMPLETION: \\_<\\(%s[a-zA-Z0-9_:]*\\)\\(?:\\(?: (InBase)\\)? : \\(.*\\)$\\)?$") (defconst company-clang--error-buffer-name "*clang-error*") (defalias 'company-clang--lang-option #[0 "\302=\203\303 !\304\230\203\305\207\306\207\307!\310\311O\207" [major-mode buffer-file-name objc-mode file-name-extension "m" "objective-c" "objective-c++" symbol-name 0 -5] 3]) #@20 (fn PREFIX OBJC) (defalias 'company-clang--parse-output #[514 "eb\210\302\303!\"\304\211\211\305\304\306#\203Y\307\310!\262\211\311\232\204\312 \313\314\"\216\315\316\"\2036\317\211\224O\262)\210\307\320!\211\203P\230\204P\321\317\310\322\323!%\210\210\211B\262\202)\207" [company-clang--completion-pattern case-fold-search format regexp-quote nil re-search-forward t match-string-no-properties 1 "Pattern" match-data make-closure #[0 "\301\300\302\"\207" [V0 set-match-data evaporate] 3] string-match ":" 0 2 put-text-property meta company-clang--strip-formatting] 13 (#$ . 4733)]) #@18 (fn CANDIDATE) (defalias 'company-clang--meta #[257 "\300\301\302#\207" [get-text-property 0 meta] 5 (#$ . 5350)]) #@18 (fn CANDIDATE) (defalias 'company-clang--annotation #[257 "\300!\211\203\301\302\"\204\207\303\304\305\"r\211q\210\306\307\"\216c\210\310\311!\210`T\312\313\314\305#\210\211`|\266\315 *\207" [company-clang--annotation-1 string-prefix-p "(*)" generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] search-backward ")" re-search-forward ".\\_>" nil buffer-string] 8 (#$ . 5474)]) #@18 (fn CANDIDATE) (defalias 'company-clang--annotation-1 #[257 "\300!\211\204 \301\207\302\303\"\203\211\304\224T\301O\207\302\305\"\203 \301\207\302\306\"\205X\307\224SH\310=\2049\311\307\"\202V\312\313\314\"r\211q\210\315\316\"\216c\210b\210\317\320!S\301O*\262\262\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 \302\300!\207" [V0 buffer-name kill-buffer] 2] search-backward "<"] 7 (#$ . 5926)]) #@13 (fn TEXT) (defalias 'company-clang--strip-formatting #[257 "\300\301\302\300\303\304\305$\305$\207" [replace-regexp-in-string "#]" " " "[<{[]#\\|#[>}]" "" t] 9 (#$ . 6480)]) #@17 (fn RES ARGS) (defalias 'company-clang--handle-error #[514 "eb\210\306! \307\310\311\307#Q\312\n\313\"\314\315\316\314#\203,\317\224eV\203,\320e\317\224S\"\2025\321\322#\210\323 rq\210\314\324 \210\325 \312\326\"\327\261\210\211c\210\314eb+\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 (#$ . 6664)]) #@35 (fn PREFIX CALLBACK &rest ARGS) (defalias 'company-clang--start-process #[642 "\304\305!\306\307!\310\311!\211\203\312!\210rq\210\313 \210\314)\310\315\316\317 %\320\321\322\n\n\n\n\n&\"\210\323 ?\205M\324ed#\210\325\326\"\210\327!)\262)\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\307\310\311#)\266\203?\205,\301\312!r\304q\210\211\313=\204$\314\302\"\210\315\300\303\")\262!\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 (#$ . 7341)]) #@12 (fn POS) (defalias 'company-clang--build-location #[257 "\212\211b\210\301\302\303 \203\202\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 (#$ . 8299)]) (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) #@12 (fn POS) (defalias 'company-clang--build-complete-args #[257 "\302\303\304 ?\205\f\305\306 D\307 ;\205\310\311!D\312\313\314\212\211b\210\313\315\304 \203, \202-\316\317 \320\321 `\322\323$GT$)\262\"D\304 \203G \202H\316C&\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 (#$ . 8753)]) (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) (defalias 'company-clang--arguments #[0 "\303 \203F\304\n\305\"\211\203E\306\n\"\262\211\307\310\311\"r\211q\210\312\313\"\216\314\305!\210\315\316\317ed\"\320\311\321$\"\262*\210\322\232\204E\323\324\"B\262\210\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 \302\300!\207" [V0 buffer-name kill-buffer] 2] insert-file-contents append split-string buffer-substring-no-properties "[\n ]+" "[ ]+" "./" format "-I%s"] 11]) #@24 (fn PREFIX CALLBACK) (defalias 'company-clang--candidates #[514 "\304 \203 \305 \203 \306 \210\204\307 \206\310!\210\n\311\312\313\314\315\"\203+`\2020`GZ\316\317\304 ?\205<\320\321 D\322 ;\205H\323\324!D\325\326\327\212\211b\210\326\330\304 \203\\ \202]\331\332 \333\334 `\335\336$GT$)\262\"D\304 \203w \202x\331C&\262$)\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 (#$ . 10125)]) (defalias 'company-clang--prefix #[0 "\203 \301\302\303\"\207\304 \207" [company-clang-begin-after-member-access company-grab-symbol-cons "\\.\\|->\\|::" 2 company-grab-symbol] 3]) (defconst company-clang-required-version 1.1) (defvar company-clang--version nil) (defalias 'company-clang--auto-save-p #[0 "\300\301\302\"?\207" [company-clang--check-version 2.9 3.1] 3]) #@22 (fn MIN APPLE-MIN) (defalias 'company-clang--check-version #[514 ":\203\242\211\301\267\202\243\211\211Y\207\243\211\211Y\207\302\303!\207\302\303!\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 20)) error "pcase-exhaustive is not in Emacs 24.3!"] 7 (#$ . 11406)]) #@51 Return the version of `company-clang-executable'. (defalias 'company-clang-version #[0 "\301\302\303\"r\211q\210\304\305\"\216\306\307\303\307\310%\210eb\210\311\312\307\303#\2036\313\314!\315\232\203,\316\202-\317\320\313\321!!B\2027\322*\207" [company-clang-executable generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \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 (#$ . 11773)]) (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) #@552 `company-mode' completion backend for Clang. Clang is a parser for C and ObjC. Clang version 1.1 or newer is required. Additional command line arguments can be specified in `company-clang-arguments'. Prefix files (-include ...) can be selected with `company-clang-set-prefix' or automatically through a custom `company-clang-prefix-guesser'. With Clang versions before 2.9, we have to save the buffer before performing completion. With Clang 2.9 and later, buffer contents are passed via standard input. (fn COMMAND &optional ARG &rest IGNORED) (defalias 'company-clang #[641 "\306\267\202\252\307\310!\207 >\205\253\n\204\311\312!\210\313\314\315\"r\211q\210\316\317\"\216\320\n\321\315\321\322%\210eb\210\323\324\321\315#\203N\325\326!\327\232\203D\330\202E\331\332\325\333!!B\202O\334*\262\335\f\211\"?\205_\311\336\f\"\207 >\205\253 \205\253\n\205\253\337 ?\205\253\340 \206z\341\207\342\316\343\"B\207\344!\207\345!\207\345!*\205\251\211\205\251\211c\210\346\347\"\203\244\350!\207\351P!\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 7 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (interactive 6 init 10 prefix 96 candidates 123 meta 130 annotation 134 post-completion 138)) company-begin-backend company-clang error "Company found no clang executable" generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \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\"\207" [V0 company-clang--candidates] 4 "\n\n(fn CB)"] company-clang--meta company-clang--annotation string-match "\\`:[^:]" company-template-objc-templatify company-template-c-like-templatify company-clang-insert-arguments] 10 (#$ . 12523) (byte-code "\300C\207" [interactive] 1)]) (provide 'company-clang)