[PATCH 4/8] lib: push error from nme_metadata through nme_filename_list

2017-02-18 Thread David Bremner
The NULL returns documented here are not actually API changing, they were just previously undocumented. --- lib/message.cc | 20 +--- lib/notmuch.h | 4 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/lib/message.cc b/lib/message.cc index 16ea980c..f55dd9fa

[PATCH 6/8] lib: propagate errors from nme_metadata through properties API

2017-02-18 Thread David Bremner
The NULL return here is not API breaking, since the NULL from _string_map_create could previously be returned. --- lib/message-private.h | 4 ++-- lib/message-property.cc | 17 +++-- lib/message.cc | 28 lib/notmuch.h | 6 -- 4

[PATCH 5/8] lib: make _notmuch_message_ensure_property_map static

2017-02-18 Thread David Bremner
It's not called outside message.cc --- lib/message.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/message.cc b/lib/message.cc index f55dd9fa..80fbd5ab 100644 --- a/lib/message.cc +++ b/lib/message.cc @@ -1823,7 +1823,7 @@ _notmuch_message_database (notmuch_message_t

[PATCH 1/8] lib: make _notmuch_message_ensure_metadata static

2017-02-18 Thread David Bremner
It's not called anywhere outside message.cc. --- lib/message.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/message.cc b/lib/message.cc index 9d3e8071..9455b11d 100644 --- a/lib/message.cc +++ b/lib/message.cc @@ -310,7 +310,7 @@ _notmuch_message_get_term

[PATCH 2/8] lib: add status return to _notmuch_message_ensure_metadata

2017-02-18 Thread David Bremner
This is currently silently ignored everywhere, but that's not much worse than crashing with an uncaught (and maybe uncatchable) exception. --- lib/message.cc | 135 ++--- 1 file changed, 72 insertions(+), 63 deletions(-) diff --git

[PATCH 3/8] lib: propagate error return from some calls to _n_m_e_metadata

2017-02-18 Thread David Bremner
In this commit we take care of the easy cases, where _n_m_e_metadata is called from a non-void function. Three tricker cases are left for future commits. --- lib/message.cc | 15 +++ lib/notmuch.h | 9 - 2 files changed, 15 insertions(+), 9 deletions(-) diff --git

[PATCH 8/8] lib: add status return to notmuch_message_get_flag

2017-02-18 Thread David Bremner
This is needed to propagate errors from notmuch_message_ensure_metadata. We make all the changes needed to keep the code compiling in atomically in this commit. --- lib/database.cc | 9 ++--- lib/message.cc | 21 - lib/notmuch.h| 10 -- lib/thread.cc|

add status value to _notmuch_message_ensure_metadata

2017-02-18 Thread David Bremner
In id:1487339566.mz8acpov1j.astr...@strange.none , Gaute provided a traceback of an uncaught Xapian::DatabaseModifiedError. The fix for this is simple, but somewhat intrusive. This patch series catches any Xapian exceptions in _notmuch_message_ensure_metadata and converts them into status returns

[PATCH 7/8] lib: add notmuch_message_get_database to public API

2017-02-18 Thread David Bremner
This is to facilitate error handling, specifically retrieval of log messages from the notmuch database struct. --- lib/index.cc| 6 +++--- lib/message-property.cc | 4 ++-- lib/message.cc | 12 ++-- lib/notmuch-private.h | 2 -- lib/notmuch.h | 6

[PATCH 3/4] lib: query make exclude handling non-destructive

2017-02-18 Thread David Bremner
We filter added exclude at add time, rather than modifying the query by count search. As noted in the comments, there are several ignored conditions here. Returning proper status is split into a separate commit because it is ABI breaking. --- lib/query.cc | 47

[PATCH 4/4] lib: make notmuch_query_add_tag_exclude return a status value

2017-02-18 Thread David Bremner
Since this is an ABI breaking change, bump the SONAME. --- lib/notmuch.h| 23 +++ lib/query.cc | 7 --- notmuch-count.c | 9 +++-- notmuch-search.c | 12 ++-- notmuch-show.c | 13 +++-- 5 files changed, 51 insertions(+), 13 deletions(-)

[PATCH 2/4] lib/query: make query parsing lazy again, keep centralized.

2017-02-18 Thread David Bremner
This is mainly to fix the nasty error path introduced in the last commit, by moving the parsing into functions where the API is already set up to return error status. It preserves the feature of having a pre-parsed query available for further processing. --- lib/query.cc | 37

[PATCH 1/4] lib: eagerly parse queries

2017-02-18 Thread David Bremner
Rather than waiting for a call to count/search, parse the query string when the notmuch_query_t is created. This is a small reduction in duplicated code, and a potential efficiency improvement if many count/search operations are called on the same query (although the latter sounds a bit unusual).

v4 of nondestructive excludes patches.

2017-02-18 Thread David Bremner
This is just a rebase against master. In combination with id:20170218144551.22925-1-da...@tethera.net, I think the SONAME bump is justifiable. ___ notmuch mailing list notmuch@notmuchmail.org https://notmuchmail.org/mailman/listinfo/notmuch

Re: notmuch version/Python bindings

2017-02-18 Thread David Bremner
Sebastian Spaeth writes: > Hi there, I did stop using notmuch, true. Let me know if I should hand > over administration or if I shouldnsimply delete the package on pypi. > Hi Sebastian; Thanks for the followup. If no-one steps up to maintain by the end of next week, I'd