unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: notmuch@notmuchmail.org
Subject: [PATCH 2/3] lib/config: add known config key "show.extra_headers"
Date: Sat,  1 Jan 2022 08:01:35 -0400	[thread overview]
Message-ID: <20220101120136.37988-3-david@tethera.net> (raw)
In-Reply-To: <20220101120136.37988-1-david@tethera.net>

Used in a following commit to enable including extra headers beyond
the default in structured output.
---
 lib/config.cc          | 3 +++
 lib/notmuch.h          | 1 +
 test/T590-libconfig.sh | 4 ++++
 3 files changed, 8 insertions(+)

diff --git a/lib/config.cc b/lib/config.cc
index 7a2882de..97060f8b 100644
--- a/lib/config.cc
+++ b/lib/config.cc
@@ -596,6 +596,8 @@ _notmuch_config_key_to_string (notmuch_config_key_t key)
 	return "user.name";
     case NOTMUCH_CONFIG_AUTOCOMMIT:
 	return "database.autocommit";
+    case NOTMUCH_CONFIG_EXTRA_HEADERS:
+	return "show.extra_headers";
     default:
 	return NULL;
     }
@@ -643,6 +645,7 @@ _notmuch_config_default (notmuch_database_t *notmuch, notmuch_config_key_t key)
 	return "";
     case NOTMUCH_CONFIG_AUTOCOMMIT:
 	return "8000";
+    case NOTMUCH_CONFIG_EXTRA_HEADERS:
     case NOTMUCH_CONFIG_HOOK_DIR:
     case NOTMUCH_CONFIG_BACKUP_DIR:
     case NOTMUCH_CONFIG_OTHER_EMAIL:
diff --git a/lib/notmuch.h b/lib/notmuch.h
index 1b2bdf3f..a75a42be 100644
--- a/lib/notmuch.h
+++ b/lib/notmuch.h
@@ -2546,6 +2546,7 @@ typedef enum {
     NOTMUCH_CONFIG_OTHER_EMAIL,
     NOTMUCH_CONFIG_USER_NAME,
     NOTMUCH_CONFIG_AUTOCOMMIT,
+    NOTMUCH_CONFIG_EXTRA_HEADERS,
     NOTMUCH_CONFIG_LAST
 } notmuch_config_key_t;
 
diff --git a/test/T590-libconfig.sh b/test/T590-libconfig.sh
index eb303444..7ee4bb11 100755
--- a/test/T590-libconfig.sh
+++ b/test/T590-libconfig.sh
@@ -439,6 +439,7 @@ cat <<'EOF' >EXPECTED
 09: 'NULL'
 10: 'USER_FULL_NAME'
 11: '8000'
+12: 'NULL'
 == stderr ==
 EOF
 unset MAILDIR
@@ -749,6 +750,7 @@ cat <<'EOF' >EXPECTED
 09: 'test_suite_other@notmuchmail.org;test_suite@otherdomain.org'
 10: 'Notmuch Test Suite'
 11: '8000'
+12: 'NULL'
 == stderr ==
 EOF
 test_expect_equal_file EXPECTED OUTPUT
@@ -782,6 +784,7 @@ cat <<'EOF' >EXPECTED
 09: 'NULL'
 10: 'USER_FULL_NAME'
 11: '8000'
+12: 'NULL'
 == stderr ==
 EOF
 test_expect_equal_file EXPECTED OUTPUT.clean
@@ -858,6 +861,7 @@ maildir.synchronize_flags true
 new.ignore sekrit_junk
 new.tags unread;inbox
 search.exclude_tags foo;bar;fub
+show.extra_headers (null)
 test.key1 testvalue1
 test.key2 testvalue2
 user.name Notmuch Test Suite
-- 
2.34.1

  parent reply	other threads:[~2022-01-01 12:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-01 12:01 support extra headers in notmuch show v2 David Bremner
2022-01-01 12:01 ` [PATCH 1/3] CLI: stash pointer to database in sprinter structs David Bremner
2022-01-18 12:14   ` David Bremner
2022-01-18 13:26     ` [PATCH] doc: document new option `show.extra_headers` David Bremner
2022-01-25 11:57       ` David Bremner
2022-01-01 12:01 ` David Bremner [this message]
2022-01-01 12:01 ` [PATCH 3/3] CLI: print extra headers in structured output David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220101120136.37988-3-david@tethera.net \
    --to=david@tethera.net \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).