1 Return-Path: <markwalters1009@gmail.com>
\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 24ECB431FCF
\r
6 for <notmuch@notmuchmail.org>; Mon, 26 Aug 2013 10:31:27 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0.201 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,
\r
14 RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
15 Received: from olra.theworths.org ([127.0.0.1])
\r
16 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
17 with ESMTP id XN8UU7-f+CDG for <notmuch@notmuchmail.org>;
\r
18 Mon, 26 Aug 2013 10:31:20 -0700 (PDT)
\r
19 Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com
\r
20 [209.85.212.174]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
21 (No client certificate requested)
\r
22 by olra.theworths.org (Postfix) with ESMTPS id 64C2B431FC0
\r
23 for <notmuch@notmuchmail.org>; Mon, 26 Aug 2013 10:31:20 -0700 (PDT)
\r
24 Received: by mail-wi0-f174.google.com with SMTP id c10so212587wiw.1
\r
25 for <notmuch@notmuchmail.org>; Mon, 26 Aug 2013 10:31:16 -0700 (PDT)
\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
\r
27 h=from:to:cc:subject:date:message-id:in-reply-to:references;
\r
28 bh=1d5wWWKtE1EVmQNMYg9pd8E+3Vr4SPW27C9Sf6CqwjM=;
\r
29 b=eZP1JkQgDptFQuiGYbsRXoiaTkHktMS93WpUERkmWJR2g4pcl0v+vxZMcSc56j9e7h
\r
30 ja1WY9QqESAHjy1ipPb+cfCFM+QgubEB3p8S/55GWdPz/SEgKN06GTdrISKi895qOX5y
\r
31 6MaCk3KXRxhksWCiwRBdLA94QSFWRIQFJap4XlrbgGFzh/Fl+/rV5+n5bLchzXOFvtzL
\r
32 WmpmNpLW0xGag0ADo9SfgcmY/OjZTqVBG37AK1a23ynQmCd1vZZ7CLDsYQRHyzQKXa7s
\r
33 awAn2IP7oezOcuiS2fV0JMOTsk7f5h+Tv2+AZ0pJe5/aWIKmNcylUIJB9yc5I0eSXhOn
\r
35 X-Received: by 10.180.92.98 with SMTP id cl2mr5088497wib.15.1377460545324;
\r
36 Sun, 25 Aug 2013 12:55:45 -0700 (PDT)
\r
37 Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])
\r
38 by mx.google.com with ESMTPSA id
\r
39 jc18sm13278986wic.5.1969.12.31.16.00.00
\r
40 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
\r
41 Sun, 25 Aug 2013 12:55:44 -0700 (PDT)
\r
42 From: Mark Walters <markwalters1009@gmail.com>
\r
43 To: notmuch@notmuchmail.org
\r
44 Subject: [Patch v4 2/3] contrib: pick: thread tagging (including archiving)
\r
46 Date: Sun, 25 Aug 2013 20:55:33 +0100
\r
47 Message-Id: <1377460534-6022-3-git-send-email-markwalters1009@gmail.com>
\r
48 X-Mailer: git-send-email 1.7.9.1
\r
49 In-Reply-To: <1377460534-6022-1-git-send-email-markwalters1009@gmail.com>
\r
50 References: <1377460534-6022-1-git-send-email-markwalters1009@gmail.com>
\r
51 X-BeenThere: notmuch@notmuchmail.org
\r
52 X-Mailman-Version: 2.1.13
\r
54 List-Id: "Use and development of the notmuch mail system."
\r
55 <notmuch.notmuchmail.org>
\r
56 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
57 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
58 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
59 List-Post: <mailto:notmuch@notmuchmail.org>
\r
60 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
61 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
62 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
63 X-List-Received-Date: Mon, 26 Aug 2013 17:31:27 -0000
\r
65 Previously pick had no actions based on the entire thread: this adds
\r
66 some. Note in this version '*' is bound to `tag thread' which is not
\r
67 consistent with search or show. However it still might be the most
\r
68 natural thing (as it is similar to running * in the show pane).
\r
70 contrib/notmuch-pick/notmuch-pick.el | 27 +++++++++++++++++++++++++++
\r
71 1 files changed, 27 insertions(+), 0 deletions(-)
\r
73 diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el
\r
74 index fea118f..258cfc3 100644
\r
75 --- a/contrib/notmuch-pick/notmuch-pick.el
\r
76 +++ b/contrib/notmuch-pick/notmuch-pick.el
\r
77 @@ -246,6 +246,7 @@ FUNC."
\r
78 ;; The main pick bindings
\r
79 (define-key map "q" 'notmuch-pick-quit)
\r
80 (define-key map "x" 'notmuch-pick-quit)
\r
81 + (define-key map "A" 'notmuch-pick-archive-thread)
\r
82 (define-key map "a" 'notmuch-pick-archive-message-then-next)
\r
83 (define-key map "=" 'notmuch-pick-refresh-view)
\r
84 (define-key map "s" 'notmuch-pick-to-search)
\r
85 @@ -256,6 +257,7 @@ FUNC."
\r
86 (define-key map "P" 'notmuch-pick-prev-message)
\r
87 (define-key map "-" 'notmuch-pick-remove-tag)
\r
88 (define-key map "+" 'notmuch-pick-add-tag)
\r
89 + (define-key map "*" 'notmuch-pick-tag-thread)
\r
90 (define-key map " " 'notmuch-pick-scroll-or-next)
\r
91 (define-key map "b" 'notmuch-pick-scroll-message-window-back)
\r
93 @@ -620,6 +622,31 @@ message will be \"unarchived\", i.e. the tag changes in
\r
94 (notmuch-pick-thread-mapcar 'notmuch-pick-get-message-id)
\r
97 +(defun notmuch-pick-tag-thread (&optional tag-changes)
\r
98 + "Tag all messages in the current thread"
\r
100 + (when (notmuch-pick-get-message-properties)
\r
101 + (let ((tag-changes (notmuch-tag (notmuch-pick-get-messages-ids-thread-search) tag-changes)))
\r
102 + (notmuch-pick-thread-mapcar
\r
103 + (lambda () (notmuch-pick-tag-update-display tag-changes))))))
\r
105 +(defun notmuch-pick-archive-thread (&optional unarchive)
\r
106 + "Archive each message in thread.
\r
108 +Archive each message currently shown by applying the tag changes
\r
109 +in `notmuch-archive-tags' to each. If a prefix argument is given,
\r
110 +the messages will be \"unarchived\", i.e. the tag changes in
\r
111 +`notmuch-archive-tags' will be reversed.
\r
113 +Note: This command is safe from any race condition of new messages
\r
114 +being delivered to the same thread. It does not archive the
\r
115 +entire thread, but only the messages shown in the current
\r
117 + (interactive "P")
\r
118 + (when notmuch-archive-tags
\r
119 + (notmuch-pick-tag-thread
\r
120 + (notmuch-tag-change-list notmuch-archive-tags unarchive))))
\r
122 ;; Functions below here display the pick buffer itself.
\r
124 (defun notmuch-pick-clean-address (address)
\r