[PATCH] WIP: remove all non-prefixed-terms (and stemmed versions)
[notmuch-archives.git] / 00 / 2087bab041f6d3159fd53b5d0e3e33638f0d9b
1 Return-Path: <pieter@praet.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 9AA93429E54\r
6         for <notmuch@notmuchmail.org>; Sun, 22 Jan 2012 20:24:40 -0800 (PST)\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 VuHBA0wCh23t for <notmuch@notmuchmail.org>;\r
16         Sun, 22 Jan 2012 20:24:40 -0800 (PST)\r
17 Received: from mail-we0-f181.google.com (mail-we0-f181.google.com\r
18         [74.125.82.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 A92CC429E40\r
21         for <notmuch@notmuchmail.org>; Sun, 22 Jan 2012 20:24:39 -0800 (PST)\r
22 Received: by werb10 with SMTP id b10so2114400wer.26\r
23         for <notmuch@notmuchmail.org>; Sun, 22 Jan 2012 20:24:38 -0800 (PST)\r
24 Received: by 10.216.137.210 with SMTP id y60mr2973975wei.14.1327292678303;\r
25         Sun, 22 Jan 2012 20:24:38 -0800 (PST)\r
26 Received: from localhost ([109.131.95.182])\r
27         by mx.google.com with ESMTPS id gy6sm10720175wib.11.2012.01.22.20.24.37\r
28         (version=TLSv1/SSLv3 cipher=OTHER);\r
29         Sun, 22 Jan 2012 20:24:37 -0800 (PST)\r
30 From: Pieter Praet <pieter@praet.org>\r
31 To: Austin Clements <amdragon@mit.edu>\r
32 Subject: [PATCH v2 1/6] search: rename auto_exclude_tags to {search,\r
33         }exclude_tags\r
34 Date: Mon, 23 Jan 2012 05:22:32 +0100\r
35 Message-Id: <1327292557-7701-1-git-send-email-pieter@praet.org>\r
36 X-Mailer: git-send-email 1.7.8.1\r
37 In-Reply-To: <87obtvaw8h.fsf@praet.org>\r
38 References: <87obtvaw8h.fsf@praet.org>\r
39 Cc: Notmuch Mail <notmuch@notmuchmail.org>\r
40 X-BeenThere: notmuch@notmuchmail.org\r
41 X-Mailman-Version: 2.1.13\r
42 Precedence: list\r
43 List-Id: "Use and development of the notmuch mail system."\r
44         <notmuch.notmuchmail.org>\r
45 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
46         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
47 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
48 List-Post: <mailto:notmuch@notmuchmail.org>\r
49 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
50 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
51         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
52 X-List-Received-Date: Mon, 23 Jan 2012 04:24:40 -0000\r
53 \r
54 All other config-related functions and args include the section\r
55 title in their name, so for the sake of consistency, mirror that.\r
56 \r
57 Also, the "auto"matic part is a given, so that was dropped.\r
58 ---\r
59  notmuch-client.h |    4 ++--\r
60  notmuch-config.c |   28 ++++++++++++++--------------\r
61  notmuch-count.c  |   12 ++++++------\r
62  notmuch-search.c |   12 ++++++------\r
63  4 files changed, 28 insertions(+), 28 deletions(-)\r
64 \r
65 diff --git a/notmuch-client.h b/notmuch-client.h\r
66 index 9c1d383..f5414f6 100644\r
67 --- a/notmuch-client.h\r
68 +++ b/notmuch-client.h\r
69 @@ -252,10 +252,10 @@ notmuch_config_set_maildir_synchronize_flags (notmuch_config_t *config,\r
70                                               notmuch_bool_t synchronize_flags);\r
71  \r
72  const char **\r
73 -notmuch_config_get_auto_exclude_tags (notmuch_config_t *config, size_t *length);\r
74 +notmuch_config_get_search_exclude_tags (notmuch_config_t *config, size_t *length);\r
75  \r
76  void\r
77 -notmuch_config_set_auto_exclude_tags (notmuch_config_t *config,\r
78 +notmuch_config_set_search_exclude_tags (notmuch_config_t *config,\r
79                                       const char *list[],\r
80                                       size_t length);\r
81  \r
82 diff --git a/notmuch-config.c b/notmuch-config.c\r
83 index 8dcfe86..39da888 100644\r
84 --- a/notmuch-config.c\r
85 +++ b/notmuch-config.c\r
86 @@ -89,7 +89,7 @@ static const char search_config_comment[] =\r
87      "\n"\r
88      " The following option is supported here:\n"\r
89      "\n"\r
90 -    "\tauto_exclude_tags\n"\r
91 +    "\texclude_tags\n"\r
92      "\t\tA ;-separated list of tags that will be excluded from\n"\r
93      "\t\tsearch results by default.  Using an excluded tag in a\n"\r
94      "\t\tquery will override that exclusion.\n";\r
95 @@ -106,8 +106,8 @@ struct _notmuch_config {\r
96      const char **new_tags;\r
97      size_t new_tags_length;\r
98      notmuch_bool_t maildir_synchronize_flags;\r
99 -    const char **auto_exclude_tags;\r
100 -    size_t auto_exclude_tags_length;\r
101 +    const char **search_exclude_tags;\r
102 +    size_t search_exclude_tags_length;\r
103  };\r
104  \r
105  static int\r
106 @@ -265,8 +265,8 @@ notmuch_config_open (void *ctx,\r
107      config->new_tags = NULL;\r
108      config->new_tags_length = 0;\r
109      config->maildir_synchronize_flags = TRUE;\r
110 -    config->auto_exclude_tags = NULL;\r
111 -    config->auto_exclude_tags_length = 0;\r
112 +    config->search_exclude_tags = NULL;\r
113 +    config->search_exclude_tags_length = 0;\r
114  \r
115      if (! g_key_file_load_from_file (config->key_file,\r
116                                      config->filename,\r
117 @@ -361,9 +361,9 @@ notmuch_config_open (void *ctx,\r
118         notmuch_config_set_new_tags (config, tags, 2);\r
119      }\r
120  \r
121 -    if (notmuch_config_get_auto_exclude_tags (config, &tmp) == NULL) {\r
122 +    if (notmuch_config_get_search_exclude_tags (config, &tmp) == NULL) {\r
123         const char *tags[] = { "deleted", "spam" };\r
124 -       notmuch_config_set_auto_exclude_tags (config, tags, 2);\r
125 +       notmuch_config_set_search_exclude_tags (config, tags, 2);\r
126      }\r
127  \r
128      error = NULL;\r
129 @@ -624,20 +624,20 @@ notmuch_config_set_new_tags (notmuch_config_t *config,\r
130  }\r
131  \r
132  const char **\r
133 -notmuch_config_get_auto_exclude_tags (notmuch_config_t *config, size_t *length)\r
134 +notmuch_config_get_search_exclude_tags (notmuch_config_t *config, size_t *length)\r
135  {\r
136 -    return _config_get_list (config, "search", "auto_exclude_tags",\r
137 -                            &(config->auto_exclude_tags),\r
138 -                            &(config->auto_exclude_tags_length), length);\r
139 +    return _config_get_list (config, "search", "exclude_tags",\r
140 +                            &(config->search_exclude_tags),\r
141 +                            &(config->search_exclude_tags_length), length);\r
142  }\r
143  \r
144  void\r
145 -notmuch_config_set_auto_exclude_tags (notmuch_config_t *config,\r
146 +notmuch_config_set_search_exclude_tags (notmuch_config_t *config,\r
147                                       const char *list[],\r
148                                       size_t length)\r
149  {\r
150 -    _config_set_list (config, "search", "auto_exclude_tags", list, length,\r
151 -                     &(config->auto_exclude_tags));\r
152 +    _config_set_list (config, "search", "exclude_tags", list, length,\r
153 +                     &(config->search_exclude_tags));\r
154  }\r
155  \r
156  /* Given a configuration item of the form <group>.<key> return the\r
157 diff --git a/notmuch-count.c b/notmuch-count.c\r
158 index f77861e..63459fb 100644\r
159 --- a/notmuch-count.c\r
160 +++ b/notmuch-count.c\r
161 @@ -35,8 +35,8 @@ notmuch_count_command (void *ctx, int argc, char *argv[])\r
162      char *query_str;\r
163      int opt_index;\r
164      int output = OUTPUT_MESSAGES;\r
165 -    const char **auto_exclude_tags;\r
166 -    size_t auto_exclude_tags_length;\r
167 +    const char **search_exclude_tags;\r
168 +    size_t search_exclude_tags_length;\r
169      unsigned int i;\r
170  \r
171      notmuch_opt_desc_t options[] = {\r
172 @@ -78,10 +78,10 @@ notmuch_count_command (void *ctx, int argc, char *argv[])\r
173         return 1;\r
174      }\r
175  \r
176 -    auto_exclude_tags = notmuch_config_get_auto_exclude_tags\r
177 -       (config, &auto_exclude_tags_length);\r
178 -    for (i = 0; i < auto_exclude_tags_length; i++)\r
179 -       notmuch_query_add_tag_exclude (query, auto_exclude_tags[i]);\r
180 +    search_exclude_tags = notmuch_config_get_search_exclude_tags\r
181 +       (config, &search_exclude_tags_length);\r
182 +    for (i = 0; i < search_exclude_tags_length; i++)\r
183 +       notmuch_query_add_tag_exclude (query, search_exclude_tags[i]);\r
184  \r
185      switch (output) {\r
186      case OUTPUT_MESSAGES:\r
187 diff --git a/notmuch-search.c b/notmuch-search.c\r
188 index 8867aab..d504051 100644\r
189 --- a/notmuch-search.c\r
190 +++ b/notmuch-search.c\r
191 @@ -423,8 +423,8 @@ notmuch_search_command (void *ctx, int argc, char *argv[])\r
192      output_t output = OUTPUT_SUMMARY;\r
193      int offset = 0;\r
194      int limit = -1; /* unlimited */\r
195 -    const char **auto_exclude_tags;\r
196 -    size_t auto_exclude_tags_length;\r
197 +    const char **search_exclude_tags;\r
198 +    size_t search_exclude_tags_length;\r
199      unsigned int i;\r
200  \r
201      enum { NOTMUCH_FORMAT_JSON, NOTMUCH_FORMAT_TEXT }\r
202 @@ -493,10 +493,10 @@ notmuch_search_command (void *ctx, int argc, char *argv[])\r
203  \r
204      notmuch_query_set_sort (query, sort);\r
205  \r
206 -    auto_exclude_tags = notmuch_config_get_auto_exclude_tags\r
207 -       (config, &auto_exclude_tags_length);\r
208 -    for (i = 0; i < auto_exclude_tags_length; i++)\r
209 -       notmuch_query_add_tag_exclude (query, auto_exclude_tags[i]);\r
210 +    search_exclude_tags = notmuch_config_get_search_exclude_tags\r
211 +       (config, &search_exclude_tags_length);\r
212 +    for (i = 0; i < search_exclude_tags_length; i++)\r
213 +       notmuch_query_add_tag_exclude (query, search_exclude_tags[i]);\r
214  \r
215      switch (output) {\r
216      default:\r
217 -- \r
218 1.7.8.1\r
219 \r