[PATCH] cli: add a tool for starting new message in the emacs ui
[notmuch-archives.git] / fe / 56192f215aac6376e787b144d138c440c1c2ce
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 B196B431FC2\r
6         for <notmuch@notmuchmail.org>; Fri, 14 Jun 2013 00:38:14 -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.201\r
10 X-Spam-Level: \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 9AaSlpLJvJbI for <notmuch@notmuchmail.org>;\r
18         Fri, 14 Jun 2013 00:38:08 -0700 (PDT)\r
19 Received: from mail-we0-f169.google.com (mail-we0-f169.google.com\r
20         [74.125.82.169]) (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 576AE429E34\r
23         for <notmuch@notmuchmail.org>; Fri, 14 Jun 2013 00:38:02 -0700 (PDT)\r
24 Received: by mail-we0-f169.google.com with SMTP id n57so187654wev.28\r
25         for <notmuch@notmuchmail.org>; Fri, 14 Jun 2013 00:38:01 -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:x-mailer:in-reply-to:references;\r
28         bh=H+Lbs7e68RvkF5r6GaJRbCVFdkPQWC+uk5cuUE90cD8=;\r
29         b=ywPZspvXAl1jrrr+K5Ywv4cdNRznzyrcIC0rOAGl2ClkCjpDYDKv+GiwimE0PM8GJy\r
30         lVdC4itmuF6BQ8JJT6PW9/LzfdyTEP8BbHh2yK4BEXT/1XSSPlMlw+4HdfSuq9AU1b/e\r
31         sfRtUkKsj/VpDqlO6xA6ktaJuWe2C3NCs2ONcfA2t3BYWGH1t/Wgavo3hElGwjvezIoI\r
32         4MKjMYpEMQzkdSYFdLB/1iU0d3qT74Ne4TuUBLzDwtEM6vY7ply9mRYkBz1tbRpUAEFX\r
33         y+7pRSE9kOPadn/1oq2dFbwjNvbUXRQbuLm33egU9hu0F+f7y3vsdJKlMI6lDs2DCsY1\r
34         Gt/w==\r
35 X-Received: by 10.180.185.225 with SMTP id ff1mr569546wic.36.1371195481032;\r
36         Fri, 14 Jun 2013 00:38:01 -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 dz8sm1160353wib.11.2013.06.14.00.37.59\r
39         for <multiple recipients>\r
40         (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
41         Fri, 14 Jun 2013 00:38:00 -0700 (PDT)\r
42 From: Mark Walters <markwalters1009@gmail.com>\r
43 To: notmuch@notmuchmail.org\r
44 Subject: [PATCH v3 2/2] contrib: pick: thread tagging (including archiving)\r
45         implemented\r
46 Date: Fri, 14 Jun 2013 08:37:52 +0100\r
47 Message-Id: <1371195472-441-3-git-send-email-markwalters1009@gmail.com>\r
48 X-Mailer: git-send-email 1.7.9.1\r
49 In-Reply-To: <1371195472-441-1-git-send-email-markwalters1009@gmail.com>\r
50 References: <1371195472-441-1-git-send-email-markwalters1009@gmail.com>\r
51 X-BeenThere: notmuch@notmuchmail.org\r
52 X-Mailman-Version: 2.1.13\r
53 Precedence: list\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: Fri, 14 Jun 2013 07:38:15 -0000\r
64 \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
69 ---\r
70  contrib/notmuch-pick/notmuch-pick.el |   27 +++++++++++++++++++++++++++\r
71  1 files changed, 27 insertions(+), 0 deletions(-)\r
72 \r
73 diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el\r
74 index af117ba..eeb86d9 100644\r
75 --- a/contrib/notmuch-pick/notmuch-pick.el\r
76 +++ b/contrib/notmuch-pick/notmuch-pick.el\r
77 @@ -179,6 +179,7 @@\r
78      (define-key map "q" 'notmuch-pick-quit)\r
79      (define-key map "x" 'notmuch-pick-quit)\r
80      (define-key map "?" 'notmuch-help)\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 @@ -194,6 +195,7 @@\r
86      (define-key map "|" 'notmuch-pick-pipe-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
92      map))\r
93 @@ -604,6 +606,31 @@ than only the current message."\r
94              (notmuch-pick-thread-mapcar 'notmuch-pick-get-message-id)\r
95              " or "))\r
96  \r
97 +(defun notmuch-pick-tag-thread (&optional tag-changes)\r
98 +  "Tag all messages in the current thread"\r
99 +  (interactive)\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
104 +\r
105 +(defun notmuch-pick-archive-thread (&optional unarchive)\r
106 +  "Archive each message in thread.\r
107 +\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
112 +\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
116 +buffer."\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
121 +\r
122  ;; Functions below here display the pick buffer itself.\r
123  \r
124  (defun notmuch-pick-clean-address (address)\r
125 -- \r
126 1.7.9.1\r
127 \r