]> code.delx.au - gnu-emacs-elpa/commitdiff
Add workaround for bug#18067
authorDmitry Gutov <dgutov@yandex.ru>
Wed, 30 Dec 2015 04:28:52 +0000 (06:28 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Wed, 30 Dec 2015 04:28:52 +0000 (06:28 +0200)
Fixes #440

company-capf.el

index 0b88e2ba4feca032a2f7a8ba877977376159e49a..3094ea35011055420deaa75e9a0b6e94f8d684ba 100644 (file)
               ;; the latter comes later.
               (remove 'tags-completion-at-point-function
                       (default-value 'completion-at-point-functions)))
+             (completion-at-point-functions (company--capf-workaround))
              (data (run-hook-wrapped 'completion-at-point-functions
                                      ;; Ignore misbehaving functions.
                                      #'completion--capf-wrapper 'optimist)))
     (when (and (consp (cdr data)) (integer-or-marker-p (nth 1 data))) data)))
 
+(defun company--capf-workaround ()
+  ;; For http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18067
+  (if (or (not (memq 'python-completion-at-point completion-at-point-functions))
+          (python-shell-get-process))
+      completion-at-point-functions
+    (remq 'python-completion-at-point completion-at-point-functions)))
+
 (defun company-capf (command &optional arg &rest _args)
   "`company-mode' backend using `completion-at-point-functions'."
   (interactive (list 'interactive))