]> code.delx.au - gnu-emacs-elpa/blobdiff - company.el
Add experimental backend command 'common
[gnu-emacs-elpa] / company.el
index df758e10e75553439873ad3c475fba49e3646f5d..fe87eed697945834b3bb9ece4fafd6a1c3f979f9 100644 (file)
@@ -787,7 +787,9 @@ can retrieve meta-data for them."
   (push (cons company-prefix company-candidates) company-candidates-cache)
   ;; Calculate common.
   (let ((completion-ignore-case (company-call-backend 'ignore-case)))
-    (setq company-common (try-completion company-prefix company-candidates)))
+    (let ((common (try-completion company-prefix company-candidates)))
+      (setq company-common (or (company-call-backend 'common common)
+                               common))))
   (when (eq company-common t)
     (setq company-candidates nil)))
 
@@ -823,9 +825,9 @@ can retrieve meta-data for them."
              (or (cdr candidates)
                  (not (eq t (compare-strings (car candidates) nil nil
                                              prefix nil nil ignore-case)))))
-        ;; Don't start when already completed and unique.
         candidates
-      ;; Not the right place? maybe when setting?
+      ;; Already completed and unique; don't start.
+      ;; FIXME: Not the right place? maybe when setting?
       (and company-candidates t))))
 
 (defun company-idle-begin (buf win tick pos)