[PATCH v2 8/8] emacs: Remove interactive behavior of `notmuch-tag'
authorAustin Clements <amdragon@MIT.EDU>
Wed, 23 Oct 2013 00:22:01 +0000 (20:22 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:57:33 +0000 (09:57 -0800)
f4/1924447f036bd6c88c16746e3b89ae6dedadd0 [new file with mode: 0644]

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