Re: Hi all
[notmuch-archives.git] / b6 / e00d03578cd8b4ca3fee326279706800d0bd12
1 Return-Path: <jani@nikula.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 5ACAD431FB6\r
6         for <notmuch@notmuchmail.org>; Mon,  3 Sep 2012 05:08:28 -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 i-Qv6Zy1jVjY for <notmuch@notmuchmail.org>;\r
16         Mon,  3 Sep 2012 05:08:26 -0700 (PDT)\r
17 Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com\r
18         [209.85.220.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id D23AC431FAF\r
21         for <notmuch@notmuchmail.org>; Mon,  3 Sep 2012 05:08:26 -0700 (PDT)\r
22 Received: by vcbfl17 with SMTP id fl17so5688446vcb.26\r
23         for <notmuch@notmuchmail.org>; Mon, 03 Sep 2012 05:08:25 -0700 (PDT)\r
24 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
25         d=google.com; s=20120113;\r
26         h=from:to:subject:in-reply-to:references:user-agent:date:message-id\r
27         :mime-version:content-type:content-transfer-encoding\r
28         :x-gm-message-state;\r
29         bh=dKFWG0l1aOTM0PVcxOOyDjsreyk1hwEw0+v0V0kys6g=;\r
30         b=OUabjQyzxTnXC8eREzIsAORVbDzHhLXeu9esYYvLbKi81VmIt6L5QbdzhPEtAXy6qA\r
31         JLGc4C8vcmdVPj1O3GD4oJOmcGxbmSU+v2OU3hnHqkuW4SUiDx4BYF/19cJfqavp5yGE\r
32         M7uPLfXZO15fepplyjMDOz9bUOkEuIQ1CkgEmY16R3FuHilWfYCLc+aSyWz9R8GwKv3G\r
33         bJ6/+p41piEqk9GfqlbSlZ2l6PTgjSfBfR5bTkXxw9+ry2m7qrbiAEj8FC1nhIAcEwgI\r
34         PveBidoZEFv0lJnKkc3/caY11RAAXX/8pycDrN0BrldFqseQTOpAmZJxMEFX+xoekpLM\r
35         oFzQ==\r
36 Received: by 10.52.73.167 with SMTP id m7mr5854093vdv.81.1346674105105;\r
37         Mon, 03 Sep 2012 05:08:25 -0700 (PDT)\r
38 Received: from localhost ([2001:4b98:dc0:43:216:3eff:fe1b:25f3])\r
39         by mx.google.com with ESMTPS id b3sm4562345vec.11.2012.09.03.05.08.24\r
40         (version=SSLv3 cipher=OTHER); Mon, 03 Sep 2012 05:08:24 -0700 (PDT)\r
41 From: Jani Nikula <jani@nikula.org>\r
42 To: Michal Nazarewicz <mina86@mina86.com>, notmuch@notmuchmail.org\r
43 Subject: Re: [PATCH 4/6] emacs: add support for custom tag changes on\r
44         message/thread archive\r
45 In-Reply-To: <xa1tfw6zwd0z.fsf@mina86.com>\r
46 References: <cover.1346614915.git.jani@nikula.org>\r
47         <0907a84d74600df18b8663c28c26f9f7bc2f31c2.1346614915.git.jani@nikula.org>\r
48         <xa1tfw6zwd0z.fsf@mina86.com>\r
49 User-Agent: Notmuch/0.14+42~g397e223 (http://notmuchmail.org) Emacs/23.2.1\r
50         (x86_64-pc-linux-gnu)\r
51 Date: Mon, 03 Sep 2012 14:08:17 +0200\r
52 Message-ID: <87r4qj8g26.fsf@nikula.org>\r
53 MIME-Version: 1.0\r
54 Content-Type: text/plain; charset=utf-8\r
55 Content-Transfer-Encoding: quoted-printable\r
56 X-Gm-Message-State:\r
57  ALoCoQmuwidB2k0rsrSIObw/wg1XXP793vpxQKNBprHIXyvLkxUs+I0QkswYOKBteiRNNuzYzIMd\r
58 X-BeenThere: notmuch@notmuchmail.org\r
59 X-Mailman-Version: 2.1.13\r
60 Precedence: list\r
61 List-Id: "Use and development of the notmuch mail system."\r
62         <notmuch.notmuchmail.org>\r
63 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
64         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
65 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
66 List-Post: <mailto:notmuch@notmuchmail.org>\r
67 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
68 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
69         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
70 X-List-Received-Date: Mon, 03 Sep 2012 12:08:28 -0000\r
71 \r
72 On Mon, 03 Sep 2012, Michal Nazarewicz <mina86@mina86.com> wrote:\r
73 > Jani Nikula <jani@nikula.org> writes:\r
74 >> Add support for customization of the tag changes that are applied when\r
75 >> a message or a thread is archived. Instead of hard-coded removal of\r
76 >> the "inbox" tag, the user can now specify a list of tag changes to\r
77 >> perform.\r
78 >\r
79 >> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
80 >> index ce5ea6f..e701aec 100644\r
81 >> --- a/emacs/notmuch-show.el\r
82 >> +++ b/emacs/notmuch-show.el\r
83 >> @@ -1748,18 +1748,20 @@ argument, hide all of the messages."\r
84 >>  (defun notmuch-show-archive-thread (&optional unarchive)\r
85 >>    "Archive each message in thread.\r
86 >>=20=20\r
87 >> -Archive each message currently shown by removing the \"inbox\"\r
88 >> -tag from each.  If a prefix argument is given, the messages will\r
89 >> -be \"unarchived\" (ie. the \"inbox\" tag will be added instead of\r
90 >> -removed).\r
91 >> +Archive each message currently shown by applying the tag changes\r
92 >> +in `notmuch-archive-tags' to each (remove the \"inbox\" tag by\r
93 >> +default). If a prefix argument is given, the messages will be\r
94 >> +\"unarchived\", i.e. the tag changes in `notmuch-archive-tags'\r
95 >> +will be reversed.\r
96 >>=20=20\r
97 >>  Note: This command is safe from any race condition of new messages\r
98 >>  being delivered to the same thread. It does not archive the\r
99 >>  entire thread, but only the messages shown in the current\r
100 >>  buffer."\r
101 >>    (interactive "P")\r
102 >> -  (let ((op (if unarchive "+" "-")))\r
103 >> -    (notmuch-show-tag-all (concat op "inbox"))))\r
104 >> +  (when notmuch-archive-tags\r
105 >\r
106 > Strictly speaking (when) should not be needed here (an in the following\r
107 > changes).  Or is it?\r
108 \r
109 I noticed it was needed in some places, so decided to slam it in all\r
110 places for similarity. No harm in that, IMO.\r
111 \r
112 Thanks for the review.\r
113 \r
114 Jani.\r
115 \r
116 \r
117 >\r
118 >> +    (notmuch-show-tag-all\r
119 >> +     (notmuch-tag-change-list notmuch-archive-tags unarchive))))\r
120 >>=20=20\r
121 >>  (defun notmuch-show-archive-thread-then-next ()\r
122 >>    "Archive all messages in the current buffer, then show next thread fr=\r
123 om search."\r
124 >> @@ -1774,14 +1776,17 @@ buffer."\r
125 >>    (notmuch-show-next-thread))\r
126 >>=20=20\r
127 >>  (defun notmuch-show-archive-message (&optional unarchive)\r
128 >> -  "Archive the current message (remove \"inbox\" tag).\r
129 >> +  "Archive the current message.\r
130 >>=20=20\r
131 >> -If a prefix argument is given, the message will be\r
132 >> -\"unarchived\" (ie. the \"inbox\" tag will be added instead of\r
133 >> -removed)."\r
134 >> +Archive the current message by applying the tag changes in\r
135 >> +`notmuch-archive-tags' to it (remove the \"inbox\" tag by\r
136 >> +default). If a prefix argument is given, the message will be\r
137 >> +\"unarchived\", i.e. the tag changes in `notmuch-archive-tags'\r
138 >> +will be reversed."\r
139 >>    (interactive "P")\r
140 >> -  (let ((op (if unarchive "+" "-")))\r
141 >> -    (notmuch-show-tag-message (concat op "inbox"))))\r
142 >> +  (when notmuch-archive-tags\r
143 >> +    (apply 'notmuch-show-tag-message\r
144 >> +       (notmuch-tag-change-list notmuch-archive-tags unarchive))))\r
145 >>=20=20\r
146 >>  (defun notmuch-show-archive-message-then-next-or-exit ()\r
147 >>    "Archive the current message, then show the next open message in the =\r
148 current thread.\r
149 >> diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
150 >> index 1c43d3e..64caa3e 100644\r
151 >> --- a/emacs/notmuch.el\r
152 >> +++ b/emacs/notmuch.el\r
153 >> @@ -594,11 +594,19 @@ See `notmuch-tag' for information on the format of=\r
154  TAG-CHANGES."\r
155 >>    (notmuch-search-tag "-"))\r
156 >>=20=20\r
157 >>  (defun notmuch-search-archive-thread ()\r
158 >> -  "Archive the currently selected thread (remove its \"inbox\" tag).\r
159 >> +  "Archive the currently selected thread.\r
160 >> +\r
161 >> +Archive each message in the currently selected thread by applying\r
162 >> +the tag changes in `notmuch-archive-tags' to each (remove the\r
163 >> +\"inbox\" tag by default). If a prefix argument is given, the\r
164 >> +messages will be \"unarchived\" (i.e. the tag changes in\r
165 >> +`notmuch-archive-tags' will be reversed).\r
166 >>=20=20\r
167 >>  This function advances the next thread when finished."\r
168 >>    (interactive)\r
169 >> -  (notmuch-search-tag '("-inbox"))\r
170 >> +  (when notmuch-archive-tags\r
171 >> +    (notmuch-search-tag\r
172 >> +     (notmuch-tag-change-list notmuch-archive-tags)))\r
173 >>    (notmuch-search-next-thread))\r
174 >>=20=20\r
175 >>  (defun notmuch-search-update-result (result &optional pos)\r
176 >> --=20\r
177 >> 1.7.9.5\r
178 >>\r
179 >\r
180 > --=20\r
181 > Best regards,                                         _     _\r
182 > .o. | Liege of Serenely Enlightened Majesty of      o' \,=3D./ `o\r
183 > ..o | Computer Science,  Micha=C5=82 =E2=80=9Cmina86=E2=80=9D Nazarewicz =\r
184    (o o)\r
185 > ooo +----<email/xmpp: mpn@google.com>--------------ooO--(_)--Ooo--\r