emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] 33/35: Always include company-capf in the backends


From: Dmitry Gutov
Subject: [elpa] 33/35: Always include company-capf in the backends
Date: Sat, 19 Apr 2014 10:12:22 +0000

dgutov pushed a commit to branch master
in repository elpa.

commit 66d8567a78a9eb86a5fd549fbbb1d90faf692a17
Author: Dmitry Gutov <address@hidden>
Date:   Sat Apr 19 05:02:37 2014 +0400

    Always include company-capf in the backends
    
    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         |    2 ++
 company-capf.el |    3 +--
 company.el      |    7 ++-----
 3 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/NEWS.md b/NEWS.md
index 9037b01..bdb3de4 100644
--- 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.
diff --git a/company-capf.el b/company-capf.el
index 04f8413..3aaeb13 100644
--- a/company-capf.el
+++ b/company-capf.el
@@ -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))
diff --git a/company.el b/company.el
index 4440616..7fa5c2c 100644
--- a/company.el
+++ b/company.el
@@ -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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]