--- /dev/null
+Return-Path: <markwalters1009@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 4027F6DE1226\r
+ for <notmuch@notmuchmail.org>; Sat, 24 Oct 2015 08:53:50 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.059\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.059 tagged_above=-999 required=5 tests=[AWL=0.511,\r
+ DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+ FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7,\r
+ RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001]\r
+ autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id 3DImRrCJ_t6o for <notmuch@notmuchmail.org>;\r
+ Sat, 24 Oct 2015 08:53:48 -0700 (PDT)\r
+Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com\r
+ [209.85.212.181])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id 130E36DE0C5F\r
+ for <notmuch@notmuchmail.org>; Sat, 24 Oct 2015 08:53:48 -0700 (PDT)\r
+Received: by wikq8 with SMTP id q8so112359247wik.1\r
+ for <notmuch@notmuchmail.org>; Sat, 24 Oct 2015 08:53:44 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+ h=from:to:cc:subject:date:message-id:in-reply-to:references;\r
+ bh=g0NCoYnYHgSuntnQKB7AP5yiPNTmgAsJKJE9xfOITnc=;\r
+ b=ZGgDxJALbGTqqtNysqmx0hPg//xQ5aJvwcUM232XTqsuT7EuUa0s9YL1JBwV1nxqC2\r
+ H1+oviUas/4c/CaLe7paQBrb3t7mNSZ9kG/WmHM4wVU6XbVKyZIc/pZmjZyVXwvjji0l\r
+ BK2WnNxUrquIRiVoPj+qPAawDZbMG9uLYx6l//Y812C+m3W/IutRyiTShs6zjZ4klJBG\r
+ baxHeB6U59JY+CMC/M1lPtem+U3ua4oXfUm/zCgrn6NrA4jM7BkLQeGNoEZ1GXyOQkLC\r
+ e+LtA5UGEFDo813bk0NE7jOqblA7tuV/+xeKlxKJzUvBgrzfJW5T5FTFbLQuBvXQZ8Q7\r
+ c9hA==\r
+X-Received: by 10.194.84.4 with SMTP id u4mr9530710wjy.149.1445702023931;\r
+ Sat, 24 Oct 2015 08:53:43 -0700 (PDT)\r
+Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162])\r
+ by smtp.gmail.com with ESMTPSA id ki7sm28780830wjc.28.2015.10.24.08.53.42\r
+ (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+ Sat, 24 Oct 2015 08:53:43 -0700 (PDT)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] autoload notmuch-company if we have company\r
+Date: Sat, 24 Oct 2015 16:53:39 +0100\r
+Message-Id: <1445702019-10638-1-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 2.1.4\r
+In-Reply-To: <1445646037-25994-4-git-send-email-david@tethera.net>\r
+References: <1445646037-25994-4-git-send-email-david@tethera.net>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.20\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sat, 24 Oct 2015 15:53:50 -0000\r
+\r
+---\r
+\r
+Does this work for people with company installed (on top of the first\r
+3 patches in the series)? I hope it should autoload notmuch-company if\r
+the user has company. I don't on this computer (and am still running\r
+emacs 23) so haven't tested.\r
+\r
+Best wishes\r
+\r
+Mark\r
+\r
+\r
+emacs/notmuch-address.el | 5 +++++\r
+ emacs/notmuch-company.el | 1 -\r
+ 2 files changed, 5 insertions(+), 1 deletion(-)\r
+\r
+diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el\r
+index d54a8bb..4a3fc23 100644\r
+--- a/emacs/notmuch-address.el\r
++++ b/emacs/notmuch-address.el\r
+@@ -22,6 +22,11 @@\r
+ (require 'message)\r
+ (require 'notmuch-parser)\r
+ \r
++;; Only load notmuch-company if we have company (but we don't want an\r
++;; error if we don't have company\r
++(when (require 'company nil 't)\r
++ (require 'notmuch-company))\r
++\r
+ ;;\r
+ \r
+ (defcustom notmuch-address-command nil\r
+diff --git a/emacs/notmuch-company.el b/emacs/notmuch-company.el\r
+index f34aec4..9a44cf5 100644\r
+--- a/emacs/notmuch-company.el\r
++++ b/emacs/notmuch-company.el\r
+@@ -33,7 +33,6 @@\r
+ \r
+ ;;; Code:\r
+ \r
+-(require 'company)\r
+ (require 'message)\r
+ (require 'notmuch-address)\r
+ (require 'cl-lib)\r
+-- \r
+2.1.4\r
+\r