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

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

[elpa] 17/35: company--merge-async: tweak


From: Dmitry Gutov
Subject: [elpa] 17/35: company--merge-async: tweak
Date: Sat, 19 Apr 2014 10:12:17 +0000

dgutov pushed a commit to branch master
in repository elpa.

commit 0a2220265d9248a1c8236058072a283d2d52e62f
Author: Dmitry Gutov <address@hidden>
Date:   Wed Apr 2 13:07:38 2014 +0300

    company--merge-async: tweak
---
 company.el |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/company.el b/company.el
index d6293ee..cdda9dd 100644
--- a/company.el
+++ b/company.el
@@ -864,13 +864,12 @@ means that `company-mode' is always turned on except in 
`message-mode' buffers."
     (company--merge-async pairs (lambda (values) (apply #'append values)))))
 
 (defun company--merge-async (pairs merger)
-  (let ((async (loop for (val . mapper) in pairs
+  (let ((async (loop for pair in pairs
                      thereis
-                     (eq :async (car-safe val)))))
+                     (eq :async (car-safe (car pair))))))
     (if (not async)
-        (funcall merger (mapcar (lambda (pair)
-                                  (funcall (cdr pair) (car pair)))
-                                pairs))
+        (funcall merger (loop for (val . mapper) in pairs
+                              collect (funcall mapper val)))
       (cons
        :async
        (lambda (callback)
@@ -893,8 +892,7 @@ means that `company-mode' is always turned on except in 
`message-mode' buffers."
                             (lambda (res)
                               (setq pending (delq fetcher pending))
                               (setcar cell (funcall mapper res))
-                              (funcall finisher)))))))
-           (funcall finisher)))))))
+                              (funcall finisher)))))))))))))
 
 ;;; completion mechanism 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 



reply via email to

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