Re: Hi all
[notmuch-archives.git] / 0f / c488d4f67ce6d03f63e03ca8eb15dcf1f94859
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 7D04A431FC2\r
6         for <notmuch@notmuchmail.org>; Sat,  2 Mar 2013 11:55:29 -0800 (PST)\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 djKpzwWP7RpI for <notmuch@notmuchmail.org>;\r
17         Sat,  2 Mar 2013 11:55:27 -0800 (PST)\r
18 Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com\r
19         [209.85.217.182]) (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 782AE431FAF\r
22         for <notmuch@notmuchmail.org>; Sat,  2 Mar 2013 11:55:27 -0800 (PST)\r
23 Received: by mail-lb0-f182.google.com with SMTP id gg6so3075672lbb.13\r
24         for <notmuch@notmuchmail.org>; Sat, 02 Mar 2013 11:55:25 -0800 (PST)\r
25 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
26         d=google.com; s=20120113;\r
27         h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to\r
28         :references:in-reply-to:references:x-gm-message-state;\r
29         bh=UUERYx8WznyJ8eXUoRBpqPs2Ohoav9Is5Uu2bCccoOc=;\r
30         b=YxsxwoS7wC9ujwqBaXWH1ErVRO0RDYarghuzMfZ/GEewNJmyluEro9U3u8dPWNvHvM\r
31         etbY0DtDNy5v3KcQJNYADRAllJUsHpUyL5Mxp9ttL5DUiBt9lZMkJ/Kcs7uKGzXZbo2g\r
32         R7V+h9zy5iHlqVldwO+zfFWM0Vq395d38ZnosdLa4Ly1z4s7zNnJ8zH0zB1qyRyF1jwR\r
33         dVepdO4pkaE+CWOPP1WW35Jz/OgPnfEE48M1uKAt7FnfWmDOBMhaCz6ghQq6OHiEBwHn\r
34         fWjJ6w1Bf56TggO4ovGGGe2s+WJzZNaLocGs3ZFbBPQuYFmqR2K9jS8ZB9tiegQHPwmf\r
35         SIEw==\r
36 X-Received: by 10.112.30.104 with SMTP id r8mr2443118lbh.82.1362254125806;\r
37         Sat, 02 Mar 2013 11:55:25 -0800 (PST)\r
38 Received: from localhost (dsl-hkibrasgw4-50df51-27.dhcp.inet.fi.\r
39         [80.223.81.27])\r
40         by mx.google.com with ESMTPS id l1sm5515632lbn.8.2013.03.02.11.55.24\r
41         (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
42         Sat, 02 Mar 2013 11:55:25 -0800 (PST)\r
43 From: Jani Nikula <jani@nikula.org>\r
44 To: notmuch@notmuchmail.org\r
45 Subject: [RFC PATCH 2/3] cli: add reply.honor_followup_to configuration option\r
46 Date: Sat,  2 Mar 2013 21:55:20 +0200\r
47 Message-Id:\r
48  <7d854894e5406778693f33358c67e86b98cb61c2.1362254104.git.jani@nikula.org>\r
49 X-Mailer: git-send-email 1.7.10.4\r
50 In-Reply-To:\r
51  <5eaa3acc22ee5513bdce5ab931b7a79ade880e06.1362254104.git.jani@nikula.org>\r
52 References:\r
53  <5eaa3acc22ee5513bdce5ab931b7a79ade880e06.1362254104.git.jani@nikula.org>\r
54 In-Reply-To:\r
55  <5eaa3acc22ee5513bdce5ab931b7a79ade880e06.1362254104.git.jani@nikula.org>\r
56 References:\r
57  <5eaa3acc22ee5513bdce5ab931b7a79ade880e06.1362254104.git.jani@nikula.org>\r
58 X-Gm-Message-State:\r
59  ALoCoQlmUT6OCxFUmqOjRWhdqk/0OE7q3QxMEdar4gIITmkP7R16ffVid5m/XEIOARW3NtwDiCdz\r
60 X-BeenThere: notmuch@notmuchmail.org\r
61 X-Mailman-Version: 2.1.13\r
62 Precedence: list\r
63 List-Id: "Use and development of the notmuch mail system."\r
64         <notmuch.notmuchmail.org>\r
65 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
66         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
67 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
68 List-Post: <mailto:notmuch@notmuchmail.org>\r
69 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
70 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
71         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
72 X-List-Received-Date: Sat, 02 Mar 2013 19:55:30 -0000\r
73 \r
74 The reply.honor_followup_to configuration option determines whether\r
75 notmuch reply takes into account the Mail-Followup-To: header in\r
76 incoming messages.\r
77 ---\r
78  notmuch-client.h |    7 +++++++\r
79  notmuch-config.c |   43 +++++++++++++++++++++++++++++++++++++++++++\r
80  2 files changed, 50 insertions(+)\r
81 \r
82 diff --git a/notmuch-client.h b/notmuch-client.h\r
83 index 5f28836..54df811 100644\r
84 --- a/notmuch-client.h\r
85 +++ b/notmuch-client.h\r
86 @@ -304,6 +304,13 @@ notmuch_config_set_new_ignore (notmuch_config_t *config,\r
87                                size_t length);\r
88  \r
89  notmuch_bool_t\r
90 +notmuch_config_get_reply_honor_followup_to (notmuch_config_t *config);\r
91 +\r
92 +void\r
93 +notmuch_config_set_reply_honor_followup_to (notmuch_config_t *config,\r
94 +                                           notmuch_bool_t honor_followup_to);\r
95 +\r
96 +notmuch_bool_t\r
97  notmuch_config_get_maildir_synchronize_flags (notmuch_config_t *config);\r
98  \r
99  void\r
100 diff --git a/notmuch-config.c b/notmuch-config.c\r
101 index 45b4c0e..69c4bee 100644\r
102 --- a/notmuch-config.c\r
103 +++ b/notmuch-config.c\r
104 @@ -53,6 +53,17 @@ static const char new_config_comment[] =\r
105      "\t        names will be ignored, independent of its depth/location\n"\r
106      "\t        in the mail store.\n";\r
107  \r
108 +static const char reply_config_comment[] =\r
109 +    " Configuration for \"notmuch reply\"\n"\r
110 +    "\n"\r
111 +    " The following option is supported here:\n"\r
112 +    "\n"\r
113 +    "\thonor_followup_to       Valid values are true and false.\n"\r
114 +    "\n"\r
115 +    "\tIf true, \"notmuch reply\" will honor the \"Mail-Followup-To:\""\r
116 +    "\theader in incoming messages. (This will not generate the headers"\r
117 +    "\tto outgoing messages.)\n";\r
118 +\r
119  static const char user_config_comment[] =\r
120      " User configuration\n"\r
121      "\n"\r
122 @@ -114,6 +125,7 @@ struct _notmuch_config {\r
123      size_t new_tags_length;\r
124      const char **new_ignore;\r
125      size_t new_ignore_length;\r
126 +    notmuch_bool_t reply_honor_followup_to;\r
127      notmuch_bool_t maildir_synchronize_flags;\r
128      const char **search_exclude_tags;\r
129      size_t search_exclude_tags_length;\r
130 @@ -240,6 +252,7 @@ notmuch_config_open (void *ctx,\r
131      char *notmuch_config_env = NULL;\r
132      int file_had_database_group;\r
133      int file_had_new_group;\r
134 +    int file_had_reply_group;\r
135      int file_had_user_group;\r
136      int file_had_maildir_group;\r
137      int file_had_search_group;\r
138 @@ -275,6 +288,7 @@ notmuch_config_open (void *ctx,\r
139      config->new_tags_length = 0;\r
140      config->new_ignore = NULL;\r
141      config->new_ignore_length = 0;\r
142 +    config->reply_honor_followup_to = FALSE;\r
143      config->maildir_synchronize_flags = TRUE;\r
144      config->search_exclude_tags = NULL;\r
145      config->search_exclude_tags_length = 0;\r
146 @@ -319,6 +333,7 @@ notmuch_config_open (void *ctx,\r
147      file_had_database_group = g_key_file_has_group (config->key_file,\r
148                                                     "database");\r
149      file_had_new_group = g_key_file_has_group (config->key_file, "new");\r
150 +    file_had_reply_group = g_key_file_has_group (config->key_file, "reply");\r
151      file_had_user_group = g_key_file_has_group (config->key_file, "user");\r
152      file_had_maildir_group = g_key_file_has_group (config->key_file, "maildir");\r
153      file_had_search_group = g_key_file_has_group (config->key_file, "search");\r
154 @@ -386,6 +401,15 @@ notmuch_config_open (void *ctx,\r
155      }\r
156  \r
157      error = NULL;\r
158 +    config->reply_honor_followup_to =\r
159 +       g_key_file_get_boolean (config->key_file,\r
160 +                               "reply", "honor_followup_to", &error);\r
161 +    if (error) {\r
162 +       notmuch_config_set_reply_honor_followup_to (config, FALSE);\r
163 +       g_error_free (error);\r
164 +    }\r
165 +\r
166 +    error = NULL;\r
167      config->maildir_synchronize_flags =\r
168         g_key_file_get_boolean (config->key_file,\r
169                                 "maildir", "synchronize_flags", &error);\r
170 @@ -409,6 +433,10 @@ notmuch_config_open (void *ctx,\r
171         g_key_file_set_comment (config->key_file, "new", NULL,\r
172                                 new_config_comment, NULL);\r
173  \r
174 +    if (! file_had_reply_group)\r
175 +       g_key_file_set_comment (config->key_file, "reply", NULL,\r
176 +                               reply_config_comment, NULL);\r
177 +\r
178      if (! file_had_user_group)\r
179         g_key_file_set_comment (config->key_file, "user", NULL,\r
180                                 user_config_comment, NULL);\r
181 @@ -868,6 +896,21 @@ notmuch_config_command (void *ctx, int argc, char *argv[])\r
182  }\r
183  \r
184  notmuch_bool_t\r
185 +notmuch_config_get_reply_honor_followup_to (notmuch_config_t *config)\r
186 +{\r
187 +    return config->reply_honor_followup_to;\r
188 +}\r
189 +\r
190 +void\r
191 +notmuch_config_set_reply_honor_followup_to (notmuch_config_t *config,\r
192 +                                           notmuch_bool_t honor_followup_to)\r
193 +{\r
194 +    g_key_file_set_boolean (config->key_file,\r
195 +                           "reply", "honor_followup_to", honor_followup_to);\r
196 +    config->reply_honor_followup_to = honor_followup_to;\r
197 +}\r
198 +\r
199 +notmuch_bool_t\r
200  notmuch_config_get_maildir_synchronize_flags (notmuch_config_t *config)\r
201  {\r
202      return config->maildir_synchronize_flags;\r
203 -- \r
204 1.7.10.4\r
205 \r