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