--- /dev/null
+Return-Path: <sfischmeister@uwaterloo.ca>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 3EFDD431FBD\r
+ for <notmuch@notmuchmail.org>; Tue, 21 Jan 2014 14:31:17 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -2.3\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id BG2oT7Rs2mrJ for <notmuch@notmuchmail.org>;\r
+ Tue, 21 Jan 2014 14:31:11 -0800 (PST)\r
+X-Greylist: delayed 859 seconds by postgrey-1.32 at olra;\r
+ Tue, 21 Jan 2014 14:31:11 PST\r
+Received: from mailchk-m05.uwaterloo.ca (mailservices.uwaterloo.ca\r
+ [129.97.128.141])\r
+ (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id A9C1D431FAF\r
+ for <notmuch@notmuchmail.org>; Tue, 21 Jan 2014 14:31:11 -0800 (PST)\r
+Received: from connect.uwaterloo.ca (connhub2.connect.uwaterloo.ca\r
+ [129.97.149.119])\r
+ by mailchk-m05.uwaterloo.ca (8.14.4/8.14.4) with ESMTP id\r
+ s0LMGXSb013415\r
+ (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=OK)\r
+ for <notmuch@notmuchmail.org>; Tue, 21 Jan 2014 17:16:50 -0500\r
+Received: from uwaterloo.ca (10.20.190.150) by connhub2.connect.uwaterloo.ca\r
+ (129.97.149.119) with Microsoft SMTP Server (TLS) id 14.3.174.1;\r
+ Tue, 21 Jan 2014 17:16:46 -0500\r
+From: Sebastian Fischmeister <sfischme@uwaterloo.ca>\r
+To: <notmuch@notmuchmail.org>\r
+Subject: ido address lookup for notmuch\r
+User-Agent: Notmuch/0.17+27~gae47d61 (http://notmuchmail.org) Emacs/24.3.1\r
+ (x86_64-unknown-linux-gnu)\r
+X-Homepage: http://esg.uwaterloo.ca\r
+Date: Tue, 21 Jan 2014 17:13:16 -0500\r
+Message-ID: <87a9ep0yrn.fsf@uwaterloo.ca>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-Miltered: at mailchk-m05 with ID 52DEF1C1.006 by Joe's j-chkmail\r
+ (http://j-chkmail.ensmp.fr)!\r
+X-Virus-Scanned: clamav-milter 0.98 at mailchk-m05\r
+X-Virus-Status: Clean\r
+X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3\r
+ (mailchk-m05.uwaterloo.ca [129.97.128.141]);\r
+ Tue, 21 Jan 2014 17:16:50 -0500 (EST)\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://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: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 21 Jan 2014 22:31:17 -0000\r
+\r
+Hi,\r
+\r
+This is a function that I find really useful. I adapted it a bit based\r
+on the original from Jacek Generowicz. Maybe others will find it helpful\r
+as well.\r
+\r
+ Sebastian\r
+\r
+;; original https://groups.google.com/group/mu-discuss/browse_thread/thread/551b7a6487a0aeb3\r
+\r
+(setq notmuch-compose-complete-ignore-address-regexp (regexp-opt '("failed" "DO NOT REPLY" "donotreply" "no-reply" "noreply" "Google Drive")))\r
+\r
+(defun jmg/ido-select-recipient ()\r
+ "Inserts a contact from the addrlookup cache.\r
+Uses ido to select the contact from all those present in the database."\r
+ (interactive)\r
+ (insert\r
+ (ido-completing-read\r
+ "Recipient: "\r
+ (mapcar (lambda (contact-string)\r
+ (let* ((data (split-string contact-string " "))\r
+ (address (car data))\r
+ (name (when (> (length (cadr data)) 0) (cadr data)))\r
+ )\r
+ (if name\r
+ (format "%s <%s>" name address)\r
+ address)))\r
+ (remove-if (lambda (string) (string-match notmuch-compose-complete-ignore-address-regexp string))\r
+ (remove-if (lambda (string) (= 0 (length string)))\r
+ (split-string (shell-command-to-string (concat "addrlookup " (thing-at-point 'word) )) "\n")))))))\r
+\r
+\r
+\r