]> code.delx.au - gnu-emacs-elpa/commitdiff
Always include company-capf in the backends
authorDmitry Gutov <dgutov@yandex.ru>
Sat, 19 Apr 2014 01:02:37 +0000 (05:02 +0400)
committerDmitry Gutov <dgutov@yandex.ru>
Sat, 19 Apr 2014 01:02:37 +0000 (05:02 +0400)
https://github.com/clojure-emacs/cider/issues/528#issuecomment-40800179
http://www.reddit.com/r/emacs/comments/22d7y6/autocomplete_or_companymode/cgma6qj
https://github.com/company-mode/company-mode/issues/95

NEWS.md
company-capf.el
company.el

diff --git a/NEWS.md b/NEWS.md
index 9037b010349e066c34b3f984259c5a7c33e68f35..bdb3de4b9d4513fed69f637077987a2a880070a9 100644 (file)
--- a/NEWS.md
+++ b/NEWS.md
@@ -2,6 +2,8 @@
 
 ## Next
 
+* `company-capf` is included in `company-backends` in any supported Emacs
+  version (>= 24.1). `company-elisp` goes before it if Emacs version is < 24.4.
 * New user option `company-clang-insert-arguments`, by default t.
 * Default value of `company-idle-delay` lowered to `0.5`.
 * New user option `company-tooltip-minimum-width`, by default 0.
index 04f8413edffbccfea75430785579585e57d4abfa..3aaeb137a8000550d61b5be4388651cb6a775235 100644 (file)
@@ -45,8 +45,7 @@
     (when (and (consp (cdr data)) (numberp (nth 1 data))) data)))
 
 (defun company-capf (command &optional arg &rest _args)
-  "`company-mode' back-end using `completion-at-point-functions'.
-Requires Emacs 24.1 or newer."
+  "`company-mode' back-end using `completion-at-point-functions'."
   (interactive (list 'interactive))
   (pcase command
     (`interactive (company-begin-backend 'company-capf))
index 444061680323a16d51451ab1d25a6d6addc2b1f3..7fa5c2c5dd881c3ddc7d328888dc97364427acd4 100644 (file)
@@ -297,16 +297,13 @@ This doesn't include the margins and the scroll bar."
                         (assq backend company-safe-backends))
                 (cl-return t))))))
 
-(defvar company--include-capf (version< "24.3.50" emacs-version))
-
-(defcustom company-backends `(,@(unless company--include-capf
+(defcustom company-backends `(,@(unless (version< "24.3.50" emacs-version)
                                   (list 'company-elisp))
                               company-bbdb
                               company-nxml company-css
                               company-eclim company-semantic company-clang
                               company-xcode company-ropemacs company-cmake
-                              ,@(when company--include-capf
-                                  (list 'company-capf))
+                              company-capf
                               (company-dabbrev-code company-gtags company-etags
                                company-keywords)
                               company-oddmuse company-files company-dabbrev)