]> git.notmuchmail.org Git - notmuch/commitdiff
lib/config: add HOOK_DIR
authorDavid Bremner <david@tethera.net>
Sat, 9 Jan 2021 13:19:50 +0000 (09:19 -0400)
committerDavid Bremner <david@tethera.net>
Sat, 6 Feb 2021 23:54:09 +0000 (19:54 -0400)
The hook directory configuration needs to be kept in synch with the
other configuration information, so add scaffolding to support this at
database opening time.

lib/config.cc
lib/notmuch.h
test/T590-libconfig.sh

index 4c0cfe9256537edb60ffdc54501cfc3ec2a106bd..948751bc84b35fd7e2de04ccba14af13e6694ad1 100644 (file)
@@ -390,6 +390,8 @@ _notmuch_config_key_to_string (notmuch_config_key_t key) {
     switch (key) {
     case NOTMUCH_CONFIG_DATABASE_PATH:
        return "database.path";
     switch (key) {
     case NOTMUCH_CONFIG_DATABASE_PATH:
        return "database.path";
+    case NOTMUCH_CONFIG_HOOK_DIR:
+       return "database.hook_dir";
     case NOTMUCH_CONFIG_EXCLUDE_TAGS:
        return "search.exclude_tags";
     case NOTMUCH_CONFIG_NEW_TAGS:
     case NOTMUCH_CONFIG_EXCLUDE_TAGS:
        return "search.exclude_tags";
     case NOTMUCH_CONFIG_NEW_TAGS:
@@ -428,6 +430,7 @@ _notmuch_config_default (void *ctx, notmuch_config_key_t key) {
        return "inbox;unread";
     case NOTMUCH_CONFIG_SYNC_MAILDIR_FLAGS:
        return "true";
        return "inbox;unread";
     case NOTMUCH_CONFIG_SYNC_MAILDIR_FLAGS:
        return "true";
+    case NOTMUCH_CONFIG_HOOK_DIR:
     case NOTMUCH_CONFIG_NEW_IGNORE:
     case NOTMUCH_CONFIG_USER_NAME:
     case NOTMUCH_CONFIG_PRIMARY_EMAIL:
     case NOTMUCH_CONFIG_NEW_IGNORE:
     case NOTMUCH_CONFIG_USER_NAME:
     case NOTMUCH_CONFIG_PRIMARY_EMAIL:
index 5e07a01a48c5ecd90874fac520101aa3e81109c7..5a5d99c0f750e2e7db2d824eea1c07263dc576e8 100644 (file)
@@ -2460,6 +2460,7 @@ notmuch_config_list_destroy (notmuch_config_list_t *config_list);
 typedef enum _notmuch_config_key {
     NOTMUCH_CONFIG_FIRST,
     NOTMUCH_CONFIG_DATABASE_PATH = NOTMUCH_CONFIG_FIRST,
 typedef enum _notmuch_config_key {
     NOTMUCH_CONFIG_FIRST,
     NOTMUCH_CONFIG_DATABASE_PATH = NOTMUCH_CONFIG_FIRST,
+    NOTMUCH_CONFIG_HOOK_DIR,
     NOTMUCH_CONFIG_EXCLUDE_TAGS,
     NOTMUCH_CONFIG_NEW_TAGS,
     NOTMUCH_CONFIG_NEW_IGNORE,
     NOTMUCH_CONFIG_EXCLUDE_TAGS,
     NOTMUCH_CONFIG_NEW_TAGS,
     NOTMUCH_CONFIG_NEW_IGNORE,
index 4edc53f129dc03c48bf8acfde1ce5fb553ea5d60..e2050b50c73b5945137aeb45a0fa213d23979aed 100755 (executable)
@@ -333,6 +333,7 @@ EOF
 cat <<'EOF' >EXPECTED
 == stdout ==
 MAIL_DIR
 cat <<'EOF' >EXPECTED
 == stdout ==
 MAIL_DIR
+NULL
 
 inbox;unread
 NULL
 
 inbox;unread
 NULL