]> code.delx.au - gnu-emacs-elpa/commitdiff
company-capf: fix when company-point is nil
authorDmitry Gutov <dgutov@yandex.ru>
Wed, 12 Feb 2014 05:52:29 +0000 (07:52 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Wed, 12 Feb 2014 05:52:29 +0000 (07:52 +0200)
company-capf.el

index 1a4342bf59d4912b284e072de666f43b0f4b7835..77479aeeec70937fcde83e44abb38519dc8364c5 100644 (file)
@@ -104,7 +104,11 @@ Requires Emacs 24.1 or newer."
        (when f (funcall f arg))))
     (`annotation
      (save-excursion
-       (goto-char company-point)
+       ;; FIXME: `company-begin' sets `company-point' after calling
+       ;; `company--begin-new'.  We shouldn't rely on `company-point' here,
+       ;; better to cache the capf-data value instead.
+       (when company-point
+         (goto-char company-point))
        (let ((f (plist-get (nthcdr 4 (company--capf-data)) :annotation-function)))
          (when f (funcall f arg)))))
     (`require-match