From: Austin Clements Date: Tue, 22 Oct 2013 19:50:57 +0000 (+2000) Subject: [PATCH 8/8] emacs: Remove interactive behavior of `notmuch-tag' X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4500117da226cdf62c6c88e97ec59a50d06c8807;p=notmuch-archives.git [PATCH 8/8] emacs: Remove interactive behavior of `notmuch-tag' --- diff --git a/84/d1be446fd816530ac3568fd9aa6e0df35da0e9 b/84/d1be446fd816530ac3568fd9aa6e0df35da0e9 new file mode 100644 index 000000000..c69b3ee15 --- /dev/null +++ b/84/d1be446fd816530ac3568fd9aa6e0df35da0e9 @@ -0,0 +1,128 @@ +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 5EE4D431FD7 + for ; Tue, 22 Oct 2013 12:51:44 -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 VRtnyINUNm3z for ; + Tue, 22 Oct 2013 12:51:39 -0700 (PDT) +Received: from dmz-mailsec-scanner-8.mit.edu (dmz-mailsec-scanner-8.mit.edu + [18.7.68.37]) + by olra.theworths.org (Postfix) with ESMTP id A16C1429E31 + for ; Tue, 22 Oct 2013 12:51:15 -0700 (PDT) +X-AuditID: 12074425-b7f1c8e0000009c7-b7-5266d7337377 +Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) + by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP + id 72.C5.02503.337D6625; 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-2.mit.edu (8.13.8/8.9.2) with ESMTP id r9MJp3Y9016701; + 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 r9MJp1Oo005204 + (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-0006yv-6t; Tue, 22 Oct 2013 15:51:01 -0400 +From: Austin Clements +To: notmuch@notmuchmail.org +Subject: [PATCH 8/8] emacs: Remove interactive behavior of `notmuch-tag' +Date: Tue, 22 Oct 2013 15:50:57 -0400 +Message-Id: <1382471457-26056-9-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+NgFtrIIsWRmVeSWpSXmKPExsUixG6nomt8PS3I4MRaQYvrN2cyOzB6PFt1 + izmAMYrLJiU1J7MstUjfLoErY8OCX2wFp4QrPk94z9TA+J2/i5GTQ0LARGLl9DmMELaYxIV7 + 69m6GLk4hAT2MUrsnbCSGcLZyCixdc5iFgjnGJPEyScvmCCcuYwS27c/ZALpZxPQkNi2fznY + LBEBaYmdd2ezdjFycDALqEn86VIBCQsLeEise7eLBcRmEVCVuLpzNRNICa+Ag8SXSeoQVyhJ + LDy1jRXE5hRwlJi+7x8bSIkQUMmpOxwTGPkXMDKsYpRNya3SzU3MzClOTdYtTk7My0st0rXQ + y80s0UtNKd3ECA4ZF9UdjBMOKR1iFOBgVOLhfdCSFiTEmlhWXJl7iFGSg0lJlDfiKlCILyk/ + pTIjsTgjvqg0J7X4EKMEB7OSCG+zL1CONyWxsiq1KB8mJc3BoiTOe4vDPkhIID2xJDU7NbUg + tQgmK8PBoSTBK3QNqFGwKDU9tSItM6cEIc3EwQkynAdo+DGQxbzFBYm5xZnpEPlTjIpS4rzC + IM0CIImM0jy4XlhMv2IUB3pFmJcTpIoHmA7gul8BDWYCGjxlCdjgkkSElFQD48JK1dTt0umc + wjVH98TPenfELfxFstWbl9O6zaPCRL3amnawR049VTX7u2TlmkXbbgUHrNxlaC+Tfdy7/+SB + xc4c3+bN11IxT7T9kJz472bxrbXp/ws3iGhHxLv3SO4sNtuQzlL5dfpXF+3XM17ffrpNJ1fh + lebhtfVWcb9/bf8Q/eR6+wprDyWW4oxEQy3mouJEAL+V/XrEAgAA +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:44 -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 f9c1740..feee17c 100644 +--- a/emacs/notmuch-tag.el ++++ b/emacs/notmuch-tag.el +@@ -249,27 +249,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'"))) +@@ -278,9 +269,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 +