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 B5F3C429E2F for ; Tue, 22 Oct 2013 12:51:42 -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 ZprCSvwsIaYP for ; Tue, 22 Oct 2013 12:51:37 -0700 (PDT) Received: from dmz-mailsec-scanner-4.mit.edu (dmz-mailsec-scanner-4.mit.edu [18.9.25.15]) by olra.theworths.org (Postfix) with ESMTP id 7264F429E30 for ; Tue, 22 Oct 2013 12:51:15 -0700 (PDT) X-AuditID: 1209190f-b7fa08e0000009c6-28-5266d732aae7 Received: from mailhub-auth-1.mit.edu ( [18.9.21.35]) by dmz-mailsec-scanner-4.mit.edu (Symantec Messaging Gateway) with SMTP id C3.16.02502.237D6625; Tue, 22 Oct 2013 15:51:15 -0400 (EDT) Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id r9MJp3lR015066; Tue, 22 Oct 2013 15:51:04 -0400 Received: from drake.dyndns.org (31-33-57.wireless.csail.mit.edu [128.31.33.57]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id r9MJp11l005202 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Tue, 22 Oct 2013 15:51:03 -0400 Received: from amthrax by drake.dyndns.org with local (Exim 4.77) (envelope-from ) id 1VYhyn-0006ys-5X; Tue, 22 Oct 2013 15:51:01 -0400 From: Austin Clements To: notmuch@notmuchmail.org Subject: [PATCH 7/8] pick: Use interactive specifications for tag changes Date: Tue, 22 Oct 2013 15:50:56 -0400 Message-Id: <1382471457-26056-8-git-send-email-amdragon@mit.edu> X-Mailer: git-send-email 1.8.4.rc3 In-Reply-To: <1382471457-26056-1-git-send-email-amdragon@mit.edu> References: <1382471457-26056-1-git-send-email-amdragon@mit.edu> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrEIsWRmVeSWpSXmKPExsUixCmqrGt8PS3I4NkNRovrN2cyOzB6PFt1 izmAMYrLJiU1J7MstUjfLoErY2PHAuaCS1IVX1buYm1gfCTWxcjJISFgIvH72Gk2CFtM4sK9 9UA2F4eQwD5GiXdfTjFDOBsZJX70vIJyjjFJXH3WAeXMZZSY8ukhM0g/m4CGxLb9yxlBbBEB aYmdd2ezdjFycDALqEn86VIBCQsLeEq0/T7GAmKzCKhKHO48DFbOK+Ag8X3fUmaIM5QkFp7a xgpicwo4Skzf948NZIwQUM2pOxwTGPkXMDKsYpRNya3SzU3MzClOTdYtTk7My0st0jXRy80s 0UtNKd3ECA4aSf4djN8OKh1iFOBgVOLhfdCSFiTEmlhWXJl7iFGSg0lJlDfiKlCILyk/pTIj sTgjvqg0J7X4EKMEB7OSCG+zL1CONyWxsiq1KB8mJc3BoiTOe5PDPkhIID2xJDU7NbUgtQgm K8PBoSTBG3gNqFGwKDU9tSItM6cEIc3EwQkynAdo+DGQxbzFBYm5xZnpEPlTjIpS4rwRIM0C IImM0jy4XlhUv2IUB3pFmLcKpIoHmBDgul8BDWYCGjxlCdjgkkSElFQDY6fS1l97zhSLH6ma ++J67b1rMV+7WNSmcDbafTt2WXu+xLSDvQkfrb0YUm/cPtuqNeGyuMpPv4cbE5LVRHmOpWuu UokIZC1+mzX15cvQGTecVrvoH1zadbc8yTYqSLFY2MN2eeVFT7V9fWm/377hWWRq9riJUc/g 3ppvl4MYcnp613h761emKbEUZyQaajEXFScCAKNpzxXFAgAA 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: Tue, 22 Oct 2013 19:51:43 -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