]> git.notmuchmail.org Git - notmuch/blobdiff - emacs/notmuch-company.el
emacs: add compatibility functions for emacs 23
[notmuch] / emacs / notmuch-company.el
index 610e223deffc6eec337da69e28a3ecc5be8881bd..5d75c1455933e0548cb44fe47b26d718c4656a14 100644 (file)
@@ -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)
 (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)