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

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

[elpa] master f78f9c1 21/23: Initialize grouped backends on the fly as w


From: Dmitry Gutov
Subject: [elpa] master f78f9c1 21/23: Initialize grouped backends on the fly as well
Date: Fri, 11 Nov 2016 22:21:42 +0000 (UTC)

branch: master
commit f78f9c14d551f6bf4e82e2ae98291811642d8190
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    Initialize grouped backends on the fly as well
    
    Fixes #552.
---
 company.el |   15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/company.el b/company.el
index ce5a652..e540dd1 100644
--- a/company.el
+++ b/company.el
@@ -697,6 +697,12 @@ asynchronous call into synchronous.")
       (unless (keywordp b)
         (company-init-backend b))))))
 
+(defun company--maybe-init-backend (backend)
+  (or (not (symbolp backend))
+      (eq t (get backend 'company-init))
+      (unless (get backend 'company-init)
+        (company-init-backend backend))))
+
 (defcustom company-lighter-base "company"
   "Base string to use for the `company-mode' lighter."
   :type 'string
@@ -932,8 +938,8 @@ matches IDLE-BEGIN-AFTER-RE, return it wrapped in a cons."
 
 (defun company--multi-backend-adapter (backends command &rest args)
   (let ((backends (cl-loop for b in backends
-                           when (not (and (symbolp b)
-                                          (eq 'failed (get b 'company-init))))
+                           when (or (keywordp b)
+                                    (company--maybe-init-backend b))
                            collect b))
         (separate (memq :separate backends)))
 
@@ -1535,10 +1541,7 @@ prefix match (same case) will be prioritized."
       (setq prefix
             (if (or (symbolp backend)
                     (functionp backend))
-                (when (or (not (symbolp backend))
-                          (eq t (get backend 'company-init))
-                          (unless (get backend 'company-init)
-                            (company-init-backend backend)))
+                (when (company--maybe-init-backend backend)
                   (funcall backend 'prefix))
               (company--multi-backend-adapter backend 'prefix)))
       (when prefix



reply via email to

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