--- /dev/null
+Return-Path: <jani@nikula.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 60471431FBF\r
+ for <notmuch@notmuchmail.org>; Tue, 29 Jan 2013 13:46:40 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id XnVhwrq2fJUc for <notmuch@notmuchmail.org>;\r
+ Tue, 29 Jan 2013 13:46:39 -0800 (PST)\r
+Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com\r
+ [209.85.217.174]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id F08A1431FB6\r
+ for <notmuch@notmuchmail.org>; Tue, 29 Jan 2013 13:46:37 -0800 (PST)\r
+Received: by mail-lb0-f174.google.com with SMTP id l12so1340065lbo.33\r
+ for <notmuch@notmuchmail.org>; Tue, 29 Jan 2013 13:46:36 -0800 (PST)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=google.com; s=20120113;\r
+ h=x-received:from:to:subject:date:message-id:x-mailer:in-reply-to\r
+ :references:in-reply-to:references:x-gm-message-state;\r
+ bh=YLFzUaV58WrnYvtnhghc74bKBrMJQsRu4APYP5eJz8Y=;\r
+ b=d0fxxYmNVtO3cO14/UtxL/x1A5lkgaDyegaOAqs+C5sYOHPKUwqaW2ezC8Zkwr5Bjk\r
+ Rz1Elxf6Rj2IvgXglqg9G67xktOsT8kyVZl28b4AmtwDi3TUF50erFgY/h7sHwSPUyKb\r
+ 43XHpXoOBBA+oBmEUZprp4LKoHJ3ZctGvvobDFgRCg1E15uOcpqq6IY1VqgIGC5TU7p9\r
+ IJsiMnCtx1QVcgcc6Vo2Vi1mYsEYagI4aNUo6DCeufozhJoyCE0hiJWnEHvcCN2iXGMz\r
+ zya+NXjBsMl5MpzeSpcP1l9WA4/CqKRB3pjyDWSHRXFqxwVJIHDJ4mmNPg2udymV3dYE\r
+ WhMA==\r
+X-Received: by 10.152.123.34 with SMTP id lx2mr2445055lab.52.1359495996396;\r
+ Tue, 29 Jan 2013 13:46:36 -0800 (PST)\r
+Received: from localhost (dsl-hkibrasgw4-50df51-27.dhcp.inet.fi.\r
+ [80.223.81.27])\r
+ by mx.google.com with ESMTPS id j9sm5591267lbd.13.2013.01.29.13.46.33\r
+ (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+ Tue, 29 Jan 2013 13:46:35 -0800 (PST)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 1/6] cli: keep track of whether the config is newly created\r
+Date: Tue, 29 Jan 2013 23:46:19 +0200\r
+Message-Id:\r
+ <2f89028f7986f67792478f1728ca1f1fdd382d3c.1359495450.git.jani@nikula.org>\r
+X-Mailer: git-send-email 1.7.10.4\r
+In-Reply-To: <cover.1359495450.git.jani@nikula.org>\r
+References: <cover.1359495450.git.jani@nikula.org>\r
+In-Reply-To: <cover.1359495450.git.jani@nikula.org>\r
+References: <cover.1359495450.git.jani@nikula.org>\r
+X-Gm-Message-State:\r
+ ALoCoQmU+inKmIRNoiBgIbnCDe6JsO9rJ9xgO+DRgDwVrGrPpJ0lDS5RVdizsZZF/Twf0+/mdwUR\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 29 Jan 2013 21:46:40 -0000\r
+\r
+Add notmuch_config_is_new() accessor function to check this.\r
+---\r
+ notmuch-client.h | 3 +++\r
+ notmuch-config.c | 11 +++++++++++\r
+ 2 files changed, 14 insertions(+)\r
+\r
+diff --git a/notmuch-client.h b/notmuch-client.h\r
+index 5f28836..07367e0 100644\r
+--- a/notmuch-client.h\r
++++ b/notmuch-client.h\r
+@@ -256,6 +256,9 @@ notmuch_config_close (notmuch_config_t *config);\r
+ int\r
+ notmuch_config_save (notmuch_config_t *config);\r
+ \r
++notmuch_bool_t\r
++notmuch_config_is_new (notmuch_config_t *config);\r
++\r
+ const char *\r
+ notmuch_config_get_database_path (notmuch_config_t *config);\r
+ \r
+diff --git a/notmuch-config.c b/notmuch-config.c\r
+index b5c2066..e733e92 100644\r
+--- a/notmuch-config.c\r
++++ b/notmuch-config.c\r
+@@ -104,6 +104,7 @@ static const char search_config_comment[] =\r
+ struct _notmuch_config {\r
+ char *filename;\r
+ GKeyFile *key_file;\r
++ notmuch_bool_t is_new;\r
+ \r
+ char *database_path;\r
+ char *user_name;\r
+@@ -266,6 +267,7 @@ notmuch_config_open (void *ctx,\r
+ \r
+ config->key_file = g_key_file_new ();\r
+ \r
++ config->is_new = FALSE;\r
+ config->database_path = NULL;\r
+ config->user_name = NULL;\r
+ config->user_primary_email = NULL;\r
+@@ -435,6 +437,8 @@ notmuch_config_open (void *ctx,\r
+ if (is_new_ret)\r
+ *is_new_ret = is_new;\r
+ \r
++ config->is_new = is_new;\r
++\r
+ return config;\r
+ }\r
+ \r
+@@ -482,6 +486,13 @@ notmuch_config_save (notmuch_config_t *config)\r
+ return 0;\r
+ }\r
+ \r
++notmuch_bool_t\r
++notmuch_config_is_new (notmuch_config_t *config)\r
++{\r
++ return config->is_new;\r
++}\r
++\r
++\r
+ static const char **\r
+ _config_get_list (notmuch_config_t *config,\r
+ const char *section, const char *key,\r
+-- \r
+1.7.10.4\r
+\r