;;; Code:
(eval-when-compile (require 'cl))
+(require 'notmuch-lib)
(defvar notmuch-company-last-prefix nil)
(make-variable-buffer-local 'notmuch-company-last-prefix)
(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)
;;;###autoload
;; 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)
(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))
(match (if (string-match notmuch-company-last-prefix arg)
(match-end 0)
0))
+ (post-completion (run-hook-with-args 'notmuch-address-post-completion-functions arg))
(no-cache t))))