Re: [PATCH] configure: Check if emacs >= 25 (instead of >= 24) is available

2020-08-12 Thread David Bremner
Tomi Ollila  writes:

> "The minimum supported major version of GNU Emacs is now 25.1."
>
> 25.1 is the first "released" version of Emacs 25.

applied to master.

d
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [PATCH] notmuch-mutt: replace shell pipeline with internal pipe processing

2020-08-12 Thread David Bremner
Tomi Ollila  writes:

> The shell pipeline used to symlink files based in search results
> to "cache" directory for mutt(1) to use was prone to portability
> problems (due to /bin/sh differences).
>
> The replacement executes `notmuch search` without intermediate shell
> (so shell_quote was removed in this case), reads the filenames from
> piped output and symlinks files internally.

applied to master.

d
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [PATCH v2] Emacs: Indent first header line only when indentation is turned on

2020-08-12 Thread David Bremner
Teemu Likonen  writes:


> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
> index 0eb27e33..444b2a45 100644
> --- a/emacs/notmuch-show.el
> +++ b/emacs/notmuch-show.el
> @@ -474,7 +474,10 @@ message at DEPTH in the current thread."
>;; invisible U+200E LEFT-TO-RIGHT MARK character which forces
>;; the header paragraph as left-to-right text.
>(insert (propertize (string ?\x200e) 'invisible t)))
> -(insert (notmuch-show-spaces-n (* notmuch-show-indent-messages-width 
> depth))
> +(insert (if notmuch-show-indent-content
> + (notmuch-show-spaces-n (* notmuch-show-indent-messages-width
> +   depth))
> +   "")
>   from
>   " ("
>   date

the test "notmuch-show: disable indentation of thread content (w/
notmuch-show-toggle-thread-indentation)" in T450-emacs-show needs to be
adjusted for this change (i.e. it fails as is).
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


[PATCH 2/6] lib: factor out feature name related code.

2020-08-12 Thread David Bremner
database.cc is uncomfortably large, and some of the static data
structures do not need to be shared as much as they are.

This is a somewhat small piece to factor out, but it will turn out to
be helpful to further refactoring.
---
 lib/Makefile.local |   3 +-
 lib/database-private.h |  14 +
 lib/database.cc| 118 +
 lib/features.cc| 114 +++
 4 files changed, 132 insertions(+), 117 deletions(-)
 create mode 100644 lib/features.cc

diff --git a/lib/Makefile.local b/lib/Makefile.local
index a6400126..04418fa8 100644
--- a/lib/Makefile.local
+++ b/lib/Makefile.local
@@ -59,7 +59,8 @@ libnotmuch_cxx_srcs = \
$(dir)/config.cc\
$(dir)/regexp-fields.cc \
$(dir)/thread.cc \
-   $(dir)/thread-fp.cc
+   $(dir)/thread-fp.cc \
+   $(dir)/features.cc
 
 libnotmuch_modules := $(libnotmuch_c_srcs:.c=.o) $(libnotmuch_cxx_srcs:.cc=.o)
 
diff --git a/lib/database-private.h b/lib/database-private.h
index 041602cd..2d220811 100644
--- a/lib/database-private.h
+++ b/lib/database-private.h
@@ -32,6 +32,8 @@
 
 #include "notmuch-private.h"
 
+#define ARRAY_SIZE(arr) (sizeof (arr) / sizeof (arr[0]))
+
 #ifdef SILENCE_XAPIAN_DEPRECATION_WARNINGS
 #define XAPIAN_DEPRECATED(D) D
 #endif
@@ -263,4 +265,16 @@ _notmuch_database_find_doc_ids (notmuch_database_t 
*notmuch,
const char *value,
Xapian::PostingIterator *begin,
Xapian::PostingIterator *end);
+
+#define NOTMUCH_DATABASE_VERSION 3
+
+/* features.cc */
+
+_notmuch_features
+_notmuch_database_parse_features (const void *ctx, const char *features, 
unsigned int version,
+ char mode, char **incompat_out);
+
+char *
+_notmuch_database_print_features (const void *ctx, unsigned int features);
+
 #endif
diff --git a/lib/database.cc b/lib/database.cc
index 75189685..e08d43ca 100644
--- a/lib/database.cc
+++ b/lib/database.cc
@@ -39,8 +39,6 @@
 
 using namespace std;
 
-#define ARRAY_SIZE(arr) (sizeof (arr) / sizeof (arr[0]))
-
 typedef struct {
 const char *name;
 const char *prefix;
@@ -458,41 +456,6 @@ _notmuch_database_prefix (notmuch_database_t *notmuch, 
const char *name)
 return NULL;
 }
 
-static const struct {
-/* NOTMUCH_FEATURE_* value. */
-_notmuch_features value;
-/* Feature name as it appears in the database.  This name should
- * be appropriate for displaying to the user if an older version
- * of notmuch doesn't support this feature. */
-const char *name;
-/* Compatibility flags when this feature is declared. */
-const char *flags;
-} feature_names[] = {
-{ NOTMUCH_FEATURE_FILE_TERMS,
-  "multiple paths per message", "rw" },
-{ NOTMUCH_FEATURE_DIRECTORY_DOCS,
-  "relative directory paths", "rw" },
-/* Header values are not required for reading a database because a
- * reader can just refer to the message file. */
-{ NOTMUCH_FEATURE_FROM_SUBJECT_ID_VALUES,
-  "from/subject/message-ID in database", "w" },
-{ NOTMUCH_FEATURE_BOOL_FOLDER,
-  "exact folder:/path: search", "rw" },
-{ NOTMUCH_FEATURE_GHOSTS,
-  "mail documents for missing messages", "w" },
-/* Knowledge of the index mime-types are not required for reading
- * a database because a reader will just be unable to query
- * them. */
-{ NOTMUCH_FEATURE_INDEXED_MIMETYPES,
-  "indexed MIME types", "w" },
-{ NOTMUCH_FEATURE_LAST_MOD,
-  "modification tracking", "w" },
-/* Existing databases will work fine for all queries not involving
- * 'body:' */
-{ NOTMUCH_FEATURE_UNPREFIX_BODY_ONLY,
-  "index body and headers separately", "w" },
-};
-
 const char *
 notmuch_status_to_string (notmuch_status_t status)
 {
@@ -817,83 +780,6 @@ _notmuch_database_new_revision (notmuch_database_t 
*notmuch)
 return new_revision;
 }
 
-/* Parse a database features string from the given database version.
- * Returns the feature bit set.
- *
- * For version < 3, this ignores the features string and returns a
- * hard-coded set of features.
- *
- * If there are unrecognized features that are required to open the
- * database in mode (which should be 'r' or 'w'), return a
- * comma-separated list of unrecognized but required features in
- * *incompat_out suitable for presenting to the user.  *incompat_out
- * will be allocated from ctx.
- */
-static _notmuch_features
-_parse_features (const void *ctx, const char *features, unsigned int version,
-char mode, char **incompat_out)
-{
-_notmuch_features res = static_cast<_notmuch_features>(0);
-unsigned int namelen, i;
-size_t llen = 0;
-const char *flags;
-
-/* Prior to database version 3, features were implied by the
- * version number. */
-if (version == 0)
-   return NOTMUCH_FEATURES_V0;
-else if (version == 1)
-   return 

[PATCH 6/6] lib: factor out notmuch_database_open* related code to own file

2020-08-12 Thread David Bremner
Reduce the size of database.cc, and prepare for extending the database
opening API
---
 lib/Makefile.local |   3 +-
 lib/database.cc| 219 -
 lib/open.cc| 218 
 3 files changed, 220 insertions(+), 220 deletions(-)
 create mode 100644 lib/open.cc

diff --git a/lib/Makefile.local b/lib/Makefile.local
index 3aa9e80f..ddd169dc 100644
--- a/lib/Makefile.local
+++ b/lib/Makefile.local
@@ -61,7 +61,8 @@ libnotmuch_cxx_srcs = \
$(dir)/thread.cc \
$(dir)/thread-fp.cc \
$(dir)/features.cc  \
-   $(dir)/prefix.cc
+   $(dir)/prefix.cc\
+   $(dir)/open.cc
 
 
 libnotmuch_modules := $(libnotmuch_c_srcs:.c=.o) $(libnotmuch_cxx_srcs:.cc=.o)
diff --git a/lib/database.cc b/lib/database.cc
index defa3062..0f4e2ff9 100644
--- a/lib/database.cc
+++ b/lib/database.cc
@@ -19,10 +19,6 @@
  */
 
 #include "database-private.h"
-#include "parse-time-vrp.h"
-#include "query-fp.h"
-#include "thread-fp.h"
-#include "regexp-fields.h"
 #include "string-util.h"
 
 #include 
@@ -50,12 +46,6 @@ typedef struct {
 #define STRINGIFY(s) _SUB_STRINGIFY (s)
 #define _SUB_STRINGIFY(s) #s
 
-#if HAVE_XAPIAN_DB_RETRY_LOCK
-#define DB_ACTION (Xapian::DB_CREATE_OR_OPEN | Xapian::DB_RETRY_LOCK)
-#else
-#define DB_ACTION Xapian::DB_CREATE_OR_OPEN
-#endif
-
 #define LOG_XAPIAN_EXCEPTION(message, error) _log_xapian_exception 
(__location__, message, error)
 
 static void
@@ -594,215 +584,6 @@ _notmuch_database_new_revision (notmuch_database_t 
*notmuch)
 return new_revision;
 }
 
-notmuch_status_t
-notmuch_database_open (const char *path,
-  notmuch_database_mode_t mode,
-  notmuch_database_t **database)
-{
-char *status_string = NULL;
-notmuch_status_t status;
-
-status = notmuch_database_open_verbose (path, mode, database,
-   _string);
-
-if (status_string) {
-   fputs (status_string, stderr);
-   free (status_string);
-}
-
-return status;
-}
-
-notmuch_status_t
-notmuch_database_open_verbose (const char *path,
-  notmuch_database_mode_t mode,
-  notmuch_database_t **database,
-  char **status_string)
-{
-notmuch_status_t status = NOTMUCH_STATUS_SUCCESS;
-void *local = talloc_new (NULL);
-notmuch_database_t *notmuch = NULL;
-char *notmuch_path, *xapian_path, *incompat_features;
-char *message = NULL;
-struct stat st;
-int err;
-unsigned int i, version;
-static int initialized = 0;
-
-if (path == NULL) {
-   message = strdup ("Error: Cannot open a database for a NULL path.\n");
-   status = NOTMUCH_STATUS_NULL_POINTER;
-   goto DONE;
-}
-
-if (path[0] != '/') {
-   message = strdup ("Error: Database path must be absolute.\n");
-   status = NOTMUCH_STATUS_PATH_ERROR;
-   goto DONE;
-}
-
-if (! (notmuch_path = talloc_asprintf (local, "%s/%s", path, ".notmuch"))) 
{
-   message = strdup ("Out of memory\n");
-   status = NOTMUCH_STATUS_OUT_OF_MEMORY;
-   goto DONE;
-}
-
-err = stat (notmuch_path, );
-if (err) {
-   IGNORE_RESULT (asprintf (, "Error opening database at %s: %s\n",
-notmuch_path, strerror (errno)));
-   status = NOTMUCH_STATUS_FILE_ERROR;
-   goto DONE;
-}
-
-if (! (xapian_path = talloc_asprintf (local, "%s/%s", notmuch_path, 
"xapian"))) {
-   message = strdup ("Out of memory\n");
-   status = NOTMUCH_STATUS_OUT_OF_MEMORY;
-   goto DONE;
-}
-
-/* Initialize the GLib type system and threads */
-#if ! GLIB_CHECK_VERSION (2, 35, 1)
-g_type_init ();
-#endif
-
-/* Initialize gmime */
-if (! initialized) {
-   g_mime_init ();
-   initialized = 1;
-}
-
-notmuch = talloc_zero (NULL, notmuch_database_t);
-notmuch->exception_reported = false;
-notmuch->status_string = NULL;
-notmuch->path = talloc_strdup (notmuch, path);
-
-strip_trailing (notmuch->path, '/');
-
-notmuch->writable_xapian_db = NULL;
-notmuch->atomic_nesting = 0;
-notmuch->view = 1;
-try {
-   string last_thread_id;
-   string last_mod;
-
-   if (mode == NOTMUCH_DATABASE_MODE_READ_WRITE) {
-   notmuch->writable_xapian_db = new Xapian::WritableDatabase 
(xapian_path,
-   
DB_ACTION);
-   notmuch->xapian_db = notmuch->writable_xapian_db;
-   } else {
-   notmuch->xapian_db = new Xapian::Database (xapian_path);
-   }
-
-   /* Check version.  As of database version 3, we represent
-* changes in terms of features, so assume a version bump
-* means a dramatically incompatible change. */
-   version = notmuch_database_get_version (notmuch);
-   if (version > 

preliminaries for merged config

2020-08-12 Thread David Bremner
This collects all of the patches from 
id:20200808141653.1124111-1-da...@tethera.net that
are reasonable changes on their own, without wading into the new API design.

Two updates to tests

[PATCH 1/6] test: use keys with group 'test' in T590-libconfig
[PATCH 5/6] test: add regression test for searching with alternate

Three patches breaking up database.cc

[PATCH 2/6] lib: factor out feature name related code.
[PATCH 3/6] lib: factor out prefix related code to its own file
[PATCH 6/6] lib: factor out notmuch_database_open* related code to

One genuine (if a bit obscure) bug fix:

[PATCH 4/6] lib/config: delay setting talloc destructor

___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


[PATCH 3/6] lib: factor out prefix related code to its own file

2020-08-12 Thread David Bremner
Reduce the size of database.cc, and limit the scope of prefix_table,
make sure it's accessed via a well-defined internal API.
---
 lib/Makefile.local |   4 +-
 lib/database-private.h |   7 ++
 lib/database.cc| 201 ++-
 lib/prefix.cc  | 210 +
 4 files changed, 228 insertions(+), 194 deletions(-)
 create mode 100644 lib/prefix.cc

diff --git a/lib/Makefile.local b/lib/Makefile.local
index 04418fa8..3aa9e80f 100644
--- a/lib/Makefile.local
+++ b/lib/Makefile.local
@@ -60,7 +60,9 @@ libnotmuch_cxx_srcs = \
$(dir)/regexp-fields.cc \
$(dir)/thread.cc \
$(dir)/thread-fp.cc \
-   $(dir)/features.cc
+   $(dir)/features.cc  \
+   $(dir)/prefix.cc
+
 
 libnotmuch_modules := $(libnotmuch_c_srcs:.c=.o) $(libnotmuch_cxx_srcs:.cc=.o)
 
diff --git a/lib/database-private.h b/lib/database-private.h
index 2d220811..c9bc712b 100644
--- a/lib/database-private.h
+++ b/lib/database-private.h
@@ -277,4 +277,11 @@ _notmuch_database_parse_features (const void *ctx, const 
char *features, unsigne
 char *
 _notmuch_database_print_features (const void *ctx, unsigned int features);
 
+/* prefix.cc */
+notmuch_status_t
+_notmuch_database_setup_standard_query_fields (notmuch_database_t *notmuch);
+
+notmuch_status_t
+_notmuch_database_setup_user_query_fields (notmuch_database_t *notmuch);
+
 #endif
diff --git a/lib/database.cc b/lib/database.cc
index e08d43ca..defa3062 100644
--- a/lib/database.cc
+++ b/lib/database.cc
@@ -263,80 +263,6 @@ _notmuch_database_mode (notmuch_database_t *notmuch)
  * same thread.
  */
 
-/* With these prefix values we follow the conventions published here:
- *
- * https://xapian.org/docs/omega/termprefixes.html
- *
- * as much as makes sense. Note that I took some liberty in matching
- * the reserved prefix values to notmuch concepts, (for example, 'G'
- * is documented as "newsGroup (or similar entity - e.g. a web forum
- * name)", for which I think the thread is the closest analogue in
- * notmuch. This in spite of the fact that we will eventually be
- * storing mailing-list messages where 'G' for "mailing list name"
- * might be even a closer analogue. I'm treating the single-character
- * prefixes preferentially for core notmuch concepts (which will be
- * nearly universal to all mail messages).
- */
-
-static const
-prefix_t prefix_table[] = {
-/* nameterm prefix flags */
-{ "type",   "T",NOTMUCH_FIELD_NO_FLAGS },
-{ "reference",  "XREFERENCE",   NOTMUCH_FIELD_NO_FLAGS },
-{ "replyto","XREPLYTO", NOTMUCH_FIELD_NO_FLAGS },
-{ "directory",  "XDIRECTORY",   NOTMUCH_FIELD_NO_FLAGS },
-{ "file-direntry",  "XFDIRENTRY",   NOTMUCH_FIELD_NO_FLAGS },
-{ "directory-direntry", "XDDIRENTRY",   NOTMUCH_FIELD_NO_FLAGS },
-{ "body",   "", NOTMUCH_FIELD_EXTERNAL |
-  NOTMUCH_FIELD_PROBABILISTIC },
-{ "thread", "G",NOTMUCH_FIELD_EXTERNAL |
-  NOTMUCH_FIELD_PROCESSOR },
-{ "tag","K",NOTMUCH_FIELD_EXTERNAL |
-  NOTMUCH_FIELD_PROCESSOR },
-{ "is", "K",NOTMUCH_FIELD_EXTERNAL |
-  NOTMUCH_FIELD_PROCESSOR },
-{ "id", "Q",NOTMUCH_FIELD_EXTERNAL },
-{ "mid","Q",NOTMUCH_FIELD_EXTERNAL |
-  NOTMUCH_FIELD_PROCESSOR },
-{ "path",   "P",NOTMUCH_FIELD_EXTERNAL |
-  NOTMUCH_FIELD_PROCESSOR },
-{ "property",   "XPROPERTY",NOTMUCH_FIELD_EXTERNAL },
-/*
- * Unconditionally add ':' to reduce potential ambiguity with
- * overlapping prefixes and/or terms that start with capital
- * letters. See Xapian document termprefixes.html for related
- * discussion.
- */
-{ "folder", "XFOLDER:", NOTMUCH_FIELD_EXTERNAL |
-  NOTMUCH_FIELD_PROCESSOR },
-{ "date",   NULL,   NOTMUCH_FIELD_EXTERNAL |
-  NOTMUCH_FIELD_PROCESSOR },
-{ "query",  NULL,   NOTMUCH_FIELD_EXTERNAL |
-  NOTMUCH_FIELD_PROCESSOR },
-{ "from",   "XFROM",NOTMUCH_FIELD_EXTERNAL |
-  NOTMUCH_FIELD_PROBABILISTIC |
-  NOTMUCH_FIELD_PROCESSOR },
-{ "to", "XTO",  NOTMUCH_FIELD_EXTERNAL |
-  NOTMUCH_FIELD_PROBABILISTIC },
-{ "attachment", "XATTACHMENT",  NOTMUCH_FIELD_EXTERNAL |
-  NOTMUCH_FIELD_PROBABILISTIC },
-{ "mimetype",   "XMIMETYPE",NOTMUCH_FIELD_EXTERNAL |
-  NOTMUCH_FIELD_PROBABILISTIC },
-{ "subject","XSUBJECT", NOTMUCH_FIELD_EXTERNAL |
-  NOTMUCH_FIELD_PROBABILISTIC |
-  NOTMUCH_FIELD_PROCESSOR },
-};
-
-static void
-_setup_query_field_default 

[PATCH 1/6] test: use keys with group 'test' in T590-libconfig

2020-08-12 Thread David Bremner
In a future commit we want to interoperate better with glib KeyFiles,
which need groups for all keys.
---
 test/T590-libconfig.sh | 36 ++--
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/test/T590-libconfig.sh b/test/T590-libconfig.sh
index 360e45b0..8c34acf9 100755
--- a/test/T590-libconfig.sh
+++ b/test/T590-libconfig.sh
@@ -28,18 +28,18 @@ EOF
 test_begin_subtest "notmuch_database_{set,get}_config"
 cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
 {
-   EXPECT0(notmuch_database_set_config (db, "testkey1", "testvalue1"));
-   EXPECT0(notmuch_database_set_config (db, "testkey2", "testvalue2"));
-   EXPECT0(notmuch_database_get_config (db, "testkey1", ));
-   printf("testkey1 = %s\n", val);
-   EXPECT0(notmuch_database_get_config (db, "testkey2", ));
-   printf("testkey2 = %s\n", val);
+   EXPECT0(notmuch_database_set_config (db, "test.key1", "testvalue1"));
+   EXPECT0(notmuch_database_set_config (db, "test.key2", "testvalue2"));
+   EXPECT0(notmuch_database_get_config (db, "test.key1", ));
+   printf("test.key1 = %s\n", val);
+   EXPECT0(notmuch_database_get_config (db, "test.key2", ));
+   printf("test.key2 = %s\n", val);
 }
 EOF
 cat <<'EOF' >EXPECTED
 == stdout ==
-testkey1 = testvalue1
-testkey2 = testvalue2
+test.key1 = testvalue1
+test.key2 = testvalue2
 == stderr ==
 EOF
 test_expect_equal_file EXPECTED OUTPUT
@@ -93,8 +93,8 @@ EOF
 cat <<'EOF' >EXPECTED
 == stdout ==
 aaabefore beforeval
-testkey1 testvalue1
-testkey2 testvalue2
+test.key1 testvalue1
+test.key2 testvalue2
 zzzafter afterval
 == stderr ==
 EOF
@@ -115,8 +115,8 @@ EOF
 cat <<'EOF' >EXPECTED
 == stdout ==
 aaabefore 1
-testkey1 1
-testkey2 1
+test.key1 1
+test.key2 1
 zzzafter 1
 == stderr ==
 EOF
@@ -126,7 +126,7 @@ test_begin_subtest "notmuch_database_get_config_list: one 
prefix"
 cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
 {
notmuch_config_list_t *list;
-   EXPECT0(notmuch_database_get_config_list (db, "testkey", ));
+   EXPECT0(notmuch_database_get_config_list (db, "test.key", ));
for (; notmuch_config_list_valid (list); notmuch_config_list_move_to_next 
(list)) {
   printf("%s %s\n", notmuch_config_list_key (list), 
notmuch_config_list_value(list));
}
@@ -135,8 +135,8 @@ cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
 EOF
 cat <<'EOF' >EXPECTED
 == stdout ==
-testkey1 testvalue1
-testkey2 testvalue2
+test.key1 testvalue1
+test.key2 testvalue2
 == stderr ==
 EOF
 test_expect_equal_file EXPECTED OUTPUT
@@ -152,8 +152,8 @@ cat <<'EOF' >EXPECTED
 #notmuch-dump batch-tag:3 config
 #@ aaabefore beforeval
 #@ key%20with%20spaces value,%20with,%20spaces%21
-#@ testkey1 testvalue1
-#@ testkey2 testvalue2
+#@ test.key1 testvalue1
+#@ test.key2 testvalue2
 #@ zzzafter afterval
 EOF
 test_expect_equal_file EXPECTED OUTPUT
@@ -162,7 +162,7 @@ test_begin_subtest "restore config"
 notmuch dump --include=config >EXPECTED
 cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
 {
-EXPECT0(notmuch_database_set_config (db, "testkey1", "mutatedvalue"));
+EXPECT0(notmuch_database_set_config (db, "test.key1", "mutatedvalue"));
 }
 EOF
 notmuch restore --include=config 

[PATCH 5/6] test: add regression test for searching with alternate config

2020-08-12 Thread David Bremner
Make sure upcoming changes to config handling do not break command
line specification.
---
 test/T140-excludes.sh | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/test/T140-excludes.sh b/test/T140-excludes.sh
index 0cf69975..cef07095 100755
--- a/test/T140-excludes.sh
+++ b/test/T140-excludes.sh
@@ -39,6 +39,16 @@ deleted_id=$gen_msg_id
 output=$(notmuch search subject:deleted | notmuch_search_sanitize)
 test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; 
Not deleted (inbox unread)"
 
+test_begin_subtest "Search, exclude \"deleted\" messages; alternate config 
file"
+cp ${NOTMUCH_CONFIG} alt-config
+notmuch config set search.exclude_tags
+notmuch --config=alt-config search subject:deleted | notmuch_search_sanitize > 
OUTPUT
+cp alt-config ${NOTMUCH_CONFIG}
+cat < EXPECTED
+thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Not deleted (inbox unread)
+EOF
+test_expect_equal_file EXPECTED OUTPUT
+
 test_begin_subtest "Search, exclude \"deleted\" messages from message search"
 output=$(notmuch search --output=messages subject:deleted | 
notmuch_search_sanitize)
 test_expect_equal "$output" "id:$not_deleted_id"
-- 
2.28.0
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


[PATCH 4/6] lib/config: delay setting talloc destructor

2020-08-12 Thread David Bremner
If Xapian has thrown an exception, it is not safe to invoke the
destuctor when freeing the list struct.
---
 lib/config.cc | 12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/lib/config.cc b/lib/config.cc
index dae0ff0e..d0497052 100644
--- a/lib/config.cc
+++ b/lib/config.cc
@@ -113,7 +113,6 @@ notmuch_database_get_config_list (notmuch_database_t 
*notmuch,
goto DONE;
 }
 
-talloc_set_destructor (list, _notmuch_config_list_destroy);
 list->notmuch = notmuch;
 list->current_key = NULL;
 list->current_val = NULL;
@@ -133,8 +132,15 @@ notmuch_database_get_config_list (notmuch_database_t 
*notmuch,
 *out = list;
 
   DONE:
-if (status && list)
-   talloc_free (list);
+if (status) {
+   if (list) {
+   talloc_free (list);
+   if (status != NOTMUCH_STATUS_XAPIAN_EXCEPTION)
+   _notmuch_config_list_destroy (list);
+   }
+}  else {
+   talloc_set_destructor (list, _notmuch_config_list_destroy);
+}
 
 return status;
 }
-- 
2.28.0
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: New release for Emacs 27.1?

2020-08-12 Thread Damien Cassou
Tomi Ollila  writes:
> Release cycle for 0.31 could be shorter, just for that reason. 


To fix the build, I updated Notmuch package in Nixpkgs: this will now
use commit 1c80020e701c7323de137c0616fc8864443d7bd3.

-- 
Damien Cassou

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org