[PATCH v3 11/15] config: indexing defaults will be stored in the database.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Mon Oct 9 22:49:12 PDT 2017


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



More information about the notmuch mailing list