From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id CDD046DE0243 for ; Sat, 14 Oct 2017 23:48:18 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.036 X-Spam-Level: X-Spam-Status: No, score=-0.036 tagged_above=-999 required=5 tests=[AWL=-0.036] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id plVLe4kMThfj for ; Sat, 14 Oct 2017 23:48:18 -0700 (PDT) Received: from che.mayfirst.org (che.mayfirst.org [162.247.75.118]) by arlo.cworth.org (Postfix) with ESMTP id 263686DE0361 for ; Sat, 14 Oct 2017 23:48:16 -0700 (PDT) Received: from fifthhorseman.net (ool-6c3a0662.static.optonline.net [108.58.6.98]) by che.mayfirst.org (Postfix) with ESMTPSA id 72B6DF9A6 for ; Sun, 15 Oct 2017 02:48:15 -0400 (EDT) Received: by fifthhorseman.net (Postfix, from userid 1000) id 8766720C9F; Sun, 15 Oct 2017 02:48:11 -0400 (EDT) From: Daniel Kahn Gillmor To: Notmuch Mail Subject: [PATCH v5 07/12] config: indexing defaults will be stored in the database. Date: Sun, 15 Oct 2017 02:48:02 -0400 Message-Id: <20171015064807.14205-8-dkg@fifthhorseman.net> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171015064807.14205-1-dkg@fifthhorseman.net> References: <20171015064807.14205-1-dkg@fifthhorseman.net> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Oct 2017 06:48:19 -0000 At indexing time, the database needs to know its internal defaults. It shouldn't be contingent on an external config file (since that can't be retrieved from the database object itself). This behaves the same as the query.* configurations, which are also stored in the database itself, so we're not introducing any new dependencies. --- notmuch-config.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/notmuch-config.c b/notmuch-config.c index 8fb59f96..e82f7dd7 100644 --- a/notmuch-config.c +++ b/notmuch-config.c @@ -809,6 +809,7 @@ _item_split (char *item, char **group, char **key) #define BUILT_WITH_PREFIX "built_with." #define QUERY_PREFIX "query." +#define INDEX_PREFIX "index." static int _print_db_config(notmuch_config_t *config, const char *name) @@ -859,6 +860,8 @@ notmuch_config_command_get (notmuch_config_t *config, char *item) notmuch_built_with (item + strlen (BUILT_WITH_PREFIX)) ? "true" : "false"); } else if (STRNCMP_LITERAL (item, QUERY_PREFIX) == 0) { return _print_db_config (config, item); + } else if (STRNCMP_LITERAL (item, INDEX_PREFIX) == 0) { + return _print_db_config (config, item); } else { char **value; size_t i, length; @@ -931,6 +934,9 @@ notmuch_config_command_set (notmuch_config_t *config, char *item, int argc, char if (STRNCMP_LITERAL (item, QUERY_PREFIX) == 0) { return _set_db_config (config, item, argc, argv); } + if (STRNCMP_LITERAL (item, INDEX_PREFIX) == 0) { + return _set_db_config (config, item, argc, argv); + } if (_item_split (item, &group, &key)) return 1; -- 2.14.2