]> code.delx.au - gnu-emacs-elpa/commitdiff
Clear company-backend in company-auto-begin
authorDmitry Gutov <dgutov@yandex.ru>
Wed, 5 Mar 2014 05:55:02 +0000 (07:55 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Wed, 5 Mar 2014 05:55:02 +0000 (07:55 +0200)
company.el

index 5a064d49ae341c2cfb80e43f7a219f09d01f4752..2c7fa5f6f66a2a2817e0d0d63ecd1576d7ab7d98 100644 (file)
@@ -1072,6 +1072,8 @@ Keywords and function definition names are ignored."
                   (message "%s" (error-message-string err))
                   (company-cancel))
            (quit (company-cancel)))))
+  (unless company-candidates
+    (setq company-backend nil))
   ;; Return non-nil if active.
   company-candidates)
 
@@ -1776,9 +1778,7 @@ To show the number next to the candidates in some back-ends, enable
   (setq company-backend backend)
   ;; Return non-nil if active.
   (or (company-manual-begin)
-      (progn
-        (setq company-backend nil)
-        (error "Cannot complete at point"))))
+      (error "Cannot complete at point")))
 
 (defun company-begin-with (candidates
                            &optional prefix-length require-match callback)