[PATCH v2 2/9] cli: abstract new mailbox creation

2015-09-03 Thread Jani Nikula
We'll be needing more mailbox creation soon, so abstract it away. While at it, check for allocation failures. No other functional changes. --- notmuch-search.c | 23 +++ 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/notmuch-search.c b/notmuch-search.c index

[PATCH v2 1/9] cli: g_hash_table_lookup_extended is overkill

2015-09-03 Thread Jani Nikula
Switch to normal glib hash table lookup. The extended version is only required if the values may contain NULL. --- notmuch-search.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/notmuch-search.c b/notmuch-search.c index 3076c3f637b1..7fdc6acaa2fe

[PATCH v2 5/9] util: move strcase_equal and strcase_hash to util

2015-09-03 Thread Jani Nikula
For future use in both cli and lib. --- lib/message-file.c| 21 - lib/notmuch-private.h | 1 + util/string-util.c| 21 + util/string-util.h| 6 ++ 4 files changed, 28 insertions(+), 21 deletions(-) diff --git a/lib/message-file.c

[PATCH v2 0/9] cli: alternative address deduplication

2015-09-03 Thread Jani Nikula
This is v2 of id:cover.1440859765.git.j...@nikula.org addressing review from the first (or rfc) version. Test are still missing, but everything else should be in place. (At least patches 1, 2, and 5 could be pushed without additional tests.) There's also one bug fix in patch 7. It is necessary to

[PATCH v2 3/9] cli: add support for not deduplicating notmuch address results

2015-09-03 Thread Jani Nikula
Make it possible to use notmuch address as part of a | sort | uniq -c pipe instead of forcing --output=count. This is useful for combining results from multiple notmuch address queries. --- notmuch-search.c | 21 - 1 file changed, 20 insertions(+), 1 deletion(-) diff --git

[PATCH v2 7/9] cli: add support for deduplicating based on case insensitive address

2015-09-03 Thread Jani Nikula
Consider all variants of an email address as one, and print the most common variant. --- notmuch-search.c | 48 ++-- 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/notmuch-search.c b/notmuch-search.c index 7c51d5df6bd4..deb9e58a747c

[PATCH v2 4/9] man: document notmuch address --deduplicate=(no|mailbox) option

2015-09-03 Thread Jani Nikula
Document the deduplication of results. --- doc/man1/notmuch-address.rst | 15 +++ 1 file changed, 15 insertions(+) diff --git a/doc/man1/notmuch-address.rst b/doc/man1/notmuch-address.rst index 9570095b23c8..4ae7395bce4d 100644 --- a/doc/man1/notmuch-address.rst +++

[PATCH v2 6/9] cli: change the data structure for notmuch address deduplication

2015-09-03 Thread Jani Nikula
Currently we key the address hash table with the case sensitive "name ". Switch to case insensitive keying with just address, and store the case sensitive name and address in linked lists. This will be helpful in adding support for different deduplication schemes in the future. There will be a

[PATCH v2 9/9] cli: do not sort addresses on --output=count or --deduplicate=address

2015-09-03 Thread Jani Nikula
The order of the results with --output=count and --deduplicate=address are unspecified as they're based on a hash table traversal. This being the case, optimize the query by explicitly requesting unsorted results. Clarify the documentation accordingly. --- doc/man1/notmuch-address.rst | 4 +++-

[PATCH v2 8/9] man: document notmuch address --deduplicate=address option

2015-09-03 Thread Jani Nikula
Document the deduplication based on case insensitive address. --- doc/man1/notmuch-address.rst | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/man1/notmuch-address.rst b/doc/man1/notmuch-address.rst index 4ae7395bce4d..b85cc37213e5 100644 ---

[PATCH] test: add "set -u" to test-lib.sh

2015-09-03 Thread Tomi Ollila
This prohibits unset variables to expand to empty strings. Without this e.g misspelled variables cause unintentional results. Now all the test variables are either initialized, or in case of optional arguments and user-provided environment variables the form ${variable-} is used. Two unusable

Re: [PATCH] emacs: wrap current search in parens when filtering

2015-09-03 Thread Tomi Ollila
On Thu, Sep 03 2015, Uli Scholler wrote: > When filtering the current search further with notmuch-search-filter, > wrap the current search in parens. > > This fixes unexpected behavior when the current search is > complex (like "(tag:this and date:one_week_ago..) or

[PATCH] emacs: wrap current search in parens when filtering

2015-09-03 Thread Uli Scholler
When filtering the current search further with notmuch-search-filter, wrap the current search in parens. This fixes unexpected behavior when the current search is complex (like "(tag:this and date:one_week_ago..) or tag:that"). --- emacs/notmuch.el | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v2] emacs: wrap current search in parens when filtering

2015-09-03 Thread Uli Scholler
Tomi Ollila writes: > But should this do the same "notmuch-search-disjunctive-regexp" check > which is done when building up `grouped-query' ? Here is an improved version of my patch: --- When filtering the current search further with notmuch-search-filter, wrap the current