Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / f7 / a0c4954d419d54e5aff691a45d60ef7ba6a730
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 C5C23429E29\r
6         for <notmuch@notmuchmail.org>; Sat, 30 Mar 2013 07:21:39 -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 KyZfgUsOe-42 for <notmuch@notmuchmail.org>;\r
17         Sat, 30 Mar 2013 07:21:38 -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 49A38431FD7\r
22         for <notmuch@notmuchmail.org>; Sat, 30 Mar 2013 07:21:36 -0700 (PDT)\r
23 Received: by mail-lb0-f181.google.com with SMTP id r11so910753lbv.26\r
24         for <notmuch@notmuchmail.org>; Sat, 30 Mar 2013 07:21:34 -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=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=fkWdoztOuJvp5t9Z1M/kbGJRHF09TLv8Q4BpHLlbkrE=;\r
30         b=en47N4t3TEDcAIEUpXgdTo8kUD7ktXiQ3l64hX6TYlxG1gWUzjmRmykItZt4YSkM5l\r
31         V8M8WTcMzlVMegij6tq+pLOYOI5nZi6ZcCjYUEPJktz3HcXpT8P4b8W16qiPKWDlLpU/\r
32         reUXnDSzKLePW90iS0JVVcPnWXT9/OwZZ8+zEdkD6Fg2IupIJ2+QXPa1abSGjrJasMhD\r
33         1M2lKqzF+UF7DjcV57bzOnt0s9F+45EdOd36XEHiZWH5j0jcy8mTTyRuOqfFHrUS6XPK\r
34         cwleKJMdF12d2Bgvlk3g4GLUWyfLoBP6B6CV70VYebvwE5ekHIE0PbK4rAClux77nUPI\r
35         HttQ==\r
36 X-Received: by 10.112.59.104 with SMTP id y8mr3000445lbq.39.1364653294753;\r
37         Sat, 30 Mar 2013 07:21:34 -0700 (PDT)\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 fz10sm2656631lbb.12.2013.03.30.07.21.32\r
41         (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
42         Sat, 30 Mar 2013 07:21:33 -0700 (PDT)\r
43 From: Jani Nikula <jani@nikula.org>\r
44 To: notmuch@notmuchmail.org\r
45 Subject: [PATCH v2 2/3] cli: add reply.honor_followup_to configuration option\r
46 Date: Sat, 30 Mar 2013 16:21:21 +0200\r
47 Message-Id:\r
48  <698d81ea04495c4315ff7da603f3e54eed1d24f1.1364652420.git.jani@nikula.org>\r
49 X-Mailer: git-send-email 1.7.10.4\r
50 In-Reply-To: <cover.1364652420.git.jani@nikula.org>\r
51 References: <cover.1364652420.git.jani@nikula.org>\r
52 In-Reply-To: <cover.1364652420.git.jani@nikula.org>\r
53 References: <cover.1364652420.git.jani@nikula.org>\r
54 X-Gm-Message-State:\r
55  ALoCoQmCKzX6xFSXVdYlV14feLps3NxG1RYLRdu6KX4dRytWi3VXIM+him6+OnDryID3L5Wh7NWF\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: Sat, 30 Mar 2013 14:21:40 -0000\r
69 \r
70 The reply.honor_followup_to configuration option determines whether\r
71 notmuch reply takes into account the Mail-Followup-To: header in\r
72 incoming messages.\r
73 ---\r
74  notmuch-client.h |    7 +++++++\r
75  notmuch-config.c |   43 +++++++++++++++++++++++++++++++++++++++++++\r
76  2 files changed, 50 insertions(+)\r
77 \r
78 diff --git a/notmuch-client.h b/notmuch-client.h\r
79 index 45749a6..0b7800c 100644\r
80 --- a/notmuch-client.h\r
81 +++ b/notmuch-client.h\r
82 @@ -301,6 +301,13 @@ notmuch_config_set_new_ignore (notmuch_config_t *config,\r
83                                size_t length);\r
84  \r
85  notmuch_bool_t\r
86 +notmuch_config_get_reply_honor_followup_to (notmuch_config_t *config);\r
87 +\r
88 +void\r
89 +notmuch_config_set_reply_honor_followup_to (notmuch_config_t *config,\r
90 +                                           notmuch_bool_t honor_followup_to);\r
91 +\r
92 +notmuch_bool_t\r
93  notmuch_config_get_maildir_synchronize_flags (notmuch_config_t *config);\r
94  \r
95  void\r
96 diff --git a/notmuch-config.c b/notmuch-config.c\r
97 index 66a1cdf..053038e 100644\r
98 --- a/notmuch-config.c\r
99 +++ b/notmuch-config.c\r
100 @@ -53,6 +53,17 @@ static const char new_config_comment[] =\r
101      "\t        names will be ignored, independent of its depth/location\n"\r
102      "\t        in the mail store.\n";\r
103  \r
104 +static const char reply_config_comment[] =\r
105 +    " Configuration for \"notmuch reply\"\n"\r
106 +    "\n"\r
107 +    " The following option is supported here:\n"\r
108 +    "\n"\r
109 +    "\thonor_followup_to       Valid values are true and false.\n"\r
110 +    "\n"\r
111 +    "\tIf true, \"notmuch reply\" will honor the \"Mail-Followup-To:\""\r
112 +    "\theader in incoming messages. (This will not generate the headers"\r
113 +    "\tto outgoing messages.)\n";\r
114 +\r
115  static const char user_config_comment[] =\r
116      " User configuration\n"\r
117      "\n"\r
118 @@ -115,6 +126,7 @@ struct _notmuch_config {\r
119      size_t new_tags_length;\r
120      const char **new_ignore;\r
121      size_t new_ignore_length;\r
122 +    notmuch_bool_t reply_honor_followup_to;\r
123      notmuch_bool_t maildir_synchronize_flags;\r
124      const char **search_exclude_tags;\r
125      size_t search_exclude_tags_length;\r
126 @@ -240,6 +252,7 @@ notmuch_config_open (void *ctx,\r
127      char *notmuch_config_env = NULL;\r
128      int file_had_database_group;\r
129      int file_had_new_group;\r
130 +    int file_had_reply_group;\r
131      int file_had_user_group;\r
132      int file_had_maildir_group;\r
133      int file_had_search_group;\r
134 @@ -273,6 +286,7 @@ notmuch_config_open (void *ctx,\r
135      config->new_tags_length = 0;\r
136      config->new_ignore = NULL;\r
137      config->new_ignore_length = 0;\r
138 +    config->reply_honor_followup_to = FALSE;\r
139      config->maildir_synchronize_flags = TRUE;\r
140      config->search_exclude_tags = NULL;\r
141      config->search_exclude_tags_length = 0;\r
142 @@ -316,6 +330,7 @@ notmuch_config_open (void *ctx,\r
143      file_had_database_group = g_key_file_has_group (config->key_file,\r
144                                                     "database");\r
145      file_had_new_group = g_key_file_has_group (config->key_file, "new");\r
146 +    file_had_reply_group = g_key_file_has_group (config->key_file, "reply");\r
147      file_had_user_group = g_key_file_has_group (config->key_file, "user");\r
148      file_had_maildir_group = g_key_file_has_group (config->key_file, "maildir");\r
149      file_had_search_group = g_key_file_has_group (config->key_file, "search");\r
150 @@ -383,6 +398,15 @@ notmuch_config_open (void *ctx,\r
151      }\r
152  \r
153      error = NULL;\r
154 +    config->reply_honor_followup_to =\r
155 +       g_key_file_get_boolean (config->key_file,\r
156 +                               "reply", "honor_followup_to", &error);\r
157 +    if (error) {\r
158 +       notmuch_config_set_reply_honor_followup_to (config, FALSE);\r
159 +       g_error_free (error);\r
160 +    }\r
161 +\r
162 +    error = NULL;\r
163      config->maildir_synchronize_flags =\r
164         g_key_file_get_boolean (config->key_file,\r
165                                 "maildir", "synchronize_flags", &error);\r
166 @@ -406,6 +430,10 @@ notmuch_config_open (void *ctx,\r
167         g_key_file_set_comment (config->key_file, "new", NULL,\r
168                                 new_config_comment, NULL);\r
169  \r
170 +    if (! file_had_reply_group)\r
171 +       g_key_file_set_comment (config->key_file, "reply", NULL,\r
172 +                               reply_config_comment, NULL);\r
173 +\r
174      if (! file_had_user_group)\r
175         g_key_file_set_comment (config->key_file, "user", NULL,\r
176                                 user_config_comment, NULL);\r
177 @@ -845,6 +873,21 @@ notmuch_config_command (notmuch_config_t *config, int argc, char *argv[])\r
178  }\r
179  \r
180  notmuch_bool_t\r
181 +notmuch_config_get_reply_honor_followup_to (notmuch_config_t *config)\r
182 +{\r
183 +    return config->reply_honor_followup_to;\r
184 +}\r
185 +\r
186 +void\r
187 +notmuch_config_set_reply_honor_followup_to (notmuch_config_t *config,\r
188 +                                           notmuch_bool_t honor_followup_to)\r
189 +{\r
190 +    g_key_file_set_boolean (config->key_file,\r
191 +                           "reply", "honor_followup_to", honor_followup_to);\r
192 +    config->reply_honor_followup_to = honor_followup_to;\r
193 +}\r
194 +\r
195 +notmuch_bool_t\r
196  notmuch_config_get_maildir_synchronize_flags (notmuch_config_t *config)\r
197  {\r
198      return config->maildir_synchronize_flags;\r
199 -- \r
200 1.7.10.4\r
201 \r