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

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

[elpa] 21/31: company-init-backend: don't try to initialize lambdas


From: Dmitry Gutov
Subject: [elpa] 21/31: company-init-backend: don't try to initialize lambdas
Date: Tue, 18 Mar 2014 05:19:37 +0000

dgutov pushed a commit to branch master
in repository elpa.

commit 1d49ed71992c891f69b61c214a0c9d16da6779ec
Author: Dmitry Gutov <address@hidden>
Date:   Thu Mar 13 19:07:08 2014 +0200

    company-init-backend: don't try to initialize lambdas
---
 company.el |   32 +++++++++++++++++---------------
 1 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/company.el b/company.el
index 5ee3c66..2a77cb1 100644
--- a/company.el
+++ b/company.el
@@ -571,21 +571,23 @@ The work-around consists of adding a newline.")
   (and (symbolp backend)
        (not (fboundp backend))
        (ignore-errors (require backend nil t)))
-
-  (if (or (symbolp backend)
-          (functionp backend))
-      (condition-case err
-          (progn
-            (funcall backend 'init)
-            (put backend 'company-init t))
-        (error
-         (put backend 'company-init 'failed)
-         (unless (memq backend company--disabled-backends)
-           (message "Company back-end '%s' could not be initialized:\n%s"
-                    backend (error-message-string err)))
-         (pushnew backend company--disabled-backends)
-         nil))
-    (mapc 'company-init-backend backend)))
+  (cond
+   ((symbolp backend)
+    (condition-case err
+        (progn
+          (funcall backend 'init)
+          (put backend 'company-init t))
+      (error
+       (put backend 'company-init 'failed)
+       (unless (memq backend company--disabled-backends)
+         (message "Company back-end '%s' could not be initialized:\n%s"
+                  backend (error-message-string err)))
+       (pushnew backend company--disabled-backends)
+       nil)))
+   ;; No initialization for lambdas.
+   ((functionp backend) t)
+   (t ;; Must be a list.
+    (mapc 'company-init-backend backend))))
 
 (defvar company-default-lighter " company")
 



reply via email to

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