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 0816B429E2F for ; Tue, 22 Oct 2013 17:22:14 -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 PhBkr0J5+BeB for ; Tue, 22 Oct 2013 17:22:07 -0700 (PDT) Received: from dmz-mailsec-scanner-5.mit.edu (dmz-mailsec-scanner-5.mit.edu [18.7.68.34]) by olra.theworths.org (Postfix) with ESMTP id EAFF0431FAE for ; Tue, 22 Oct 2013 17:22:06 -0700 (PDT) X-AuditID: 12074422-b7f5a8e000000a34-04-526716aed97d Received: from mailhub-auth-4.mit.edu ( [18.7.62.39]) by dmz-mailsec-scanner-5.mit.edu (Symantec Messaging Gateway) with SMTP id BE.C5.02612.EA617625; Tue, 22 Oct 2013 20:22:06 -0400 (EDT) Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id r9N0M5fu017169; 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 r9N0M4cu005851 (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-0008KW-TP; Tue, 22 Oct 2013 20:22:03 -0400 From: Austin Clements To: notmuch@notmuchmail.org Subject: [PATCH v2 8/8] emacs: Remove interactive behavior of `notmuch-tag' Date: Tue, 22 Oct 2013 20:22:01 -0400 Message-Id: <1382487721-31776-9-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+NgFtrDIsWRmVeSWpSXmKPExsUixG6nrrtOLD3I4PYmUYvVc3ksrt+cyezA 5LFz1l12j2erbjEHMEVx2aSk5mSWpRbp2yVwZbRsWsBacEq44vX8HWwNjN/5uxg5OSQETCSe HJrNDmGLSVy4t56ti5GLQ0hgH6PE4hPzWCGcjYwSHYsvQGXuMElc+jyHCcKZyyhx/clCsH42 AQ2JbfuXM4LYIgLSEjvvzmYFsZkFHCU+718E1M3BISzgLfFjoxFImEVAVeLb5H4mEJtXwEHi e+McFogzlCQWntoG1soJ1Ppmxwc2EFsIqGbKzjMsExj5FzAyrGKUTcmt0s1NzMwpTk3WLU5O zMtLLdI11cvNLNFLTSndxAgOJBelHYw/DyodYhTgYFTi4X3QkhYkxJpYVlyZe4hRkoNJSZRX nT89SIgvKT+lMiOxOCO+qDQntfgQowQHs5IIb7MvUDlvSmJlVWpRPkxKmoNFSZz3Fod9kJBA emJJanZqakFqEUxWhoNDSYK3SxRoqGBRanpqRVpmTglCmomDE2Q4D9DwFSA1vMUFibnFmekQ +VOMilLivGdAEgIgiYzSPLheWKS/YhQHekUYop0HmCTgul8BDWYCGjxlCcjVxSWJCCmpBkbV 7Ve1q9MKduzk3q2TNjNiuXh0q3TUac/g1c4XWMqr7BclS8za9Pef/un4J90qXVF7xA6xGIvs nJFtXvq+nVuxTXdDnf5Enm+SNaYXG5+Ivlu/6+0mvZclNp5XjnRknT2Sfi7JSigzOH/pxAMv /vxiaw1bWfBKo+Rv/53CZDGWZv/da26svqbEUpyRaKjFXFScCAADcu0JzwIAAA== 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:14 -0000 We no longer use this, since we've lifted all interactive behavior to the appropriate interactive entry points. Because of this, `notmuch-tag' also no longer needs to return the tag changes list, since the caller always passes it in. --- emacs/notmuch-tag.el | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el index 3ad53b2..7b21006 100644 --- a/emacs/notmuch-tag.el +++ b/emacs/notmuch-tag.el @@ -252,27 +252,18 @@ from TAGS if present." (error "Changed tag must be of the form `+this_tag' or `-that_tag'"))))) (sort result-tags 'string<))) -(defun notmuch-tag (query &optional tag-changes) +(defun notmuch-tag (query tag-changes) "Add/remove tags in TAG-CHANGES to messages matching QUERY. QUERY should be a string containing the search-terms. -TAG-CHANGES can take multiple forms. If TAG-CHANGES is a list of -strings of the form \"+tag\" or \"-tag\" then those are the tag -changes applied. If TAG-CHANGES is a string then it is -interpreted as a single tag change. If TAG-CHANGES is the string -\"-\" or \"+\", or null, then the user is prompted to enter the -tag changes. +TAG-CHANGES is a list of strings of the form \"+tag\" or +\"-tag\" to add or remove tags, respectively. Note: Other code should always use this function alter tags of messages instead of running (notmuch-call-notmuch-process \"tag\" ..) directly, so that hooks specified in notmuch-before-tag-hook and notmuch-after-tag-hook will be run." ;; Perform some validation - (if (string-or-null-p tag-changes) - (if (or (string= tag-changes "-") (string= tag-changes "+") (null tag-changes)) - (setq tag-changes (notmuch-read-tag-changes - (notmuch-tag-completions query) nil tag-changes)) - (setq tag-changes (list tag-changes)))) (mapc (lambda (tag-change) (unless (string-match-p "^[-+]\\S-+$" tag-change) (error "Tag must be of the form `+this_tag' or `-that_tag'"))) @@ -281,9 +272,7 @@ notmuch-after-tag-hook will be run." (run-hooks 'notmuch-before-tag-hook) (apply 'notmuch-call-notmuch-process "tag" (append tag-changes (list "--" query))) - (run-hooks 'notmuch-after-tag-hook)) - ;; in all cases we return tag-changes as a list - tag-changes) + (run-hooks 'notmuch-after-tag-hook))) (defun notmuch-tag-change-list (tags &optional reverse) "Convert TAGS into a list of tag changes. -- 1.8.4.rc3