--- /dev/null
+Return-Path: <m.walters@qmul.ac.uk>\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 34B636DE1AE1\r
+ for <notmuch@notmuchmail.org>; Sun, 5 Apr 2015 09:23:36 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -1.932\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-1.932 tagged_above=-999 required=5\r
+ tests=[AWL=-0.284, DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,\r
+ NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3,\r
+ RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01,\r
+ RP_MATCHES_RCVD=-0.55, T_FREEMAIL_FORGED_FROMDOMAIN=0.01,\r
+ T_HEADER_FROM_DIFFERENT_DOMAINS=0.01] 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 iWkN1x8WSAIy for <notmuch@notmuchmail.org>;\r
+ Sun, 5 Apr 2015 09:23:33 -0700 (PDT)\r
+Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id E8A696DE1AB2\r
+ for <notmuch@notmuchmail.org>; Sun, 5 Apr 2015 09:23:32 -0700 (PDT)\r
+Received: from smtp.qmul.ac.uk ([138.37.6.40])\r
+ by mail2.qmul.ac.uk with esmtp (Exim 4.71)\r
+ (envelope-from <m.walters@qmul.ac.uk>)\r
+ id 1Yemme-0003mM-D7; Sun, 05 Apr 2015 16:48:27 +0100\r
+Received: from 94.197.113.50.threembb.co.uk ([94.197.113.50] helo=localhost)\r
+ by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71)\r
+ (envelope-from <m.walters@qmul.ac.uk>)\r
+ id 1Yemmd-000619-2K; Sun, 05 Apr 2015 16:48:24 +0100\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] emacs: Added "is:<tag>" style completion\r
+ to notmuch-read-query.\r
+In-Reply-To: <1419671907-27170-1-git-send-email-david@tethera.net>\r
+References: <m2tx1fry0s.fsf@Jane.lan>\r
+ <1419671907-27170-1-git-send-email-david@tethera.net>\r
+User-Agent: Notmuch/0.18.1+86~gef5e66a (http://notmuchmail.org) Emacs/23.4.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Sun, 05 Apr 2015 16:48:18 +0100\r
+Message-ID: <87oan21sql.fsf@qmul.ac.uk>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-Sender-Host-Address: 94.197.113.50\r
+X-QM-Geographic: According to ripencc,\r
+ this message was delivered by a machine in Britain (UK) (GB).\r
+X-QM-SPAM-Info: Sender has good ham record. :)\r
+X-QM-Body-MD5: 00b8092e82b6d9aa96e143df6b9735b7 (of first 20000 bytes)\r
+X-SpamAssassin-Score: -0.0\r
+X-SpamAssassin-SpamBar: /\r
+X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
+ determine if it is\r
+ spam. We require at least 5.0 points to mark a message as spam.\r
+ This message scored -0.0 points.\r
+ Summary of the scoring: \r
+ * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider\r
+ * (markwalters1009[at]gmail.com)\r
+ * -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay\r
+ * domain\r
+X-QM-Scan-Virus: ClamAV says the message is clean\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.18\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: Sun, 05 Apr 2015 16:23:36 -0000\r
+\r
+\r
+Hi\r
+\r
+> From: Charles Celerier <cceleri@cs.stanford.edu>\r
+>\r
+> The notmuch-search-terms man page states that "tag:<tag>" is equivalent\r
+> to "is:<tag>". Completion for "is:<tag>" style searches is now supported\r
+> in the Emacs interface.\r
+>\r
+> Amended by David Bremner: combine lexical-let and let into\r
+> lexical-let*\r
+\r
+This version looks good to me; it works and passes all tests. +1\r
+\r
+Note it does not apply to master but only needs a tiny fixup (see below)\r
+\r
+Best wishes\r
+\r
+Mark\r
+\r
+> ---\r
+> emacs/notmuch.el | 16 +++++++++-------\r
+> 1 file changed, 9 insertions(+), 7 deletions(-)\r
+>\r
+> diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
+> index 218486a..1b6971e 100644\r
+> --- a/emacs/notmuch.el\r
+> +++ b/emacs/notmuch.el\r
+> @@ -855,13 +855,15 @@ See `notmuch-tag' for information on the format of TAG-CHANGES."\r
+> "Read a notmuch-query from the minibuffer with completion.\r
+> \r
+> PROMPT is the string to prompt with."\r
+> - (lexical-let\r
+> - ((completions\r
+> - (append (list "folder:" "path:" "thread:" "id:" "date:" "from:" "to:"\r
+> - "subject:" "attachment:")\r
+ \r
+^ this line now has a "mimetype:" final option\r
+\r
+> - (mapcar (lambda (tag)\r
+> - (concat "tag:" (notmuch-escape-boolean-term tag)))\r
+> - (process-lines notmuch-command "search" "--output=tags" "*")))))\r
+> + (lexical-let*\r
+> + ((all-tags\r
+> + (mapcar (lambda (tag) (notmuch-escape-boolean-term tag))\r
+> + (process-lines notmuch-command "search" "--output=tags" "*")))\r
+> + (completions\r
+> + (append (list "folder:" "path:" "thread:" "id:" "date:" "from:" "to:"\r
+> + "subject:" "attachment:")\r
+> + (mapcar (lambda (tag) (concat "tag:" tag)) all-tags)\r
+> + (mapcar (lambda (tag) (concat "is:" tag)) all-tags))))\r
+> (let ((keymap (copy-keymap minibuffer-local-map))\r
+> (current-query (case major-mode\r
+> (notmuch-search-mode (notmuch-search-get-query))\r
+> -- \r
+> 2.1.3\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r