[PATCH v2 7/8] pick: Use interactive specifications for tag changes
authorAustin Clements <amdragon@MIT.EDU>
Wed, 23 Oct 2013 00:22:00 +0000 (20:22 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:57:33 +0000 (09:57 -0800)
5b/f45954a33f127d102f34601d1449583228d304 [new file with mode: 0644]

diff --git a/5b/f45954a33f127d102f34601d1449583228d304 b/5b/f45954a33f127d102f34601d1449583228d304
new file mode 100644 (file)
index 0000000..e7c7c68
--- /dev/null
@@ -0,0 +1,148 @@
+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 1C207431FBC\r
+       for <notmuch@notmuchmail.org>; Tue, 22 Oct 2013 17:22:45 -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 VacEPWPlS3WJ for <notmuch@notmuchmail.org>;\r
+       Tue, 22 Oct 2013 17:22:38 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-2.mit.edu (dmz-mailsec-scanner-2.mit.edu\r
+       [18.9.25.13])\r
+       by olra.theworths.org (Postfix) with ESMTP id 0E362429E36\r
+       for <notmuch@notmuchmail.org>; Tue, 22 Oct 2013 17:22:16 -0700 (PDT)\r
+X-AuditID: 1209190d-b7f528e0000009b4-94-526716b8472a\r
+Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])\r
+       by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id 1D.30.02484.8B617625; Tue, 22 Oct 2013 20:22:16 -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 r9N0M5IH027450; \r
+       Tue, 22 Oct 2013 20:22:05 -0400\r
+Received: from drake.dyndns.org\r
+       (216-15-114-40.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com\r
+       [216.15.114.40]) (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 r9N0M3lj005849\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Tue, 22 Oct 2013 20:22:05 -0400\r
+Received: from amthrax by drake.dyndns.org with local (Exim 4.77)\r
+       (envelope-from <amdragon@mit.edu>)\r
+       id 1VYmD5-0008KS-SS; Tue, 22 Oct 2013 20:22:03 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2 7/8] pick: Use interactive specifications for tag changes\r
+Date: Tue, 22 Oct 2013 20:22:00 -0400\r
+Message-Id: <1382487721-31776-8-git-send-email-amdragon@mit.edu>\r
+X-Mailer: git-send-email 1.8.4.rc3\r
+In-Reply-To: <1382487721-31776-1-git-send-email-amdragon@mit.edu>\r
+References: <1382487721-31776-1-git-send-email-amdragon@mit.edu>\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFtrDIsWRmVeSWpSXmKPExsUixCmqrbtDLD3IYOkXDYvVc3ksrt+cyezA\r
+       5LFz1l12j2erbjEHMEVx2aSk5mSWpRbp2yVwZWzsWMBccEmq4svKXawNjI/Euhg5OSQETCS+\r
+       Xn3LCmGLSVy4t56ti5GLQ0hgH6PEiftn2CGcjYwSsyacZYFw7jBJHOpbCeXMZZRo/XWEDaSf\r
+       TUBDYtv+5YwgtoiAtMTOu7PB5jILOEp83r8IrEZYwEfi55n1QGM5OFgEVCV2To8HCfMKOEh8\r
+       mnYL6gwliYWntoHZnECtb3Z8AGsVAqqZsvMMywRG/gWMDKsYZVNyq3RzEzNzilOTdYuTE/Py\r
+       Uot0jfRyM0v0UlNKNzGCA0mSdwfju4NKhxgFOBiVeHgt2tOChFgTy4orcw8xSnIwKYnyqvOn\r
+       BwnxJeWnVGYkFmfEF5XmpBYfYpTgYFYS4W32BSrnTUmsrEotyodJSXOwKInz3uSwDxISSE8s\r
+       Sc1OTS1ILYLJynBwKEnw+ooCDRUsSk1PrUjLzClBSDNxcIIM5wEavgKkhre4IDG3ODMdIn+K\r
+       UVFKnJcfJCEAksgozYPrhUX6K0ZxoFeEeb+IAFXxAJMEXPcroMFMQIOnLAG5urgkESEl1cC4\r
+       sXnfl91SNa/WH8rX/ffEcP/9jXO4FXRueIV09Db2OzRXJ85pi7/iHrPyu32HxxfB36X2c5+b\r
+       O/ZEWLC0W7gcvh6i7GvT1LFmzTGtqAwbwSWzw9tuvLbh2/5fetZPecuy4hsp7o9OGVXNneI1\r
+       O/GaYrFYLrPW3Gm7dMw+OM2t1pCfuY7xvI0SS3FGoqEWc1FxIgCqoRGzzwIAAA==\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: Wed, 23 Oct 2013 00:22:45 -0000\r
+\r
+---\r
+ contrib/notmuch-pick/notmuch-pick.el | 36 +++++++++++++++++++++---------------\r
+ 1 file changed, 21 insertions(+), 15 deletions(-)\r
+\r
+diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el\r
+index 8f504ed..13682ea 100644\r
+--- a/contrib/notmuch-pick/notmuch-pick.el\r
++++ b/contrib/notmuch-pick/notmuch-pick.el\r
+@@ -37,7 +37,7 @@\r
+ (declare-function notmuch-show-strip-re "notmuch-show" (subject))\r
+ (declare-function notmuch-show-spaces-n "notmuch-show" (n))\r
+ (declare-function notmuch-read-query "notmuch" (prompt))\r
+-(declare-function notmuch-read-tag-changes "notmuch" (&optional initial-input &rest search-terms))\r
++(declare-function notmuch-read-tag-changes "notmuch" (current-tags &optional prompt initial-input))\r
+ (declare-function notmuch-update-tags "notmuch" (current-tags tag-changes))\r
+ (declare-function notmuch-hello-trim "notmuch-hello" (search))\r
+ (declare-function notmuch-search-find-thread-id "notmuch" ())\r
+@@ -372,21 +372,24 @@ Does NOT change the database."\r
+       (notmuch-pick-set-tags new-tags)\r
+       (notmuch-pick-refresh-result))))\r
\r
+-(defun notmuch-pick-tag (&optional tag-changes)\r
++(defun notmuch-pick-tag (tag-changes)\r
+   "Change tags for the current message"\r
+-  (interactive)\r
+-  (setq tag-changes (notmuch-tag (notmuch-pick-get-message-id) tag-changes))\r
++  (interactive\r
++   (list (notmuch-read-tag-changes (notmuch-pick-get-tags) "Tag message")))\r
++  (notmuch-tag (notmuch-pick-get-message-id) tag-changes)\r
+   (notmuch-pick-tag-update-display tag-changes))\r
\r
+-(defun notmuch-pick-add-tag ()\r
++(defun notmuch-pick-add-tag (tag-changes)\r
+   "Same as `notmuch-pick-tag' but sets initial input to '+'."\r
+-  (interactive)\r
+-  (notmuch-pick-tag "+"))\r
++  (interactive\r
++   (list (notmuch-read-tag-changes (notmuch-pick-get-tags) "Tag message" "+")))\r
++  (notmuch-pick-tag tag-changes))\r
\r
+-(defun notmuch-pick-remove-tag ()\r
++(defun notmuch-pick-remove-tag (tag-changes)\r
+   "Same as `notmuch-pick-tag' but sets initial input to '-'."\r
+-  (interactive)\r
+-  (notmuch-pick-tag "-"))\r
++  (interactive\r
++   (list (notmuch-read-tag-changes (notmuch-pick-get-tags) "Tag message" "-")))\r
++  (notmuch-pick-tag tag-changes))\r
\r
+ ;; The next two functions close the message window before searching or\r
+ ;; picking but they do so after the user has entered the query (in\r
+@@ -626,13 +629,16 @@ message will be \"unarchived\", i.e. the tag changes in\r
+            (notmuch-pick-thread-mapcar 'notmuch-pick-get-message-id)\r
+            " or "))\r
\r
+-(defun notmuch-pick-tag-thread (&optional tag-changes)\r
++(defun notmuch-pick-tag-thread (tag-changes)\r
+   "Tag all messages in the current thread"\r
+-  (interactive)\r
++  (interactive\r
++   (let ((tags (apply #'append (notmuch-pick-thread-mapcar\r
++                              (lambda () (notmuch-pick-get-tags))))))\r
++     (list (notmuch-read-tag-changes tags "Tag thread"))))\r
+   (when (notmuch-pick-get-message-properties)\r
+-    (let ((tag-changes (notmuch-tag (notmuch-pick-get-messages-ids-thread-search) tag-changes)))\r
+-      (notmuch-pick-thread-mapcar\r
+-       (lambda () (notmuch-pick-tag-update-display tag-changes))))))\r
++    (notmuch-tag (notmuch-pick-get-messages-ids-thread-search) tag-changes)\r
++    (notmuch-pick-thread-mapcar\r
++     (lambda () (notmuch-pick-tag-update-display tag-changes)))))\r
\r
+ (defun notmuch-pick-archive-thread (&optional unarchive)\r
+   "Archive each message in thread.\r
+-- \r
+1.8.4.rc3\r
+\r