database error
[notmuch-archives.git] / d6 / 2514b60d301ba9d088fd30579d7e205d689763
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 D6104431FB6\r
6         for <notmuch@notmuchmail.org>; Sun,  2 Sep 2012 12:58:24 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
9 X-Spam-Flag: NO\r
10 X-Spam-Score: -0.7\r
11 X-Spam-Level: \r
12 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
13         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id n-NGdqxOU7Py for <notmuch@notmuchmail.org>;\r
17         Sun,  2 Sep 2012 12:58:22 -0700 (PDT)\r
18 Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com\r
19         [209.85.217.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 81F5D431FC2\r
22         for <notmuch@notmuchmail.org>; Sun,  2 Sep 2012 12:58:22 -0700 (PDT)\r
23 Received: by mail-lb0-f181.google.com with SMTP id gk1so2402453lbb.26\r
24         for <notmuch@notmuchmail.org>; Sun, 02 Sep 2012 12:58:22 -0700 (PDT)\r
25 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
26         d=google.com; s=20120113;\r
27         h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references\r
28         :in-reply-to:references:x-gm-message-state;\r
29         bh=KvsPlCuF3X1Mzei7UwbBUt4hBv7Iv6yroufjbejmM9Q=;\r
30         b=Ka5jiLe0O5HL1adLVZ1eBpPoTnA5y9WpXWZstnb3B971VaPOSTFrd3ORRvyUrhfKFn\r
31         fcIxBE1QY+7SbBnp8EfTFsBRwPifVoqY+cTnpfXFH2AnrmUrKqlT+qxVSBjUl1x65FEt\r
32         acGmPZVcP0yuP+BVTrmwALJ0/sBMcImJJ3xWO8PoeVvlKQxKvcd5/fR62xAnYHMI9lgs\r
33         M1xu7Yx2horVJdU+5P8pv7WKyUfmlbq0U2KFSViTK854zbU8qTix7xO12ETjkQ3nPKi4\r
34         06Ih06qpnQW8OSPytWn+hhQ2biR0mijJ8/9KT2mIONXM1ELDXv67dlCGZ/s6+OJ0q5rd\r
35         zjBA==\r
36 Received: by 10.152.131.68 with SMTP id ok4mr12081943lab.47.1346615902161;\r
37         Sun, 02 Sep 2012 12:58:22 -0700 (PDT)\r
38 Received: from localhost (dsl-hkibrasgw4-fe51df00-27.dhcp.inet.fi.\r
39         [80.223.81.27])\r
40         by mx.google.com with ESMTPS id ly17sm11378265lab.2.2012.09.02.12.58.20\r
41         (version=SSLv3 cipher=OTHER); Sun, 02 Sep 2012 12:58:21 -0700 (PDT)\r
42 From: Jani Nikula <jani@nikula.org>\r
43 To: notmuch@notmuchmail.org\r
44 Subject: [PATCH 4/6] emacs: add support for custom tag changes on\r
45         message/thread archive\r
46 Date: Sun,  2 Sep 2012 22:58:03 +0300\r
47 Message-Id:\r
48  <0907a84d74600df18b8663c28c26f9f7bc2f31c2.1346614915.git.jani@nikula.org>\r
49 X-Mailer: git-send-email 1.7.9.5\r
50 In-Reply-To: <cover.1346614915.git.jani@nikula.org>\r
51 References: <cover.1346614915.git.jani@nikula.org>\r
52 In-Reply-To: <cover.1346614915.git.jani@nikula.org>\r
53 References: <cover.1346614915.git.jani@nikula.org>\r
54 X-Gm-Message-State:\r
55  ALoCoQkjQv3B4VwBwpb5TliQ0kvPnQCFnWH1bGo2l8OYmZaCgsPoKnf98rQLXU1oGazXL47teNIe\r
56 X-BeenThere: notmuch@notmuchmail.org\r
57 X-Mailman-Version: 2.1.13\r
58 Precedence: list\r
59 List-Id: "Use and development of the notmuch mail system."\r
60         <notmuch.notmuchmail.org>\r
61 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
62         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
63 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
64 List-Post: <mailto:notmuch@notmuchmail.org>\r
65 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
66 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
67         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
68 X-List-Received-Date: Sun, 02 Sep 2012 19:58:25 -0000\r
69 \r
70 Add support for customization of the tag changes that are applied when\r
71 a message or a thread is archived. Instead of hard-coded removal of\r
72 the "inbox" tag, the user can now specify a list of tag changes to\r
73 perform.\r
74 ---\r
75  emacs/notmuch-lib.el  |   14 ++++++++++++++\r
76  emacs/notmuch-show.el |   29 +++++++++++++++++------------\r
77  emacs/notmuch.el      |   12 ++++++++++--\r
78  3 files changed, 41 insertions(+), 14 deletions(-)\r
79 \r
80 diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el\r
81 index 900235b..20d990d 100644\r
82 --- a/emacs/notmuch-lib.el\r
83 +++ b/emacs/notmuch-lib.el\r
84 @@ -82,6 +82,20 @@\r
85    :type '(alist :key-type string :value-type string)\r
86    :group 'notmuch-hello)\r
87  \r
88 +(defcustom notmuch-archive-tags '("-inbox")\r
89 +  "List of tag changes to apply to a message or a thread when it is archived.\r
90 +\r
91 +Tags starting with \"+\" (or not starting with either \"+\" or\r
92 +\"-\") in the list will be added, and tags starting with \"-\"\r
93 +will be removed from the message or thread being archived.\r
94 +\r
95 +For example, if you wanted to remove an \"inbox\" tag and add an\r
96 +\"archived\" tag, you would set:\r
97 +    (\"-inbox\" \"+archived\")"\r
98 +  :type '(repeat string)\r
99 +  :group 'notmuch-search\r
100 +  :group 'notmuch-show)\r
101 +\r
102  (defvar notmuch-folders nil\r
103    "Deprecated name for what is now known as `notmuch-saved-searches'.")\r
104  \r
105 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
106 index ce5ea6f..e701aec 100644\r
107 --- a/emacs/notmuch-show.el\r
108 +++ b/emacs/notmuch-show.el\r
109 @@ -1748,18 +1748,20 @@ argument, hide all of the messages."\r
110  (defun notmuch-show-archive-thread (&optional unarchive)\r
111    "Archive each message in thread.\r
112  \r
113 -Archive each message currently shown by removing the \"inbox\"\r
114 -tag from each.  If a prefix argument is given, the messages will\r
115 -be \"unarchived\" (ie. the \"inbox\" tag will be added instead of\r
116 -removed).\r
117 +Archive each message currently shown by applying the tag changes\r
118 +in `notmuch-archive-tags' to each (remove the \"inbox\" tag by\r
119 +default). If a prefix argument is given, the messages will be\r
120 +\"unarchived\", i.e. the tag changes in `notmuch-archive-tags'\r
121 +will be reversed.\r
122  \r
123  Note: This command is safe from any race condition of new messages\r
124  being delivered to the same thread. It does not archive the\r
125  entire thread, but only the messages shown in the current\r
126  buffer."\r
127    (interactive "P")\r
128 -  (let ((op (if unarchive "+" "-")))\r
129 -    (notmuch-show-tag-all (concat op "inbox"))))\r
130 +  (when notmuch-archive-tags\r
131 +    (notmuch-show-tag-all\r
132 +     (notmuch-tag-change-list notmuch-archive-tags unarchive))))\r
133  \r
134  (defun notmuch-show-archive-thread-then-next ()\r
135    "Archive all messages in the current buffer, then show next thread from search."\r
136 @@ -1774,14 +1776,17 @@ buffer."\r
137    (notmuch-show-next-thread))\r
138  \r
139  (defun notmuch-show-archive-message (&optional unarchive)\r
140 -  "Archive the current message (remove \"inbox\" tag).\r
141 +  "Archive the current message.\r
142  \r
143 -If a prefix argument is given, the message will be\r
144 -\"unarchived\" (ie. the \"inbox\" tag will be added instead of\r
145 -removed)."\r
146 +Archive the current message by applying the tag changes in\r
147 +`notmuch-archive-tags' to it (remove the \"inbox\" tag by\r
148 +default). If a prefix argument is given, the message will be\r
149 +\"unarchived\", i.e. the tag changes in `notmuch-archive-tags'\r
150 +will be reversed."\r
151    (interactive "P")\r
152 -  (let ((op (if unarchive "+" "-")))\r
153 -    (notmuch-show-tag-message (concat op "inbox"))))\r
154 +  (when notmuch-archive-tags\r
155 +    (apply 'notmuch-show-tag-message\r
156 +          (notmuch-tag-change-list notmuch-archive-tags unarchive))))\r
157  \r
158  (defun notmuch-show-archive-message-then-next-or-exit ()\r
159    "Archive the current message, then show the next open message in the current thread.\r
160 diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
161 index 1c43d3e..64caa3e 100644\r
162 --- a/emacs/notmuch.el\r
163 +++ b/emacs/notmuch.el\r
164 @@ -594,11 +594,19 @@ See `notmuch-tag' for information on the format of TAG-CHANGES."\r
165    (notmuch-search-tag "-"))\r
166  \r
167  (defun notmuch-search-archive-thread ()\r
168 -  "Archive the currently selected thread (remove its \"inbox\" tag).\r
169 +  "Archive the currently selected thread.\r
170 +\r
171 +Archive each message in the currently selected thread by applying\r
172 +the tag changes in `notmuch-archive-tags' to each (remove the\r
173 +\"inbox\" tag by default). If a prefix argument is given, the\r
174 +messages will be \"unarchived\" (i.e. the tag changes in\r
175 +`notmuch-archive-tags' will be reversed).\r
176  \r
177  This function advances the next thread when finished."\r
178    (interactive)\r
179 -  (notmuch-search-tag '("-inbox"))\r
180 +  (when notmuch-archive-tags\r
181 +    (notmuch-search-tag\r
182 +     (notmuch-tag-change-list notmuch-archive-tags)))\r
183    (notmuch-search-next-thread))\r
184  \r
185  (defun notmuch-search-update-result (result &optional pos)\r
186 -- \r
187 1.7.9.5\r
188 \r