From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id EFfyAELjE2MNnQAAbAwnHQ (envelope-from ) for ; Sun, 04 Sep 2022 01:29:06 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id SBPgAELjE2OtXQEAauVa8A (envelope-from ) for ; Sun, 04 Sep 2022 01:29:06 +0200 Received: from mail.notmuchmail.org (yantan.tethera.net [135.181.149.255]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id A1FC0F2DE for ; Sun, 4 Sep 2022 01:29:05 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 706355FD30; Sat, 3 Sep 2022 23:28:54 +0000 (UTC) Received: from fethera.tethera.net (fethera.tethera.net [IPv6:2607:5300:60:c5::1]) by mail.notmuchmail.org (Postfix) with ESMTP id 02C685F390 for ; Sat, 3 Sep 2022 23:28:52 +0000 (UTC) Received: by fethera.tethera.net (Postfix, from userid 1001) id 43D265FBC0; Sat, 3 Sep 2022 19:28:50 -0400 (EDT) Received: (nullmailer pid 1474094 invoked by uid 1000); Sat, 03 Sep 2022 23:28:47 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: [PATCH 1/3] lib: add config key INDEX_AS_TEXT Date: Sat, 3 Sep 2022 20:28:37 -0300 Message-Id: <20220903232839.1473915-2-david@tethera.net> X-Mailer: git-send-email 2.35.2 In-Reply-To: <20220903232839.1473915-1-david@tethera.net> References: <20220903232839.1473915-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: Y3AAPBLUTGHSJLY67KAALPBU6CD4UTSH X-Message-ID-Hash: Y3AAPBLUTGHSJLY67KAALPBU6CD4UTSH X-MailFrom: bremner@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: DE ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1662247745; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post; bh=s+x5pOEPfFqOfckBFD0m7GquCPubLARN9zBcA+dLfQo=; b=C5LLJ70VYmAYjPpJSnb899CUcNZvmrbAiaKP2abUjKZQf7yeCS7JyxS8a5agpKC+EGqifA 5ysr/5dfA2WtJNdDVgkM/DuZ2jaDnJyUvprTZMCiyrwreXM8lzg1qhn5Yq4H1KCDlt75FL F/Mm1cX3eRSi4+6PRQ8cT51avf8mkWJ/Nkk2SXv1uEsI9JPbI0XiY//EFZI3D4YyfJg/lN KbT2NVW+aMVbML5wiL9bm0dnN+yxQtUbi3S8+0kHBF923Pdi1z3R3t6FNou3LqkHbbnuON APldd9C/i89Dz8XyJSAE20FBJejMW+7gLY7iFBXFQP/7bbrIvNadBEBBktoYtg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1662247745; a=rsa-sha256; cv=none; b=bigUyMD9OIoRJTrb28XDQkRTR/bn/ZUWOgiI0HWp+C6SZQKI+XjBJSakGOEHhoOo/VH1FT XYCU/ixohQZZhJcwxHZt1HIeHgEPUS9mrPzhtdiJoKwARQzV5K5OTpKaQOEKI73vYXvqNP rkKgLxFXFkpD7MEnV+6vD3JX9cM5kebYU12cB4Iw22o/bXmKLbBfN7MpWhswzvpBeW5xmN tzNHV/DMep+dOlj+Avc4yd5zgG5aBKn/zKe+jxFOxP7svy6JmhKO+z3DGhrLcyUJ6SNMnU p3ro12WNFVvRwLxqtDmq9luRmFZ1q6dwkC4resKx2FZmsCIBfkR53DWzA297jw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -1.32 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: A1FC0F2DE X-Spam-Score: -1.32 X-Migadu-Scanner: scn1.migadu.com X-TUID: dXFPPG7RH09k Higher level processing as a list of regular expressions and documentation will follow. --- lib/config.cc | 3 +++ lib/notmuch.h | 1 + test/T030-config.sh | 1 + test/T055-path-config.sh | 1 + test/T590-libconfig.sh | 5 +++++ 5 files changed, 11 insertions(+) diff --git a/lib/config.cc b/lib/config.cc index 503a0c8b..2323860d 100644 --- a/lib/config.cc +++ b/lib/config.cc @@ -599,6 +599,8 @@ _notmuch_config_key_to_string (notmuch_config_key_t key) return "database.autocommit"; case NOTMUCH_CONFIG_EXTRA_HEADERS: return "show.extra_headers"; + case NOTMUCH_CONFIG_INDEX_AS_TEXT: + return "index.as_text"; default: return NULL; } @@ -642,6 +644,7 @@ _notmuch_config_default (notmuch_database_t *notmuch, notmuch_config_key_t key) else email = _get_email_from_passwd_file (notmuch); return email; + case NOTMUCH_CONFIG_INDEX_AS_TEXT: case NOTMUCH_CONFIG_NEW_IGNORE: return ""; case NOTMUCH_CONFIG_AUTOCOMMIT: diff --git a/lib/notmuch.h b/lib/notmuch.h index 0b0540b1..935a8d59 100644 --- a/lib/notmuch.h +++ b/lib/notmuch.h @@ -2558,6 +2558,7 @@ typedef enum { NOTMUCH_CONFIG_USER_NAME, NOTMUCH_CONFIG_AUTOCOMMIT, NOTMUCH_CONFIG_EXTRA_HEADERS, + NOTMUCH_CONFIG_INDEX_AS_TEXT, NOTMUCH_CONFIG_LAST } notmuch_config_key_t; diff --git a/test/T030-config.sh b/test/T030-config.sh index 43bbce31..ea0b4012 100755 --- a/test/T030-config.sh +++ b/test/T030-config.sh @@ -57,6 +57,7 @@ database.mail_root=MAIL_DIR database.path=MAIL_DIR foo.list=this;is another;list value; foo.string=this is another string value +index.as_text= maildir.synchronize_flags=true new.ignore= new.tags=unread;inbox diff --git a/test/T055-path-config.sh b/test/T055-path-config.sh index fe295324..efc79e8b 100755 --- a/test/T055-path-config.sh +++ b/test/T055-path-config.sh @@ -299,6 +299,7 @@ database.backup_dir database.hook_dir database.mail_root=MAIL_DIR database.path +index.as_text= maildir.synchronize_flags=true new.ignore= new.tags=unread;inbox diff --git a/test/T590-libconfig.sh b/test/T590-libconfig.sh index 26a1f033..9326ba3e 100755 --- a/test/T590-libconfig.sh +++ b/test/T590-libconfig.sh @@ -440,6 +440,7 @@ cat <<'EOF' >EXPECTED 10: 'USER_FULL_NAME' 11: '8000' 12: 'NULL' +13: '' == stderr == EOF unset MAILDIR @@ -725,6 +726,7 @@ test_expect_equal_file EXPECTED OUTPUT test_begin_subtest "list by keys (ndlc)" notmuch config set search.exclude_tags "foo;bar;fub" notmuch config set new.ignore "sekrit_junk" +notmuch config set index.as_text "text/" cat c_head2 - c_tail <<'EOF' | test_C ${MAIL_DIR} %NULL% %NULL% { notmuch_config_key_t key; @@ -751,6 +753,7 @@ cat <<'EOF' >EXPECTED 10: 'Notmuch Test Suite' 11: '8000' 12: 'NULL' +13: 'text/' == stderr == EOF test_expect_equal_file EXPECTED OUTPUT @@ -785,6 +788,7 @@ cat <<'EOF' >EXPECTED 10: 'USER_FULL_NAME' 11: '8000' 12: 'NULL' +13: '' == stderr == EOF test_expect_equal_file EXPECTED OUTPUT.clean @@ -856,6 +860,7 @@ database.backup_dir MAIL_DIR/.notmuch/backups database.hook_dir MAIL_DIR/.notmuch/hooks database.mail_root MAIL_DIR database.path MAIL_DIR +index.as_text text/ key with spaces value, with, spaces! maildir.synchronize_flags true new.ignore sekrit_junk -- 2.35.2