]> code.delx.au - gnu-emacs-elpa/commitdiff
Revert "company--multi-backend-adapter: Use each respective backend's prefix"
authorDmitry Gutov <dgutov@yandex.ru>
Tue, 16 Apr 2013 11:31:20 +0000 (15:31 +0400)
committerDmitry Gutov <dgutov@yandex.ru>
Tue, 16 Apr 2013 11:31:20 +0000 (15:31 +0400)
This reverts commit a982f0fe043c31aca1a11a663c41c33b76ef0c19.

Maybe re-apply later; will have to save the correspondence between candidates
and backends, e.g. for company-strip-prefix.

NEWS.md
company-tests.el
company.el

diff --git a/NEWS.md b/NEWS.md
index b63d5ed5c494240b5c72f1e2fd789bade14b51af..91064a45e54faa3d1e3ec60686c0bc2c474bfd5d 100644 (file)
--- a/NEWS.md
+++ b/NEWS.md
@@ -2,9 +2,6 @@
 
 ## Next
 
-* Candidates from grouped back-ends are retrieved more accurately: each
-  `candidates` command receives in the second argument the respective value the
-  back-end returned to the `prefix` command.
 * `company-auto-complete` is disabled by default.
 * `company-auto-complete-chars` default value includes fewer syntax classes.
 * In expanded function calls, arguments skipped by the user default to "argN".
index 657486b096a88dc2573801c2a5960e05d544b2f2..309d8f1f8b4832a64fb8f562318488dd927f0544 100644 (file)
       (should (null company-candidates))
       (should (null (company-explicit-action-p))))))
 
-(ert-deftest company-multi-backend-adapter-uses-respective-prefixes ()
-  ;; And ignores the second argument.
-  (let ((company-backend
-         (list (lambda (command &optional arg)
-                 (case command
-                   (prefix "bar")
-                   (candidates (mapcar (lambda (tail) (concat arg "-" tail))
-                                       '("a" "b" "c")))))
-               (lambda (command &optional arg)
-                 (case command
-                   (prefix "foo-bar")
-                   (candidates (mapcar (lambda (tail) (concat arg "-" tail))
-                                       '("d" "e"))))))))
-    (should (equal (sort '("bar-a" "bar-b" "bar-c" "foo-bar-d" "foo-bar-e")
-                         'string<)
-                   (company-call-backend 'candidates "hubba-hubba")))))
-
-;; Pseudo-Tooltip
-
 (ert-deftest company-pseudo-tooltip-does-not-get-displaced ()
   (with-temp-buffer
     (save-window-excursion
index 3fa83534aab996420dc091b88be48c45b6b51c2c..9f13518f0ebb70957e0b588706453c05e6dcfbde 100644 (file)
@@ -658,9 +658,9 @@ keymap during active completions (`company-active-map'):
     (case command
       (candidates
        (loop for backend in backends
-             for prefix = (funcall backend 'prefix)
-             when prefix
-             append (funcall backend 'candidates prefix)))
+             when (equal (funcall backend 'prefix)
+                         (car args))
+             append (apply backend 'candidates args)))
       (sorted nil)
       (duplicates t)
       (otherwise