- ('interactive (company-begin-backend 'company-clang))
- ('init (unless company-clang-executable
- (error "Company found no clang executable"))
- (when (version< (company-clang-version)
- company-clang-required-version)
- (error "Company requires clang version 1.1")))
- ('prefix (and (memq major-mode company-clang-modes)
- buffer-file-name
- company-clang-executable
- (not (company-in-string-or-comment))
- (or (company-grab-symbol) 'stop)))
- ('candidates (company-clang--candidates arg))
- ('post-completion (and (derived-mode-p 'objc-mode)
- (string-match ":" arg)
- (company-clang-objc-templatify arg)))))
+ (interactive (company-begin-backend 'company-clang))
+ (init (when (memq major-mode company-clang-modes)
+ (unless company-clang-executable
+ (error "Company found no clang executable"))
+ (setq company-clang--version (company-clang-version))
+ (when (< company-clang--version company-clang-required-version)
+ (error "Company requires clang version 1.1"))))
+ (prefix (and (memq major-mode company-clang-modes)
+ buffer-file-name
+ company-clang-executable
+ (not (company-in-string-or-comment))
+ (company-clang--prefix)))
+ (candidates (company-clang--candidates arg))
+ (meta (gethash arg company-clang--meta-cache))
+ (crop (and (string-match ":\\|(" arg)
+ (substring arg 0 (match-beginning 0))))
+ (post-completion (cond
+ ((not (derived-mode-p 'objc-mode))
+ (company-template-c-like-templatify arg))
+ ((string-match ":" arg)
+ (company-clang-objc-templatify arg))))))