X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=emacs%2Fnotmuch-company.el;h=91c4804f4a086c95a1f755e10b43eaf4fd421929;hp=610e223deffc6eec337da69e28a3ecc5be8881bd;hb=343534d82dc8882b3f0e2a847ee9d10ba5392809;hpb=2cf0ef3998a75a8e5bcd83f0a286d9660f1bdb0e diff --git a/emacs/notmuch-company.el b/emacs/notmuch-company.el index 610e223d..91c4804f 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) @@ -80,6 +86,7 @@ (match (if (string-match notmuch-company-last-prefix arg) (match-end 0) 0)) + (post-completion (run-hook-with-args 'notmuch-address-completion-hook arg)) (no-cache t))))