notmuch.el: controlling what does and doesn't get expanded in searches
[notmuch-archives.git] / 1e / 21085a03e5804225fa69e3d39143264ceb6ab5
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 60471431FBF\r
6         for <notmuch@notmuchmail.org>; Tue, 29 Jan 2013 13:46:40 -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 XnVhwrq2fJUc for <notmuch@notmuchmail.org>;\r
17         Tue, 29 Jan 2013 13:46:39 -0800 (PST)\r
18 Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com\r
19         [209.85.217.174]) (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 F08A1431FB6\r
22         for <notmuch@notmuchmail.org>; Tue, 29 Jan 2013 13:46:37 -0800 (PST)\r
23 Received: by mail-lb0-f174.google.com with SMTP id l12so1340065lbo.33\r
24         for <notmuch@notmuchmail.org>; Tue, 29 Jan 2013 13:46:36 -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:subject:date:message-id:x-mailer:in-reply-to\r
28         :references:in-reply-to:references:x-gm-message-state;\r
29         bh=YLFzUaV58WrnYvtnhghc74bKBrMJQsRu4APYP5eJz8Y=;\r
30         b=d0fxxYmNVtO3cO14/UtxL/x1A5lkgaDyegaOAqs+C5sYOHPKUwqaW2ezC8Zkwr5Bjk\r
31         Rz1Elxf6Rj2IvgXglqg9G67xktOsT8kyVZl28b4AmtwDi3TUF50erFgY/h7sHwSPUyKb\r
32         43XHpXoOBBA+oBmEUZprp4LKoHJ3ZctGvvobDFgRCg1E15uOcpqq6IY1VqgIGC5TU7p9\r
33         IJsiMnCtx1QVcgcc6Vo2Vi1mYsEYagI4aNUo6DCeufozhJoyCE0hiJWnEHvcCN2iXGMz\r
34         zya+NXjBsMl5MpzeSpcP1l9WA4/CqKRB3pjyDWSHRXFqxwVJIHDJ4mmNPg2udymV3dYE\r
35         WhMA==\r
36 X-Received: by 10.152.123.34 with SMTP id lx2mr2445055lab.52.1359495996396;\r
37         Tue, 29 Jan 2013 13:46:36 -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 j9sm5591267lbd.13.2013.01.29.13.46.33\r
41         (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
42         Tue, 29 Jan 2013 13:46:35 -0800 (PST)\r
43 From: Jani Nikula <jani@nikula.org>\r
44 To: notmuch@notmuchmail.org\r
45 Subject: [PATCH 1/6] cli: keep track of whether the config is newly created\r
46 Date: Tue, 29 Jan 2013 23:46:19 +0200\r
47 Message-Id:\r
48  <2f89028f7986f67792478f1728ca1f1fdd382d3c.1359495450.git.jani@nikula.org>\r
49 X-Mailer: git-send-email 1.7.10.4\r
50 In-Reply-To: <cover.1359495450.git.jani@nikula.org>\r
51 References: <cover.1359495450.git.jani@nikula.org>\r
52 In-Reply-To: <cover.1359495450.git.jani@nikula.org>\r
53 References: <cover.1359495450.git.jani@nikula.org>\r
54 X-Gm-Message-State:\r
55  ALoCoQmU+inKmIRNoiBgIbnCDe6JsO9rJ9xgO+DRgDwVrGrPpJ0lDS5RVdizsZZF/Twf0+/mdwUR\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: Tue, 29 Jan 2013 21:46:40 -0000\r
69 \r
70 Add notmuch_config_is_new() accessor function to check this.\r
71 ---\r
72  notmuch-client.h |    3 +++\r
73  notmuch-config.c |   11 +++++++++++\r
74  2 files changed, 14 insertions(+)\r
75 \r
76 diff --git a/notmuch-client.h b/notmuch-client.h\r
77 index 5f28836..07367e0 100644\r
78 --- a/notmuch-client.h\r
79 +++ b/notmuch-client.h\r
80 @@ -256,6 +256,9 @@ notmuch_config_close (notmuch_config_t *config);\r
81  int\r
82  notmuch_config_save (notmuch_config_t *config);\r
83  \r
84 +notmuch_bool_t\r
85 +notmuch_config_is_new (notmuch_config_t *config);\r
86 +\r
87  const char *\r
88  notmuch_config_get_database_path (notmuch_config_t *config);\r
89  \r
90 diff --git a/notmuch-config.c b/notmuch-config.c\r
91 index b5c2066..e733e92 100644\r
92 --- a/notmuch-config.c\r
93 +++ b/notmuch-config.c\r
94 @@ -104,6 +104,7 @@ static const char search_config_comment[] =\r
95  struct _notmuch_config {\r
96      char *filename;\r
97      GKeyFile *key_file;\r
98 +    notmuch_bool_t is_new;\r
99  \r
100      char *database_path;\r
101      char *user_name;\r
102 @@ -266,6 +267,7 @@ notmuch_config_open (void *ctx,\r
103  \r
104      config->key_file = g_key_file_new ();\r
105  \r
106 +    config->is_new = FALSE;\r
107      config->database_path = NULL;\r
108      config->user_name = NULL;\r
109      config->user_primary_email = NULL;\r
110 @@ -435,6 +437,8 @@ notmuch_config_open (void *ctx,\r
111      if (is_new_ret)\r
112         *is_new_ret = is_new;\r
113  \r
114 +    config->is_new = is_new;\r
115 +\r
116      return config;\r
117  }\r
118  \r
119 @@ -482,6 +486,13 @@ notmuch_config_save (notmuch_config_t *config)\r
120      return 0;\r
121  }\r
122  \r
123 +notmuch_bool_t\r
124 +notmuch_config_is_new (notmuch_config_t *config)\r
125 +{\r
126 +    return config->is_new;\r
127 +}\r
128 +\r
129 +\r
130  static const char **\r
131  _config_get_list (notmuch_config_t *config,\r
132                   const char *section, const char *key,\r
133 -- \r
134 1.7.10.4\r
135 \r