[PATCH] configure: add --without-api-docs option
[notmuch-archives.git] / 92 / d3bd9ce84f5f6a6d467ba3ad107fddc21d00dc
1 Return-Path: <alec@thened.net>\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 70CC1431FBC\r
6         for <notmuch@notmuchmail.org>; Sat, 21 Nov 2009 21:18:32 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 Received: from olra.theworths.org ([127.0.0.1])\r
9         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
10         with ESMTP id f0Nuuy7dXktS for <notmuch@notmuchmail.org>;\r
11         Sat, 21 Nov 2009 21:18:31 -0800 (PST)\r
12 Received: from ives.vdov.net (129.210.68.208.dnsptr.net [208.68.210.129])\r
13         by olra.theworths.org (Postfix) with ESMTP id C09F9431FAE\r
14         for <notmuch@notmuchmail.org>; Sat, 21 Nov 2009 21:18:31 -0800 (PST)\r
15 Received: from localhost (localhost [127.0.0.1])\r
16         by ives.vdov.net (Postfix) with ESMTP id 6439424F016\r
17         for <notmuch@notmuchmail.org>; Sat, 21 Nov 2009 23:18:35 -0600 (CST)\r
18 Received: from ives.vdov.net ([127.0.0.1])\r
19         by localhost (ives.vdov.net [127.0.0.1]) (amavisd-new, port 10024)\r
20         with ESMTP id vkTIUHbCL4dF; Sat, 21 Nov 2009 23:18:30 -0600 (CST)\r
21 Received: from localhost (129.210.68.208.dnsptr.net [208.68.210.129])\r
22         by ives.vdov.net (Postfix) with ESMTPSA id 35BA924EE27;\r
23         Sat, 21 Nov 2009 23:18:27 -0600 (CST)\r
24 Date: Sat, 21 Nov 2009 23:18:26 -0600\r
25 From: Alec Berryman <alec@thened.net>\r
26 To: notmuch@notmuchmail.org\r
27 Message-ID: <20091122051826.GA7299@thened.net>\r
28 MIME-Version: 1.0\r
29 Content-Type: text/plain; charset=us-ascii\r
30 Content-Disposition: inline\r
31 User-Agent: Mutt/1.5.18 (2008-05-17)\r
32 X-Hashcash: 1:24:091122:notmuch@notmuchmail.org::W2PuxzJysnlv9CoN:00000000000000000000000000000000000000iRG9\r
33 Subject: [notmuch] [PATCH] Support multiple configuration files via\r
34         $NOTMUCH_CONFIG\r
35 X-BeenThere: notmuch@notmuchmail.org\r
36 X-Mailman-Version: 2.1.12\r
37 Precedence: list\r
38 List-Id: "Use and development of the notmuch mail system."\r
39         <notmuch.notmuchmail.org>\r
40 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
41         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
42 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
43 List-Post: <mailto:notmuch@notmuchmail.org>\r
44 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
45 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
46         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
47 X-List-Received-Date: Sun, 22 Nov 2009 05:18:32 -0000\r
48 \r
49 If present, $NOTMUCH_CONFIG will be used as the configuration file\r
50 location.\r
51 ---\r
52  notmuch-config.c |   16 +++++++++++-----\r
53  notmuch-setup.c  |    3 ++-\r
54  notmuch.1        |    7 ++++---\r
55  notmuch.c        |    3 ++-\r
56  4 files changed, 19 insertions(+), 10 deletions(-)\r
57 \r
58 I'd like to have multiple configurations for personal and work email;\r
59 this solution worked for me.\r
60 \r
61 I've been having trouble with git send-email and this list; sorry if\r
62 this comes a few times.\r
63 \r
64 diff --git a/notmuch-config.c b/notmuch-config.c\r
65 index aaa0372..fc65d6b 100644\r
66 --- a/notmuch-config.c\r
67 +++ b/notmuch-config.c\r
68 @@ -132,9 +132,10 @@ get_username_from_passwd_file (void *ctx)\r
69      return name;\r
70  }\r
71  \r
72 -/* Open the named notmuch configuration file. A filename of NULL will\r
73 - * be interpreted as the default configuration file\r
74 - * ($HOME/.notmuch-config).\r
75 +/* Open the named notmuch configuration file. If the filename is NULL,\r
76 + * the value of the environment variable $NOTMUCH_CONFIG will be used.\r
77 + * If $NOTMUCH_CONFIG is unset, the default configuration file\r
78 + * ($HOME/.notmuch-config) will be used.\r
79   *\r
80   * If any error occurs, (out of memory, or a permission-denied error,\r
81   * etc.), this function will print a message to stderr and return\r
82 @@ -168,6 +169,7 @@ notmuch_config_open (void *ctx,\r
83  {\r
84      GError *error = NULL;\r
85      int is_new = 0;\r
86 +    char *notmuch_config_env = NULL;\r
87  \r
88      if (is_new_ret)\r
89         *is_new_ret = 0;\r
90 @@ -180,11 +182,15 @@ notmuch_config_open (void *ctx,\r
91      \r
92      talloc_set_destructor (config, notmuch_config_destructor);\r
93  \r
94 -    if (filename)\r
95 +    if (filename) {\r
96         config->filename = talloc_strdup (config, filename);\r
97 -    else\r
98 +    } else if ((notmuch_config_env = getenv ("NOTMUCH_CONFIG"))) {\r
99 +       config->filename = talloc_strdup (config, notmuch_config_env);\r
100 +       notmuch_config_env = NULL;\r
101 +    } else {\r
102         config->filename = talloc_asprintf (config, "%s/.notmuch-config",\r
103                                             getenv ("HOME"));\r
104 +    }\r
105  \r
106      config->key_file = g_key_file_new ();\r
107  \r
108 diff --git a/notmuch-setup.c b/notmuch-setup.c\r
109 index 482efd2..d06fbf8 100644\r
110 --- a/notmuch-setup.c\r
111 +++ b/notmuch-setup.c\r
112 @@ -76,7 +76,8 @@ welcome_message_post_setup (void)\r
113  "Notmuch is now configured, and the configuration settings are saved in\n"\r
114  "a file in your home directory named .notmuch-config . If you'd like to\n"\r
115  "change the configuration in the future, you can either edit that file\n"\r
116 -"directly or run \"notmuch setup\".\n\n"\r
117 +"directly or run \"notmuch setup\".  To choose an alternate configuration\n"\r
118 +"location, set ${NOTMUCH_CONFIG}.\n\n"\r
119  \r
120  "The next step is to run \"notmuch new\" which will create a database\n"\r
121  "that indexes all of your mail. Depending on the amount of mail you have\n"\r
122 diff --git a/notmuch.1 b/notmuch.1\r
123 index 8a3fb40..eeb1a94 100644\r
124 --- a/notmuch.1\r
125 +++ b/notmuch.1\r
126 @@ -53,9 +53,10 @@ Interactively sets up notmuch for first use.\r
127  The setup command will prompt for your full name, your primary email\r
128  address, any alternate email addresses you use, and the directory\r
129  containing your email archives. Your answers will be written to a\r
130 -configuration file in ${HOME}/.notmuch-config . This configuration\r
131 -file will be created with descriptive comments, making it easy to edit\r
132 -by hand later to change the configuration. Or you can run\r
133 +configuration file in ${NOTMUCH_CONFIG} (if set) or\r
134 +${HOME}/.notmuch-config . This configuration file will be created with\r
135 +descriptive comments, making it easy to edit by hand later to change the\r
136 +configuration. Or you can run\r
137  .B "notmuch setup"\r
138  again to change the configuration.\r
139  \r
140 diff --git a/notmuch.c b/notmuch.c\r
141 index 5cc8e4c..d7ea5aa 100644\r
142 --- a/notmuch.c\r
143 +++ b/notmuch.c\r
144 @@ -98,7 +98,8 @@ command_t commands[] = {\r
145        "\t\tThe setup command will prompt for your full name, your primary\n"\r
146        "\t\temail address, any alternate email addresses you use, and the\n"\r
147        "\t\tdirectory containing your email archives. Your answers will be\n"\r
148 -      "\t\twritten to a configuration file in ${HOME}/.notmuch-config .\n"\r
149 +      "\t\twritten to a configuration file in ${NOTMUCH_CONFIG} (if set)\n"\r
150 +      "\t\tor ${HOME}/.notmuch-config.\n"\r
151        "\n"\r
152        "\t\tThis configuration file will be created with descriptive\n"\r
153        "\t\tcomments, making it easy to edit by hand later to change the\n"\r
154 -- \r
155 1.6.5\r
156 \r
157 \r