lib/config: add known config key "show.extra_headers"

Used in a following commit to enable including extra headers beyond
the default in structured output.
This commit is contained in:
David Bremner 2022-01-01 08:01:35 -04:00
parent 417d202e64
commit 79936ac93e
3 changed files with 8 additions and 0 deletions

View file

@ -596,6 +596,8 @@ _notmuch_config_key_to_string (notmuch_config_key_t key)
return "user.name"; return "user.name";
case NOTMUCH_CONFIG_AUTOCOMMIT: case NOTMUCH_CONFIG_AUTOCOMMIT:
return "database.autocommit"; return "database.autocommit";
case NOTMUCH_CONFIG_EXTRA_HEADERS:
return "show.extra_headers";
default: default:
return NULL; return NULL;
} }
@ -643,6 +645,7 @@ _notmuch_config_default (notmuch_database_t *notmuch, notmuch_config_key_t key)
return ""; return "";
case NOTMUCH_CONFIG_AUTOCOMMIT: case NOTMUCH_CONFIG_AUTOCOMMIT:
return "8000"; return "8000";
case NOTMUCH_CONFIG_EXTRA_HEADERS:
case NOTMUCH_CONFIG_HOOK_DIR: case NOTMUCH_CONFIG_HOOK_DIR:
case NOTMUCH_CONFIG_BACKUP_DIR: case NOTMUCH_CONFIG_BACKUP_DIR:
case NOTMUCH_CONFIG_OTHER_EMAIL: case NOTMUCH_CONFIG_OTHER_EMAIL:

View file

@ -2550,6 +2550,7 @@ typedef enum {
NOTMUCH_CONFIG_OTHER_EMAIL, NOTMUCH_CONFIG_OTHER_EMAIL,
NOTMUCH_CONFIG_USER_NAME, NOTMUCH_CONFIG_USER_NAME,
NOTMUCH_CONFIG_AUTOCOMMIT, NOTMUCH_CONFIG_AUTOCOMMIT,
NOTMUCH_CONFIG_EXTRA_HEADERS,
NOTMUCH_CONFIG_LAST NOTMUCH_CONFIG_LAST
} notmuch_config_key_t; } notmuch_config_key_t;

View file

@ -439,6 +439,7 @@ cat <<'EOF' >EXPECTED
09: 'NULL' 09: 'NULL'
10: 'USER_FULL_NAME' 10: 'USER_FULL_NAME'
11: '8000' 11: '8000'
12: 'NULL'
== stderr == == stderr ==
EOF EOF
unset MAILDIR unset MAILDIR
@ -749,6 +750,7 @@ cat <<'EOF' >EXPECTED
09: 'test_suite_other@notmuchmail.org;test_suite@otherdomain.org' 09: 'test_suite_other@notmuchmail.org;test_suite@otherdomain.org'
10: 'Notmuch Test Suite' 10: 'Notmuch Test Suite'
11: '8000' 11: '8000'
12: 'NULL'
== stderr == == stderr ==
EOF EOF
test_expect_equal_file EXPECTED OUTPUT test_expect_equal_file EXPECTED OUTPUT
@ -782,6 +784,7 @@ cat <<'EOF' >EXPECTED
09: 'NULL' 09: 'NULL'
10: 'USER_FULL_NAME' 10: 'USER_FULL_NAME'
11: '8000' 11: '8000'
12: 'NULL'
== stderr == == stderr ==
EOF EOF
test_expect_equal_file EXPECTED OUTPUT.clean test_expect_equal_file EXPECTED OUTPUT.clean
@ -858,6 +861,7 @@ maildir.synchronize_flags true
new.ignore sekrit_junk new.ignore sekrit_junk
new.tags unread;inbox new.tags unread;inbox
search.exclude_tags foo;bar;fub search.exclude_tags foo;bar;fub
show.extra_headers (null)
test.key1 testvalue1 test.key1 testvalue1
test.key2 testvalue2 test.key2 testvalue2
user.name Notmuch Test Suite user.name Notmuch Test Suite