X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=emacs%2Fnotmuch-company.el;h=ebe2c0846e1b2108f520023e3198970d7e43410e;hb=383796c325de2dbb32c5c02157777d2d06d39f0b;hp=610e223deffc6eec337da69e28a3ecc5be8881bd;hpb=2cf0ef3998a75a8e5bcd83f0a286d9660f1bdb0e;p=notmuch diff --git a/emacs/notmuch-company.el b/emacs/notmuch-company.el index 610e223d..ebe2c084 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) @@ -47,7 +48,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) + (notmuch-setq-local company-idle-delay nil))) ;;;###autoload (defun notmuch-company (command &optional arg &rest _ignore) @@ -80,6 +87,7 @@ (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))))