--- /dev/null
+Return-Path: <amdragon@mit.edu>\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 B5227431FAF\r
+ for <notmuch@notmuchmail.org>; Sat, 24 Nov 2012 14:09:32 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 20yoziCEfMpT for <notmuch@notmuchmail.org>;\r
+ Sat, 24 Nov 2012 14:09:32 -0800 (PST)\r
+Received: from dmz-mailsec-scanner-4.mit.edu (DMZ-MAILSEC-SCANNER-4.MIT.EDU\r
+ [18.9.25.15])\r
+ by olra.theworths.org (Postfix) with ESMTP id 3030A431FAE\r
+ for <notmuch@notmuchmail.org>; Sat, 24 Nov 2012 14:09:32 -0800 (PST)\r
+X-AuditID: 1209190f-b7f636d00000095b-aa-50b1459b63a6\r
+Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])\r
+ by dmz-mailsec-scanner-4.mit.edu (Symantec Messaging Gateway) with SMTP\r
+ id 63.84.02395.B9541B05; Sat, 24 Nov 2012 17:09:31 -0500 (EST)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+ by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id qAOM9UiJ024004; \r
+ Sat, 24 Nov 2012 17:09:31 -0500\r
+Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
+ (authenticated bits=0)\r
+ (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+ by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id qAOM9TVt021272\r
+ (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT);\r
+ Sat, 24 Nov 2012 17:09:30 -0500 (EST)\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80)\r
+ (envelope-from <amdragon@mit.edu>)\r
+ id 1TcNui-0005uo-SM; Sat, 24 Nov 2012 17:09:28 -0500\r
+Date: Sat, 24 Nov 2012 17:09:28 -0500\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: markwalters1009 <markwalters1009@gmail.com>\r
+Subject: Re: [PATCH v2 4/7] emacs: make emacs tagging use the stdin query\r
+ functionality\r
+Message-ID: <20121124220902.GI4562@mit.edu>\r
+References: <1353763256-32336-1-git-send-email-markwalters1009@gmail.com>\r
+ <1353763256-32336-5-git-send-email-markwalters1009@gmail.com>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Content-Disposition: inline\r
+In-Reply-To: <1353763256-32336-5-git-send-email-markwalters1009@gmail.com>\r
+User-Agent: Mutt/1.5.21 (2010-09-15)\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFmpmleLIzCtJLcpLzFFi42IR4hTV1p3tujHAYMZ3eYvVc3ksrt+cyezA\r
+ 5LFz1l12j2erbjEHMEVx2aSk5mSWpRbp2yVwZcy6so61YKpAxfMFe1gaGK/wdDFyckgImEjc\r
+ m/yEGcIWk7hwbz1bFyMXh5DAPkaJ571/mCGcDYwS665+YYJwLjJJnH18igXCWcIocbt3MVAZ\r
+ BweLgKrEn78WIKPYBDQktu1fzghiiwjoS+xZcZsNxGYWkJb49ruZCcQWFoiUWPagiwXE5hXQ\r
+ lnh/6TTUtk5Gic7DM1ghEoISJ2c+YYFo1pK48e8lE8gukEHL/3GAhDkFvCS2bn0FVi4qoCIx\r
+ 5eQ2tgmMQrOQdM9C0j0LoXsBI/MqRtmU3Crd3MTMnOLUZN3i5MS8vNQiXRO93MwSvdSU0k2M\r
+ 4LCW5N/B+O2g0iFGAQ5GJR7exDPrA4RYE8uKK3MPMUpyMCmJ8lY5bQwQ4kvKT6nMSCzOiC8q\r
+ zUktPsQowcGsJMJrrQqU401JrKxKLcqHSUlzsCiJ815NuekvJJCeWJKanZpakFoEk5Xh4FCS\r
+ 4OUCxq+QYFFqempFWmZOCUKaiYMTZDgP0HATkBre4oLE3OLMdIj8KUZFKXHepy5ACQGQREZp\r
+ HlwvLO28YhQHekWYlx2knQeYsuC6XwENZgIa/HT2OpDBJYkIKakGxhlnHk1eULBX3cFtn+EF\r
+ aVduVZfyFelr1YS7i6TPMCrpPmlnZXf+u7JHeO0G7rQ0X/cP8uGRnwuuSDlvyGneOC0/puDc\r
+ puzp6h/35C5yZda6tkhD9uSJ7FLZ1pe+G9U+hUaaHawIjInQmWWR8PqLVr2okaNOmYn2Pe09\r
+ KWtqVDf45PLV7f+jxFKckWioxVxUnAgAnKmopxYDAAA=\r
+Cc: notmuch@notmuchmail.org\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: Sat, 24 Nov 2012 22:09:32 -0000\r
+\r
+Quoth markwalters1009 on Nov 24 at 1:20 pm:\r
+> From: Mark Walters <markwalters1009@gmail.com>\r
+> \r
+> In preparation for the use of large queries in some cases make tagging\r
+> from emacs use the new query on stdin functionality. Currently uses\r
+> this for all tagging (as I could not see a reason not to).\r
+> ---\r
+> emacs/notmuch-tag.el | 14 +++++++++-----\r
+> 1 files changed, 9 insertions(+), 5 deletions(-)\r
+> \r
+> diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el\r
+> index 4fce3a9..4634b0d 100644\r
+> --- a/emacs/notmuch-tag.el\r
+> +++ b/emacs/notmuch-tag.el\r
+> @@ -59,9 +59,10 @@ the messages that were tagged"\r
+> (setq search-terms (list "*")))\r
+> (split-string\r
+> (with-output-to-string\r
+> - (with-current-buffer standard-output\r
+> - (apply 'call-process notmuch-command nil t\r
+> - nil "search" "--output=tags" "--exclude=false" search-terms)))\r
+> + (with-temp-buffer\r
+> + (insert (mapconcat 'identity search-terms " "))\r
+\r
+#'identity ?\r
+\r
+> + (apply 'call-process-region (point-min) (point-max) notmuch-command nil\r
+\r
+#'call-process-region ?\r
+\r
+> + standard-output nil "search" "--output=tags" "--exclude=false" (list "-"))))\r
+\r
+If you use funcall instead of apply here, you won't need to put "-" in\r
+a list.\r
+\r
+Also, the lines seem a little long (but maybe that's just diff and\r
+quoting?)\r
+\r
+> "\n+" t))\r
+> \r
+> (defun notmuch-select-tag-with-completion (prompt &rest search-terms)\r
+> @@ -134,8 +135,11 @@ notmuch-after-tag-hook will be run."\r
+> tag-changes)\r
+> (unless (null tag-changes)\r
+> (run-hooks 'notmuch-before-tag-hook)\r
+> - (apply 'notmuch-call-notmuch-process "tag"\r
+> - (append tag-changes (list "--" query)))\r
+> + (with-temp-buffer\r
+> + (insert query)\r
+> + (apply 'notmuch-call-notmuch-process-region\r
+\r
+#'notmuch-call-notmuch-process-region ?\r
+\r
+> + (point-min) (point-max)\r
+> + "tag" (append tag-changes (list "--" "-"))))\r
+> (run-hooks 'notmuch-after-tag-hook))\r
+> ;; in all cases we return tag-changes as a list\r
+> tag-changes)\r