-;;; company-clang.el --- a company-mode completion back-end for clang
+;;; company-clang.el --- A company-mode completion back-end for clang
-;; Copyright (C) 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2009, 2011 Free Software Foundation, Inc.
;; Author: Nikolaj Schumacher
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+
;;; Code:
(require 'company)
(defcustom company-clang-executable
(executable-find "clang")
- "*Location of clang executable"
+ "*Location of clang executable."
:group 'company-clang
:type 'file)
`company-clang-auto-save' determines whether to do this automatically."
(interactive (list 'interactive))
(case command
- ('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 (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)))))
(provide 'company-clang)
;;; company-clang.el ends here