[PATCH 6/9] test: ensure test_begin_subtest has been called before test_expect_*

2017-02-26 Thread Jani Nikula
This is the expectation, increase robustness of the test suite by requiring it. --- test/test-lib.sh | 9 + 1 file changed, 9 insertions(+) diff --git a/test/test-lib.sh b/test/test-lib.sh index 0a486f4cde9a..056483c47c0a 100644 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -566,6

[PATCH 9/9] test: require test_begin_subtest before test_expect_code

2017-02-26 Thread Jani Nikula
Unify the subtests by requiring test_begin_subtest before test_expect_code. (Similar change for test_expect_success has already been done.) This increases clarity in the test scripts by having a separate line for the start of the subtest with the heading, and makes it possible to simplify the

[PATCH 3/9] test: remove unused test_external and test_external_without_stderr

2017-02-26 Thread Jani Nikula
They've been unused since their introduction in commit 0083854b1204 ("Copy test framework from Git"), only causing maintenance burden. --- test/test-lib.sh | 59 1 file changed, 59 deletions(-) diff --git a/test/test-lib.sh

[PATCH 4/9] test: remove unused and no-op --long-tests parameter

2017-02-26 Thread Jani Nikula
It's been unused since its introduction in commit 0083854b1204 ("Copy test framework from Git"). --- test/test-lib.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/test-lib.sh b/test/test-lib.sh index 218a06527f88..44c510517f97 100644 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@

[PATCH 1/9] test: remove unused regexp convenience variables

2017-02-26 Thread Jani Nikula
They've been unused since their introduction in commit 0083854b1204 ("Copy test framework from Git"). --- test/test-lib.sh | 9 - 1 file changed, 9 deletions(-) diff --git a/test/test-lib.sh b/test/test-lib.sh index d8e159437ca9..b136fb949ec1 100644 --- a/test/test-lib.sh +++

[PATCH 2/9] test: remove unused filter functions

2017-02-26 Thread Jani Nikula
They've been unused since their introduction in commit 0083854b1204 ("Copy test framework from Git"). --- test/test-lib.sh | 27 --- 1 file changed, 27 deletions(-) diff --git a/test/test-lib.sh b/test/test-lib.sh index b136fb949ec1..2ccb62eec122 100644 ---

[PATCH 5/9] test: only accept short and long options, not silly in-betweens

2017-02-26 Thread Jani Nikula
It's not notmuch style to accept sloppy parameter names. --- test/test-lib.sh | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/test-lib.sh b/test/test-lib.sh index 44c510517f97..0a486f4cde9a 100644 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -113,15

[PATCH 8/9] test: require test_begin_subtest before test_expect_success

2017-02-26 Thread Jani Nikula
Unify the subtests by requiring test_begin_subtest before test_expect_success. (Similar change for test_expect_code will follow.) This increases clarity in the test scripts by having a separate line for the start of the subtest with the heading, and makes it possible to simplify the test

[PATCH 7/9] test: drop the implicit prereq check mechanism from test_expect_*

2017-02-26 Thread Jani Nikula
The only place where we use the implicit prereq check is T000-basic.sh where we check that it works. It's an added complication that we don't use. Remove it. The test_have_prereq function can still be used for the same effect in subtests that use test_begin_subtest. For now, this will make it

[PATCH 0/9] test: cleanup and refactoring

2017-02-26 Thread Jani Nikula
The first half is cleanups, throwing out unused stuff. The second half requires test_begin_subtest before *all* subtests. BR, Jani. Jani Nikula (9): test: remove unused regexp convenience variables test: remove unused filter functions test: remove unused test_external and

[PATCH 2/3] test: print test description also for failing known broken tests

2017-02-26 Thread Jani Nikula
With the test description, the user can see the test script name, and debug with that alone. --- test/test-lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test-lib.sh b/test/test-lib.sh index d8e159437ca9..2d9efa0ba799 100644 --- a/test/test-lib.sh +++

[PATCH 1/3] test: shrink T590-thread-breakage test decription to one line

2017-02-26 Thread Jani Nikula
The test description is used for log output, I think the intention is to keep it as a one-liner. Leave the rest of the long description as a comment. --- test/T590-thread-breakage.sh | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git

[PATCH 3/3] test: suppress diff for broken test without V=1

2017-02-26 Thread Jani Nikula
Known broken tests are, well, known broken. Do not print the result diff for them unless V=1 is specified. Now that the test description is printed also when known broken tests fail, the user can also skip to running the individual failing tests. --- test/Makefile.local | 2 +- test/test-lib.sh

Re: [PATCH 1/2] cli/show: list all filenames of a message in the formatted output

2017-02-26 Thread David Bremner
Jani Nikula writes: > Instead of just having the first filename for the message, list all > duplicate filenames of the message as a list in the formatted > outputs. This bumps the format version to 3. > > --- > > v2: fix tests, and fix bugs found by the added tests :) series

Re: [PATCH] emacs: use (system-name) instead of system-name

2017-02-26 Thread David Bremner
Jani Nikula writes: > Fix the deprecation warning: > > In notmuch-maildir-fcc-make-uniq-maildir-id: > emacs/notmuch-maildir-fcc.el:279:53:Warning: ‘system-name’ is an obsolete > variable (as of 25.1); use (system-name) instead pushed to master d

Re: [PATCH 1/2] cli/show: list all filenames of a message in the formatted output

2017-02-26 Thread Tomi Ollila
On Sat, Feb 25 2017, Jani Nikula wrote: > Instead of just having the first filename for the message, list all > duplicate filenames of the message as a list in the formatted > outputs. This bumps the format version to 3. > > --- Looks good to me. Tests pass. Tomi > > v2: fix

Re: [PATCH] emacs: use (system-name) instead of system-name

2017-02-26 Thread Tomi Ollila
On Sun, Feb 26 2017, Jani Nikula wrote: > Fix the deprecation warning: > > In notmuch-maildir-fcc-make-uniq-maildir-id: > emacs/notmuch-maildir-fcc.el:279:53:Warning: ‘system-name’ is an obsolete > variable (as of 25.1); use (system-name) instead > > I've used (system-name)

Re: v2 _notmuch_message_ensure_metadata exception handling

2017-02-26 Thread David Bremner
Jani Nikula writes: > On Sat, 25 Feb 2017, David Bremner wrote: >> I tried to address most of Jani's comments on v1 [1]. The bad news is >> that the test is a bit delicate, it really does need the whole corpus. > > Too bad. I hope it's not too dependent on

Re: [PATCH] test: fix tests for content-disposition

2017-02-26 Thread David Bremner
Mark Walters writes: > This fixes all tests for the recent addition of content-disposition to > the structured format outputs of notmuch-show. > --- > > Since Jani added the content-disposition as I wanted to use it from emacs > (thanks Jani!) > I thought I should fix

Re: v2 _notmuch_message_ensure_metadata exception handling

2017-02-26 Thread Jani Nikula
On Sat, 25 Feb 2017, David Bremner wrote: > I tried to address most of Jani's comments on v1 [1]. The bad news is > that the test is a bit delicate, it really does need the whole corpus. Too bad. I hope it's not too dependent on the environment and the phase of the Moon, etc.

[PATCH] emacs: use (system-name) instead of system-name

2017-02-26 Thread Jani Nikula
Fix the deprecation warning: In notmuch-maildir-fcc-make-uniq-maildir-id: emacs/notmuch-maildir-fcc.el:279:53:Warning: ‘system-name’ is an obsolete variable (as of 25.1); use (system-name) instead I've used (system-name) since at least 2011, so it must have been around quite a while. ---

Re: [PATCH] lib: remove notmuch_query_{count, search}_{threads, messages}

2017-02-26 Thread Tomi Ollila
On Sat, Feb 25 2017, David Bremner wrote: > Jani Nikula writes: > >> On Wed, 22 Feb 2017, David Bremner wrote: >>> These 4 functions were originally deprecated in notmuch 0.21, more >>> than a year ago. >> >> This leaves the

Re: [patch v5 4/6] lib: regexp matching in 'subject' and 'from'

2017-02-26 Thread Jani Nikula
On Thu, 16 Feb 2017, David Bremner wrote: > the idea is that you can run > > % notmuch search subject:// > % notmuch search from:// > > or > > % notmuch search subject:"your usual phrase search" > % notmuch search from:"usual phrase search" > > This feature is only available

[PATCH v2 2/2] cli/show: add content-disposition to structured output message parts

2017-02-26 Thread Jani Nikula
Help the clients decide how to display parts. Test updates by Mark Walters . --- devel/schemata | 2 ++ notmuch-show.c | 6 ++ test/T160-json.sh | 2 +- test/T170-sexp.sh | 2 +- test/T190-multipart.sh | 22 ++

[PATCH v2 1/2] cli/show: abstract get content disposition

2017-02-26 Thread Jani Nikula
Reduce duplication in follow-up work. As a side effect, handle error returns from g_mime_content_disposition_get_disposition() without segfaulting. --- notmuch-show.c | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/notmuch-show.c b/notmuch-show.c index

[PATCH 1/2] cli/config: don't try to open config file for 'notmuch help'

2017-02-26 Thread Jani Nikula
The help command does not really need to try to open the config file. So don't. --- This will allow better error reporting such as id:1483570332-11820-1-git-send-email-tomi.oll...@iki.fi while still ensuring 'notmuch help' succeeds in the absence of config files. --- notmuch-client.h | 7

[PATCH 2/2] notmuch-config: ENOENT vs generic handling when file open fails.

2017-02-26 Thread Jani Nikula
From: Tomi Ollila When opening configuration file fails, ENOENT (file not found) is handled specially -- in setup missing file is ok (often expected), and otherwise user can be informed to run notmuch setup. In any other case the the reason is unknown, so there is no other

Re: [patch v5 5/6] lib: add mid: as a synonym for id:

2017-02-26 Thread Jani Nikula
On Thu, 16 Feb 2017, David Bremner wrote: > mid: is the url scheme suggested by URL 2392. We also plan to > introduce more flexible searches for mid: than are possible with > id: (in order not to break assumptions about the special behaviour of > id:, e.g. identifying at most

[PATCH 5/6] lib: replace deprecated n_q_count_messages with status returning version

2017-02-26 Thread David Bremner
This function was deprecated in notmuch 0.21. We re-use the name for a status returning version, and deprecate the _st name. One or two remaining uses of the (removed) non-status returning version fixed at the same time --- bindings/python/notmuch/query.py | 2 +- bindings/ruby/query.c

[PATCH 3/6] lib: replace deprecated n_q_search_messages with status returning version

2017-02-26 Thread David Bremner
This function was deprecated in notmuch 0.21. We re-use the name for a status returning version, and deprecate the _st name. --- bindings/python/notmuch/query.py | 6 +++--- bindings/ruby/query.c| 2 +- lib/database.cc | 2 +- lib/notmuch.h| 22

v2 remove notmuch_query_{count,search}_{threads,messages}

2017-02-26 Thread David Bremner
After some discussion on IRC, here's a second version. This both removes the old versions, and steals the name. I've intentionally written notmuch 0.25 in the comments, as I'd like to merge these changes, or something like them at the beginning of the 0.25 cycle. Origininally I thought that some

[PATCH 4/6] fixup! lib: replace deprecated n_q_search_messages with status returning version

2017-02-26 Thread David Bremner
--- bindings/python/notmuch/query.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/python/notmuch/query.py b/bindings/python/notmuch/query.py index 9942a2bc..a91bb740 100644 --- a/bindings/python/notmuch/query.py +++ b/bindings/python/notmuch/query.py @@ -177,7

[PATCH 2/6] lib: replace n_query_search_threads with status returning version

2017-02-26 Thread David Bremner
This function was deprecated in notmuch 0.21. We finally remove the deprecated API, and rename the status returning version to the simpler name. The status returning is kept as a deprecated alias. --- bindings/python/notmuch/query.py | 10 +- bindings/ruby/query.c| 2 +-

[PATCH 6/6] lib: replace deprecated n_q_count_threads with status returning version

2017-02-26 Thread David Bremner
This function was deprecated in notmuch 0.21. We re-use the name for a status returning version, and deprecate the _st name. --- bindings/python/notmuch/query.py | 2 +- bindings/ruby/query.c| 2 +- lib/notmuch.h| 16 +++- lib/query.cc

[PATCH 1/6] lib: bump SONAME to libnotmuch5

2017-02-26 Thread David Bremner
We plan a sequence of ABI breaking changes. Put the SONAME change in a separate commit to make reordering easier. --- lib/notmuch.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/notmuch.h b/lib/notmuch.h index 16da8be9..af4efbc8 100644 --- a/lib/notmuch.h +++

Re: [PATCH] test: fix tests for content-disposition

2017-02-26 Thread Jani Nikula
On Sun, 26 Feb 2017, David Bremner wrote: > Mark Walters writes: > >> This fixes all tests for the recent addition of content-disposition to >> the structured format outputs of notmuch-show. >> --- >> >> Since Jani added the content-disposition as I

Re: [patch v5 3/6] lib: create field processors from prefix table

2017-02-26 Thread Jani Nikula
On Thu, 16 Feb 2017, David Bremner wrote: > This is a bit more code than hardcoding the two existing field > processors, but it should make it easy to add more. > --- > lib/database-private.h | 3 ++- > lib/database.cc| 45 +++--

Re: [PATCH 1/2] cli/config: don't try to open config file for 'notmuch help'

2017-02-26 Thread Tomi Ollila
On Sun, Feb 26 2017, Jani Nikula wrote: > The help command does not really need to try to open the config > file. So don't. > > --- I've forgotten this ... added notmuch::0.24 to this series and will check carefully and test tomorrow... Tomi > > This will allow better error

[RFC PATCH] doc: add support for adding configure options as Sphinx tags

2017-02-26 Thread Jani Nikula
Add the configure options specified in $(TAGS) that equal 1 as tags on the Sphinx command line using the -t option. The tags may be used to conditionally include documentation using the Sphinx "only" directive [1]. As an example, indicate in the documentation whether the Xapian field processor is

[PATCH 4/4] lib: Add regexp searching for mid: prefix

2017-02-26 Thread David Bremner
The bulk of the change is passing in the field options to the regexp field processor, so that we can properly handle the fallback (non-regexp case). --- lib/database.cc | 6 -- lib/regexp-fields.cc | 28 +--- lib/regexp-fields.h | 4 +++-

[PATCH 2/4] lib: regexp matching in 'subject' and 'from'

2017-02-26 Thread David Bremner
the idea is that you can run % notmuch search subject:// % notmuch search from:// or % notmuch search subject:"your usual phrase search" % notmuch search from:"usual phrase search" This feature is only available with recent Xapian, specifically support for field processors is needed. It

[PATCH 3/4] lib: add mid: as a synonym for id:

2017-02-26 Thread David Bremner
mid: is the url scheme suggested by URL 2392. We also plan to introduce more flexible searches for mid: than are possible with id: (in order not to break assumptions about the special behaviour of id:, e.g. identifying at most one message). --- lib/database.cc | 1 + test/T080-search.sh | 6

[PATCH 1/4] lib: create field processors from prefix table

2017-02-26 Thread David Bremner
This is a bit more code than hardcoding the two existing field processors, but it should make it easy to add more. --- lib/database-private.h | 3 ++- lib/database.cc| 62 +++--- 2 files changed, 46 insertions(+), 19 deletions(-) diff --git

v6 of regexp searching

2017-02-26 Thread David Bremner
This obsoletes the unmerged patches from id:20170217030754.32069-1-da...@tethera.net The first two I plan to merge for 0.24 (barring corrections or objections) [PATCH 1/4] lib: create field processors from prefix table [PATCH 2/4] lib: regexp matching in 'subject' and 'from' The second