Re: [PATCH 0/4] Allow specifying alternate names for addresses in other_email
[notmuch-archives.git] / 44 / 9925da2b9337ba182bcd48465ff1d70ee409fa
1 Return-Path: <pieter@praet.org>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id C5F7A429E47\r
6         for <notmuch@notmuchmail.org>; Sun, 10 Jul 2011 08:56:47 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id DzL1RCt2MhbP for <notmuch@notmuchmail.org>;\r
16         Sun, 10 Jul 2011 08:56:46 -0700 (PDT)\r
17 Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com\r
18  [74.125.82.45])        (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
19  certificate requested) by olra.theworths.org (Postfix) with ESMTPS id\r
20  A37AC429E4A    for <notmuch@notmuchmail.org>; Sun, 10 Jul 2011 08:56:41 -0700\r
21  (PDT)\r
22 Received: by mail-ww0-f45.google.com with SMTP id 40so1521868wwj.2\r
23         for <notmuch@notmuchmail.org>; Sun, 10 Jul 2011 08:56:41 -0700 (PDT)\r
24 Received: by 10.216.59.16 with SMTP id r16mr3472795wec.25.1310313401316;\r
25         Sun, 10 Jul 2011 08:56:41 -0700 (PDT)\r
26 Received: from localhost ([109.131.150.231])\r
27         by mx.google.com with ESMTPS id z83sm3515775weq.44.2011.07.10.08.56.39\r
28         (version=TLSv1/SSLv3 cipher=OTHER);\r
29         Sun, 10 Jul 2011 08:56:40 -0700 (PDT)\r
30 From: Pieter Praet <pieter@praet.org>\r
31 To: Notmuch Mail <notmuch@notmuchmail.org>\r
32 Subject: [PATCH 6/6] emacs: make `notmuch-search-operate-all' operate on\r
33         threads, not messages\r
34 Date: Sun, 10 Jul 2011 17:55:35 +0200\r
35 Message-Id: <1310313335-4159-7-git-send-email-pieter@praet.org>\r
36 X-Mailer: git-send-email 1.7.5.4\r
37 In-Reply-To: <1310313335-4159-1-git-send-email-pieter@praet.org>\r
38 References: <1310313335-4159-1-git-send-email-pieter@praet.org>\r
39 X-BeenThere: notmuch@notmuchmail.org\r
40 X-Mailman-Version: 2.1.13\r
41 Precedence: list\r
42 List-Id: "Use and development of the notmuch mail system."\r
43         <notmuch.notmuchmail.org>\r
44 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
45         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
46 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
47 List-Post: <mailto:notmuch@notmuchmail.org>\r
48 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
49 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
50         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
51 X-List-Received-Date: Sun, 10 Jul 2011 15:56:48 -0000\r
52 \r
53 In order to be consistent with `notmuch-search-{add,remove}-tag' ("+"/"-"),\r
54 `notmuch-search-operate-all' ("*") should operate on matching threads\r
55 instead of matching messages.\r
56 \r
57 Signed-off-by: Pieter Praet <pieter@praet.org>\r
58 ---\r
59  emacs/notmuch.el |   11 +++++++----\r
60  1 files changed, 7 insertions(+), 4 deletions(-)\r
61 \r
62 diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
63 index f11ec24..07899b7 100644\r
64 --- a/emacs/notmuch.el\r
65 +++ b/emacs/notmuch.el\r
66 @@ -834,9 +834,9 @@ non-authors is found, assume that all of the authors match."\r
67        (delete-process proc))))\r
68  \r
69  (defun notmuch-search-operate-all (action)\r
70 -  "Add/remove tags from all matching messages.\r
71 +  "Add/remove tags from all matching threads.\r
72  \r
73 -This command adds or removes tags from all messages matching the\r
74 +This command adds or removes tags from all threads matching the\r
75  current search terms. When called interactively, this command\r
76  will prompt for tags to be added or removed. Tags prefixed with\r
77  '+' will be added and tags prefixed with '-' will be removed.\r
78 @@ -845,7 +845,10 @@ Each character of the tag name may consist of alphanumeric\r
79  characters as well as `_.+-'.\r
80  "\r
81    (interactive "sOperation (+add -drop): notmuch tag ")\r
82 -  (let ((action-split (split-string action " +")))\r
83 +  (let ((action-split (split-string action " +"))\r
84 +        (threads (mapconcat 'identity\r
85 +                           (notmuch-search-find-thread-id-region (point-min) (- (point-max) 2))\r
86 +                           " or ")))\r
87      ;; Perform some validation\r
88      (let ((words action-split))\r
89        (when (null words) (error "No operation given"))\r
90 @@ -853,7 +856,7 @@ characters as well as `_.+-'.\r
91         (unless (string-match-p "^[-+][-+_.[:word:]]+$" (car words))\r
92           (error "Action must be of the form `+thistag -that_tag'"))\r
93         (setq words (cdr words))))\r
94 -    (apply 'notmuch-tag notmuch-search-query-string action-split)))\r
95 +    (apply 'notmuch-tag threads action-split)))\r
96  \r
97  (defun notmuch-search-buffer-title (query)\r
98    "Returns the title for a buffer with notmuch search results."\r
99 -- \r
100 1.7.5.4\r
101 \r