--- /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 B7455429E35\r
+ for <notmuch@notmuchmail.org>; Tue, 22 Oct 2013 12:51:24 -0700 (PDT)\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 0JfpifREDQeO for <notmuch@notmuchmail.org>;\r
+ Tue, 22 Oct 2013 12:51:19 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-3.mit.edu (dmz-mailsec-scanner-3.mit.edu\r
+ [18.9.25.14])\r
+ by olra.theworths.org (Postfix) with ESMTP id 93524431E64\r
+ for <notmuch@notmuchmail.org>; Tue, 22 Oct 2013 12:51:08 -0700 (PDT)\r
+X-AuditID: 1209190e-b7f828e0000009cf-1f-5266d72a22e8\r
+Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])\r
+ by dmz-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP\r
+ id B2.0E.02511.A27D6625; Tue, 22 Oct 2013 15:51:06 -0400 (EDT)\r
+Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])\r
+ by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id r9MJp3Rm030253; \r
+ Tue, 22 Oct 2013 15:51:04 -0400\r
+Received: from drake.dyndns.org (31-33-57.wireless.csail.mit.edu\r
+ [128.31.33.57]) (authenticated bits=0)\r
+ (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+ by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id r9MJp1wi005194\r
+ (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+ Tue, 22 Oct 2013 15:51:03 -0400\r
+Received: from amthrax by drake.dyndns.org with local (Exim 4.77)\r
+ (envelope-from <amdragon@mit.edu>)\r
+ id 1VYhym-0006yi-Oc; Tue, 22 Oct 2013 15:51:00 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 3/8] emacs: Use interactive specifications for tag changes in\r
+ show\r
+Date: Tue, 22 Oct 2013 15:50:52 -0400\r
+Message-Id: <1382471457-26056-4-git-send-email-amdragon@mit.edu>\r
+X-Mailer: git-send-email 1.8.4.rc3\r
+In-Reply-To: <1382471457-26056-1-git-send-email-amdragon@mit.edu>\r
+References: <1382471457-26056-1-git-send-email-amdragon@mit.edu>\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFtrAIsWRmVeSWpSXmKPExsUixCmqrat1PS3IYOdNFYvrN2cyOzB6PFt1\r
+ izmAMYrLJiU1J7MstUjfLoEr48A2s4IHMhU3X/1la2D8Lt7FyMkhIWAi8eL5BmYIW0ziwr31\r
+ bF2MXBxCAvsYJZa/aYByNjJK7L93hAmkSkjgGJPEq68hEIm5jBJ/fn4FS7AJaEhs27+cEcQW\r
+ EZCW2Hl3NmsXIwcHs4CaxJ8uFZCwsECQxLSzi8BKWARUJdbu2sQCYvMKOEgc2LuFEeIKJYmF\r
+ p7axgticAo4S0/f9YwMZIwRUc+oOxwRG/gWMDKsYZVNyq3RzEzNzilOTdYuTE/PyUot0jfVy\r
+ M0v0UlNKNzGCA0aSbwfj14NKhxgFOBiVeHgt2tOChFgTy4orcw8xSnIwKYnyRlwFCvEl5adU\r
+ ZiQWZ8QXleakFh9ilOBgVhLhbfYFyvGmJFZWpRblw6SkOViUxHlvctgHCQmkJ5akZqemFqQW\r
+ wWRlODiUJHgfgQwVLEpNT61Iy8wpQUgzcXCCDOcBGn4MpIa3uCAxtzgzHSJ/ilFRSpx3CUhC\r
+ ACSRUZoH1wuL6FeM4kCvCEO08wCTAVz3K6DBTECDpywBG1ySiJCSamDMyN75NvaGvJPDtSsq\r
+ Ed9nbld4u1N1nkB6cUeb+qp1P2OcTL8Ls6tdEZJ7XZGl3PpslyenqdH0Z9vf9RptX9v2/I1T\r
+ 9S4WuR3NP+ZUzFM7o3FxdYbxu4dWe3+mJkzI0b/xQuvtWRndMxv+xJvUXT71sVeOsZeJ86HY\r
+ C+tJs1K+ndqzYvqqrQzaSizFGYmGWsxFxYkAetusnsMCAAA=\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, 22 Oct 2013 19:51:25 -0000\r
+\r
+This modifies all tagging operations in show to call\r
+`notmuch-read-tag-changes' in their interactive specification to input\r
+tag changes, rather than depending on lower-level functions to prompt\r
+for tag changes regardless of their calling context.\r
+\r
+Besides being more Elispy and providing a more consistent programmatic\r
+API, this enables callers to provide two call site-specific pieces of\r
+information: an appropriate prompt, and the set of visible tags. The\r
+prompt lets us differentiate * from +/-. Providing visible tags\r
+enables a more consistent user experience than retrieving the\r
+(potentially different) tags from the database, and avoids a\r
+round-trip to the CLI and database.\r
+---\r
+ emacs/notmuch-show.el | 34 +++++++++++++++++++++-------------\r
+ 1 file changed, 21 insertions(+), 13 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+index 7325792..ef77839 100644\r
+--- a/emacs/notmuch-show.el\r
++++ b/emacs/notmuch-show.el\r
+@@ -1780,23 +1780,29 @@ TAG-CHANGES is a list of tag operations for `notmuch-tag'."\r
+ (notmuch-tag (notmuch-show-get-message-id) tag-changes)\r
+ (notmuch-show-set-tags new-tags))))\r
+ \r
+-(defun notmuch-show-tag (&optional tag-changes)\r
++(defun notmuch-show-tag (tag-changes)\r
+ "Change tags for the current message.\r
+ \r
+ See `notmuch-tag' for information on the format of TAG-CHANGES."\r
+- (interactive)\r
+- (let* ((tag-changes (notmuch-tag (notmuch-show-get-message-id) tag-changes))\r
+- (current-tags (notmuch-show-get-tags))\r
++ (interactive (list (notmuch-read-tag-changes (notmuch-show-get-tags)\r
++ "Tag message")))\r
++ (notmuch-tag (notmuch-show-get-message-id) tag-changes)\r
++ (let* ((current-tags (notmuch-show-get-tags))\r
+ (new-tags (notmuch-update-tags current-tags tag-changes)))\r
+ (unless (equal current-tags new-tags)\r
+ (notmuch-show-set-tags new-tags))))\r
+ \r
+-(defun notmuch-show-tag-all (&optional tag-changes)\r
++(defun notmuch-show-tag-all (tag-changes)\r
+ "Change tags for all messages in the current show buffer.\r
+ \r
+ See `notmuch-tag' for information on the format of TAG-CHANGES."\r
+- (interactive)\r
+- (setq tag-changes (notmuch-tag (notmuch-show-get-messages-ids-search) tag-changes))\r
++ (interactive\r
++ (list (let (tags)\r
++ (notmuch-show-mapc\r
++ (lambda () (setq tags (append (notmuch-show-get-tags) tags))))\r
++ (delete-dups tags)\r
++ (notmuch-read-tag-changes tags "Tag thread"))))\r
++ (notmuch-tag (notmuch-show-get-messages-ids-search) tag-changes)\r
+ (notmuch-show-mapc\r
+ (lambda ()\r
+ (let* ((current-tags (notmuch-show-get-tags))\r
+@@ -1804,19 +1810,21 @@ See `notmuch-tag' for information on the format of TAG-CHANGES."\r
+ (unless (equal current-tags new-tags)\r
+ (notmuch-show-set-tags new-tags))))))\r
+ \r
+-(defun notmuch-show-add-tag ()\r
++(defun notmuch-show-add-tag (tag-changes)\r
+ "Change tags for the current message (defaulting to add).\r
+ \r
+ Same as `notmuch-show-tag' but sets initial input to '+'."\r
+- (interactive)\r
+- (notmuch-show-tag "+"))\r
++ (interactive\r
++ (list (notmuch-read-tag-changes (notmuch-show-get-tags) "Tag message" "+")))\r
++ (notmuch-show-tag tag-changes))\r
+ \r
+-(defun notmuch-show-remove-tag ()\r
++(defun notmuch-show-remove-tag (tag-changes)\r
+ "Change tags for the current message (defaulting to remove).\r
+ \r
+ Same as `notmuch-show-tag' but sets initial input to '-'."\r
+- (interactive)\r
+- (notmuch-show-tag "-"))\r
++ (interactive\r
++ (list (notmuch-read-tag-changes (notmuch-show-get-tags) "Tag message" "-")))\r
++ (notmuch-show-tag tag-changes))\r
+ \r
+ (defun notmuch-show-toggle-visibility-headers ()\r
+ "Toggle the visibility of the current message headers."\r
+-- \r
+1.8.4.rc3\r
+\r