From 66d8567a78a9eb86a5fd549fbbb1d90faf692a17 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Sat, 19 Apr 2014 05:02:37 +0400 Subject: [PATCH] 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 9037b0103..bdb3de4b9 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 04f8413ed..3aaeb137a 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 444061680..7fa5c2c5d 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) -- 2.39.2