;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\303\304\305\306\307\301%\210\310\311\312\313\314\315%\207" [require company cl-lib custom-declare-group company-cmake nil "Completion backend for CMake." :group custom-declare-variable company-cmake-executable (executable-find "cmake") "Location of cmake executable." :type file] 6) #@114 The arguments we pass to cmake, separately. They affect which types of symbols we get completion candidates for. (defvar company-cmake-executable-arguments '("--help-command-list" "--help-module-list" "--help-variable-list") (#$ . 410)) #@33 Regexp to match the candidates. (defvar company-cmake--completion-pattern "^\\(%s[a-zA-Z0-9_<>]%s\\)$" (#$ . 653)) #@42 Major modes in which cmake may complete. (defvar company-cmake-modes '(cmake-mode) (#$ . 774)) #@31 Cache for the raw candidates. (defvar company-cmake--candidates-cache nil (#$ . 875)) #@74 Cache for command arguments to retrieve descriptions for the candidates. (defvar company-cmake--meta-command-cache nil (#$ . 967)) (defalias 'company-cmake--replace-tags #[(rlt) "\301\302\303\304$\301\305\306\307\310\311##\211\207" [rlt replace-regexp-in-string "\\(.*?\\(IS_GNU\\)?\\)\\(.*\\)" #[(_match) "\300\301\302\224\203 \303\202\f\304\305#\207" [mapconcat identity 2 ("\\1CXX\\3" "\\1C\\3" "\\1G77\\3") ("\\1CXX\\3" "\\1C\\3" "\\1Fortran\\3") "\n"] 4] t "\\(.*\\)\\(.*\\)" mapconcat identity ("\\1DEBUG\\2" "\\1RELEASE\\2" "\\1RELWITHDEBINFO\\2" "\\1MINSIZEREL\\2") "\n"] 7]) #@34 Fill candidates cache if needed. (defalias 'company-cmake--fill-candidates-cache #[(arg) "\306 \204 \307\310\311\"\312\n \"?\205?\313\314\315\"r q\210\316\216\317\f\306\315\306\n%\211\320U\2041\321\322 \"\210)\323 +\324!\325\n #)\207" [rlt company-cmake--candidates-cache arg #1=#:temp-buffer company-cmake-executable res nil make-hash-table :test equal gethash generate-new-buffer " *temp*" t #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] call-process 0 message "cmake executable exited with error=%d" buffer-string company-cmake--replace-tags puthash] 7 (#$ . 1577)]) (defalias 'company-cmake--parse #[(prefix content cmd) "\306\307\310 ! G\306U\203\311\202\312#\313\n\314\"\315\211 \315\211\203X@\316\"\203O\317\320\"\211\203N\321\f#\210\f B)A\211\204** -\207" [company-cmake--completion-pattern prefix content rlt match lines 0 format regexp-quote "+" "*" split-string "\n" nil string-match match-string 1 puthash pattern start line --dolist-tail-- cmd company-cmake--meta-command-cache] 7]) (defalias 'company-cmake--candidates #[(prefix) "\306\211\211 \204\307\310\311\"\f\306\211\203B@\312 !\210\313\314\315 #\316 \"\211\2039\n\317 #\244A\211\204*\n+\207" [str cmd-opts results company-cmake--meta-command-cache company-cmake-executable-arguments arg nil make-hash-table :test equal company-cmake--fill-candidates-cache replace-regexp-in-string "-list$" "" gethash company-cmake--parse --dolist-tail-- company-cmake--candidates-cache prefix] 6]) (defalias 'company-cmake--unexpand-candidate #[(candidate) "\301\302\"\203\303\304\305\"P\202E\301\306\"\203\"\304\307\"\310P\202E\301\311\"\2033\304\307\"\312P\202E\301\313\"\203E\304\307\"\314\304\315\"Q\207" [candidate string-match "^CMAKE_\\(C\\|CXX\\|Fortran\\)\\(_.*\\)$" "CMAKE_" match-string 2 "^\\(.*_\\)IS_GNU\\(C\\|CXX\\|G77\\)$" 1 "IS_GNU" "^\\(.*_\\)OVERRIDE_\\(C\\|CXX\\|Fortran\\)$" "OVERRIDE_" "^\\(.*\\)\\(_DEBUG\\|_RELEASE\\|_RELWITHDEBINFO\\|_MINSIZEREL\\)\\(.*\\)$" "_" 3] 5]) (defalias 'company-cmake--meta #[(candidate) "\306 \"\307\310!\311\312\313\"r\fq\210\314\216\315 \307\313\307 &\210eb\210\316y\210\317\320 \321 \"\322\323\324\n#\211-\207" [candidate company-cmake--meta-command-cache result cmd-opts #1=#:temp-buffer company-cmake-executable gethash nil company-cmake--unexpand-candidate generate-new-buffer " *temp*" t #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] call-process 2 buffer-substring-no-properties line-beginning-position line-end-position replace-regexp-in-string "^[ \n ]+" ""] 8]) (defalias 'company-cmake--doc-buffer #[(candidate) "\305 \"\306!\307\310\311\"r q\210\312\216\313\f\314\311\314\n&\210eb\210\315y\210\316\317\320 d\"!,\207" [candidate company-cmake--meta-command-cache cmd-opts #1=#:temp-buffer company-cmake-executable gethash company-cmake--unexpand-candidate generate-new-buffer " *temp*" t #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] call-process nil 2 company-doc-buffer buffer-substring-no-properties line-beginning-position] 7]) #@40 Test if the current symbol follows ${. (defalias 'company-cmake-prefix-dollar-brace-p #[nil "\212\300\301!\210`\206\n`Sf\302=\205`S\206`Sf\303=)\207" [skip-syntax-backward "w_" 123 36] 2 (#$ . 4734)]) #@98 `company-mode' completion backend for CMake. CMake is a cross-platform, open-source make system. (defalias 'company-cmake #[(command &optional arg &rest ignored) "\305\267\2028\306\307!\207 \n>\2059 ?\205\310\311!\207 \n>\2059\312 \203)\313 \2059\314 \207\315\f!\207\316\f!\207\317\f!\207\320\207" [command major-mode company-cmake-modes company-cmake-executable arg #s(hash-table size 6 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (interactive 6 init 10 prefix 25 candidates 44 meta 48 doc-buffer 52)) company-begin-backend company-cmake error "Company found no cmake executable" company-in-string-or-comment company-cmake-prefix-dollar-brace-p company-grab-symbol company-cmake--candidates company-cmake--meta company-cmake--doc-buffer nil] 2 (#$ . 4946) (list 'interactive)]) (provide 'company-cmake)