From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id C5F7A429E47 for ; Sun, 10 Jul 2011 08:56:47 -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 DzL1RCt2MhbP for ; Sun, 10 Jul 2011 08:56:46 -0700 (PDT) Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id A37AC429E4A for ; Sun, 10 Jul 2011 08:56:41 -0700 (PDT) Received: by mail-ww0-f45.google.com with SMTP id 40so1521868wwj.2 for ; Sun, 10 Jul 2011 08:56:41 -0700 (PDT) Received: by 10.216.59.16 with SMTP id r16mr3472795wec.25.1310313401316; Sun, 10 Jul 2011 08:56:41 -0700 (PDT) Received: from localhost ([109.131.150.231]) by mx.google.com with ESMTPS id z83sm3515775weq.44.2011.07.10.08.56.39 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 10 Jul 2011 08:56:40 -0700 (PDT) From: Pieter Praet To: Notmuch Mail Subject: [PATCH 6/6] emacs: make `notmuch-search-operate-all' operate on threads, not messages Date: Sun, 10 Jul 2011 17:55:35 +0200 Message-Id: <1310313335-4159-7-git-send-email-pieter@praet.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1310313335-4159-1-git-send-email-pieter@praet.org> References: <1310313335-4159-1-git-send-email-pieter@praet.org> 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: Sun, 10 Jul 2011 15:56:48 -0000 In order to be consistent with `notmuch-search-{add,remove}-tag' ("+"/"-"), `notmuch-search-operate-all' ("*") should operate on matching threads instead of matching messages. Signed-off-by: Pieter Praet --- emacs/notmuch.el | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index f11ec24..07899b7 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -834,9 +834,9 @@ non-authors is found, assume that all of the authors match." (delete-process proc)))) (defun notmuch-search-operate-all (action) - "Add/remove tags from all matching messages. + "Add/remove tags from all matching threads. -This command adds or removes tags from all messages matching the +This command adds or removes tags from all threads matching the current search terms. When called interactively, this command will prompt for tags to be added or removed. Tags prefixed with '+' will be added and tags prefixed with '-' will be removed. @@ -845,7 +845,10 @@ Each character of the tag name may consist of alphanumeric characters as well as `_.+-'. " (interactive "sOperation (+add -drop): notmuch tag ") - (let ((action-split (split-string action " +"))) + (let ((action-split (split-string action " +")) + (threads (mapconcat 'identity + (notmuch-search-find-thread-id-region (point-min) (- (point-max) 2)) + " or "))) ;; Perform some validation (let ((words action-split)) (when (null words) (error "No operation given")) @@ -853,7 +856,7 @@ characters as well as `_.+-'. (unless (string-match-p "^[-+][-+_.[:word:]]+$" (car words)) (error "Action must be of the form `+thistag -that_tag'")) (setq words (cdr words)))) - (apply 'notmuch-tag notmuch-search-query-string action-split))) + (apply 'notmuch-tag threads action-split))) (defun notmuch-search-buffer-title (query) "Returns the title for a buffer with notmuch search results." -- 1.7.5.4