X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;ds=sidebyside;f=emacs%2Fnotmuch-company.el;h=3e12e7a9f729984899dc32e5cbf2cb1b8e930710;hb=4f2a7993a54dacbe5699f3d6195e13de2c1af2b5;hp=b0f9782175a0c0d1c78c67045d0030785e8ab7a9;hpb=4817005bfc811500802a2a65fd5351658a3e5a7d;p=notmuch diff --git a/emacs/notmuch-company.el b/emacs/notmuch-company.el index b0f97821..3e12e7a9 100644 --- a/emacs/notmuch-company.el +++ b/emacs/notmuch-company.el @@ -28,6 +28,7 @@ ;;; Code: (eval-when-compile (require 'cl)) +(require 'notmuch-lib) (defvar notmuch-company-last-prefix nil) (make-variable-buffer-local 'notmuch-company-last-prefix) @@ -36,12 +37,14 @@ (declare-function company-mode "company") (declare-function company-manual-begin "company") (defvar company-backends) +(defvar company-idle-delay) (declare-function notmuch-address-harvest "notmuch-address") (declare-function notmuch-address-harvest-trigger "notmuch-address") (declare-function notmuch-address-matching "notmuch-address") -(defvar notmuch-address-full-harvest-finished) +(declare-function notmuch-address--harvest-ready "notmuch-address") (defvar notmuch-address-completion-headers-regexp) +(defvar notmuch-address-command) ;;;###autoload (defun notmuch-company-setup () @@ -53,7 +56,7 @@ ;; internal completion) can still be accessed via standard company ;; functions, e.g., company-complete. (unless (eq notmuch-address-command 'internal) - (setq-local company-idle-delay nil))) + (notmuch-setq-local company-idle-delay nil))) ;;;###autoload (defun notmuch-company (command &optional arg &rest _ignore) @@ -69,7 +72,7 @@ (line-beginning-position)) (setq notmuch-company-last-prefix (company-grab "[:,][ \t]*\\(.*\\)" 1 (point-at-bol))))) (candidates (cond - (notmuch-address-full-harvest-finished + ((notmuch-address--harvest-ready) ;; Update harvested addressed from time to time (notmuch-address-harvest-trigger) (notmuch-address-matching arg))