X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=emacs%2Fnotmuch-company.el;h=168315ff225fb68034979ad38cab1ebd976cde33;hb=693ca8d8a80438ce1e361e7e6d22288f52a11c55;hp=0619c7ef739951c6618b67c47c565bc457b754dd;hpb=6a833a6e83865f6999707cc30768d07e1351c2cb;p=notmuch diff --git a/emacs/notmuch-company.el b/emacs/notmuch-company.el index 0619c7ef..168315ff 100644 --- a/emacs/notmuch-company.el +++ b/emacs/notmuch-company.el @@ -47,7 +47,13 @@ (defun notmuch-company-setup () (company-mode) (make-local-variable 'company-backends) - (setq company-backends '(notmuch-company))) + (setq company-backends '(notmuch-company)) + ;; Disable automatic company completion unless an internal + ;; completion method is configured. Company completion (using + ;; 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))) ;;;###autoload (defun notmuch-company (command &optional arg &rest _ignore) @@ -72,7 +78,7 @@ (lambda (callback) ;; First run quick asynchronous harvest based on what the user entered so far (notmuch-address-harvest - (format "to:%s*" arg) nil + arg nil (lambda (_proc _event) (funcall callback (notmuch-address-matching arg)) ;; Then start the (potentially long-running) full asynchronous harvest if necessary