;; Copyright (C) 2009 Nikolaj Schumacher
;;
;; Author: Nikolaj Schumacher <bugs * nschum de>
-;; Version: 0.4
+;; Version: 0.4.1
;; Keywords: abbrev, convenience, matchis
;; URL: http://nschum.de/src/emacs/company/
;; Compatibility: GNU Emacs 22.x, GNU Emacs 23.x
;;
;;; Change Log:
;;
+;; Windows compatibility fixes.
+;;
+;; 2009-04-19 (0.4.1)
;; Added `global-company-mode'.
;; Performance enhancements.
;; Added `company-eclim' back-end.
keymap)
"Keymap that is enabled during an active completion.")
+(defvar company--disabled-backends nil)
+
(defun company-init-backend (backend)
(and (symbolp backend)
(not (fboundp backend))
(if (ignore-errors (funcall backend 'init) t)
(put backend 'company-init t)
(put backend 'company-init 'failed)
- (message "Company back-end '%s' could not be initialized"
- backend)
+ (unless (memq backend company--disabled-backends)
+ (message "Company back-end '%s' could not be initialized"
+ backend)
+ (push backend company--disabled-backends))
nil)
(mapc 'company-init-backend backend)))
(car (setq ppss (cdr ppss)))
(nth 3 ppss))))
+(if (fboundp 'locate-dominating-file)
+ (defalias 'company-locate-dominating-file 'locate-dominating-file)
+ (defun company-locate-dominating-file (file name)
+ (catch 'root
+ (let ((dir (file-name-directory file))
+ (prev-dir nil))
+ (while (not (equal dir prev-dir))
+ (when (file-exists-p (expand-file-name name dir))
+ (throw 'root dir))
+ (setq prev-dir dir
+ dir (file-name-directory (directory-file-name dir))))))))
+
(defun company-call-backend (&rest args)
(if (functionp company-backend)
(apply company-backend args)