+ (`annotation
+ (save-excursion
+ ;; 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. However: we can't just
+ ;; save the last capf-data value in `prefix', because that command can
+ ;; get called more often than `candidates', and at any point in the
+ ;; buffer (https://github.com/company-mode/company-mode/issues/153).
+ ;; We could try propertizing the returned prefix string, but it's not
+ ;; passed to `annotation', and `company-prefix' is set only after
+ ;; `company--strip-duplicates' is called.
+ (when company-point
+ (goto-char company-point))
+ (let ((f (plist-get (nthcdr 4 (company--capf-data)) :annotation-function)))
+ (when f (funcall f arg)))))