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 033D1431FBC for ; Thu, 26 Nov 2009 13:36:22 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org 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 FdsgtILhFJ0W for ; Thu, 26 Nov 2009 13:36:20 -0800 (PST) Received: from mail-bw0-f224.google.com (mail-bw0-f224.google.com [209.85.218.224]) by olra.theworths.org (Postfix) with ESMTP id 601A8431FC0 for ; Thu, 26 Nov 2009 13:36:20 -0800 (PST) Received: by mail-bw0-f224.google.com with SMTP id 24so847011bwz.30 for ; Thu, 26 Nov 2009 13:36:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:from:to:cc:subject :date:message-id:x-mailer:in-reply-to:references; bh=2dfJTdVQ551MKyhE7t2bemrqMl/vZY0CfvdVmcnvq34=; b=sL3t++975jLGFEt06oC9BXDrZcNXupkkLcDn3TLShbZShznZAqI0PylBA+t8k91fMU xZBTimvQA094e+RglmTZ3996+7GLhKSFTZBMuWNITYgN7KGF7w5sG6ymJRjesCpatIIu jpc5j9Ku+Oi+ZzAK37RrSbCC4ESAt/4zNZmbc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; b=jPxDvJXNNpqdyU8ZoQ6n0KDWWqWWqtPfyC8GoWGrmzWpfjJ1YcFHMIt3Tk//MJj28D /jG2hLOukChMYDqmaP8Ti5puDjP53mRcmImat3coCkAazPtGWzuojLxtWc/nT5VZB3CP 2Gf11ptYMHoaHMH6GoWQm1z8BRdOOy0x79OM4= Received: by 10.204.33.140 with SMTP id h12mr243127bkd.167.1259271380040; Thu, 26 Nov 2009 13:36:20 -0800 (PST) Received: from localhost.localdomain (vawpc43.ethz.ch [129.132.59.11]) by mx.google.com with ESMTPS id p9sm1421100fkb.14.2009.11.26.13.36.18 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 26 Nov 2009 13:36:19 -0800 (PST) Sender: Jed Brown From: Jed Brown To: cworth@cworth.org Date: Thu, 26 Nov 2009 22:36:50 +0100 Message-Id: <1259271410-15336-2-git-send-email-jed@59A2.org> X-Mailer: git-send-email 1.6.5.3 In-Reply-To: <1259271410-15336-1-git-send-email-jed@59A2.org> References: <87pr75q9va.fsf@yoom.home.cworth.org> <1259271410-15336-1-git-send-email-jed@59A2.org> Cc: notmuch@notmuchmail.org Subject: [notmuch] [PATCH 2/2] notmuch-search-add/remove-tag: restrict to messages in current query X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.12 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: Thu, 26 Nov 2009 21:36:22 -0000 Rather than tagging the everything in the thread. This is arguably more desirable behavior and is consistent with clearly desirably behavior of notmuch-search-operate-all. Note that this change applies indirectly to notmuch-search-archive-thread (which is actually equivalent behavior since this function is primarily used when browsing an inbox). Signed-off-by: Jed Brown --- notmuch.el | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/notmuch.el b/notmuch.el index 6adac9e..e9786c0 100644 --- a/notmuch.el +++ b/notmuch.el @@ -935,15 +935,19 @@ and will also appear in a buffer named \"*Notmuch errors*\"." (split-string (buffer-substring beg end)))))) (defun notmuch-search-add-tag (tag) + "Add a tag to messages in the current thread matching the +active query." (interactive (list (notmuch-select-tag-with-completion "Tag to add: "))) - (notmuch-call-notmuch-process "tag" (concat "+" tag) (notmuch-search-find-thread-id)) + (notmuch-call-notmuch-process "tag" (concat "+" tag) (notmuch-search-find-thread-id) " and " notmuch-search-query-string) (notmuch-search-set-tags (delete-dups (sort (cons tag (notmuch-search-get-tags)) 'string<)))) (defun notmuch-search-remove-tag (tag) + "Remove a tag from messages in the current thread matching the +active query." (interactive (list (notmuch-select-tag-with-completion "Tag to remove: " (notmuch-search-find-thread-id)))) - (notmuch-call-notmuch-process "tag" (concat "-" tag) (notmuch-search-find-thread-id)) + (notmuch-call-notmuch-process "tag" (concat "-" tag) (notmuch-search-find-thread-id) " and " notmuch-search-query-string) (notmuch-search-set-tags (delete tag (notmuch-search-get-tags)))) (defun notmuch-search-archive-thread () -- 1.6.5.3