From: Dmitry Gutov Date: Wed, 12 Feb 2014 05:52:29 +0000 (+0200) Subject: company-capf: fix when company-point is nil X-Git-Url: https://code.delx.au/gnu-emacs-elpa/commitdiff_plain/f93584ef1c9c1119dffc899af319d9638f72e055 company-capf: fix when company-point is nil --- diff --git a/company-capf.el b/company-capf.el index 1a4342bf5..77479aeee 100644 --- a/company-capf.el +++ b/company-capf.el @@ -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