v9 of batch tagging

2012-12-23 Thread David Bremner
Mark Walters writes: > On Mon, 24 Dec 2012, david at tethera.net wrote: >> Finally I added a test for the new parenthesis handling. > > My recollection is that dump prints the messages unsorted: does this > mean that we could get unstable results for these tests (eg with > different Xapian version

[Patch v9 17/17] test/tagging: add test for handling of parenthesized tag queries.

2012-12-23 Thread da...@tethera.net
From: David Bremner This test is intended to verify that '(' and ')' are passed through unscathed to Xapian to parse. --- test/tagging | 20 1 file changed, 20 insertions(+) diff --git a/test/tagging b/test/tagging index 748d947..70be943 100755 --- a/test/tagging +++ b/te

[Patch v9 16/17] test/tagging: add test for naked punctuation in tags; compare with quoting spaces.

2012-12-23 Thread da...@tethera.net
From: David Bremner This test also serves as documentation of the quoting requirements. The comment lines are so that it exactly matches the man page. Nothing more embarrassing than having an example in the man page fail. --- test/tagging | 24 1 file changed, 24 inser

[Patch v9 15/17] man: document notmuch tag --batch, --input options

2012-12-23 Thread da...@tethera.net
From: Jani Nikula --- man/man1/notmuch-tag.1 | 79 1 file changed, 79 insertions(+) diff --git a/man/man1/notmuch-tag.1 b/man/man1/notmuch-tag.1 index 9444aa4..19ccf7e 100644 --- a/man/man1/notmuch-tag.1 +++ b/man/man1/notmuch-tag.1 @@ -6,6 +6,

[Patch v9 14/17] notmuch-tag.1: tidy synopsis formatting, reference

2012-12-23 Thread da...@tethera.net
From: David Bremner Consistently use [...]; one less space. Use singular --- man/man1/notmuch-tag.1 |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/man/man1/notmuch-tag.1 b/man/man1/notmuch-tag.1 index 0f86582..9444aa4 100644 --- a/man/man1/notmuch-tag.1 +++ b/man/

[Patch v9 13/17] test/tagging: add test for compound queries with batch tagging

2012-12-23 Thread da...@tethera.net
From: David Bremner This is to watch for errors in quoting the query. --- test/tagging | 28 1 file changed, 28 insertions(+) diff --git a/test/tagging b/test/tagging index 9f66f4f..5b48cb7 100755 --- a/test/tagging +++ b/test/tagging @@ -174,6 +174,34 @@ notmuch

[Patch v9 12/17] test/tagging: add test for exotic message-ids and batch tagging

2012-12-23 Thread da...@tethera.net
From: David Bremner The (now fixed) bug that this test revealed is that unquoted message-ids with whitespace or other control characters in them are split into several tokens by the Xapian query parser. --- test/tagging | 18 ++ 1 file changed, 18 insertions(+) diff --git a/te

[Patch v9 11/17] test/tagging: add tests for exotic tags

2012-12-23 Thread da...@tethera.net
From: David Bremner We test quotes seperately because they matter to the query escaper. --- test/tagging | 66 ++ 1 file changed, 66 insertions(+) diff --git a/test/tagging b/test/tagging index 643f604..fc210d6 100755 --- a/test/tagging

[Patch v9 10/17] test/tagging: add basic tests for batch tagging functionality

2012-12-23 Thread da...@tethera.net
From: David Bremner This tests argument parsing, blank lines and comments, and basic hex decoding functionality. --- test/tagging | 51 +++ 1 file changed, 51 insertions(+) diff --git a/test/tagging b/test/tagging index 30cec48..643f604 100755 -

[Patch v9 09/17] test/tagging: add test for error messages of tag --batch

2012-12-23 Thread da...@tethera.net
From: David Bremner This is based on the similar test for notmuch restore, but the parser in batch tagging mode is less tolerant of a few cases, in particular those tested by illegal_tag. --- test/tagging | 37 + 1 file changed, 37 insertions(+) diff --git

[Patch v9 08/17] cli: add support for batch tagging operations to "notmuch tag"

2012-12-23 Thread da...@tethera.net
From: Jani Nikula Add support for batch tagging operations through stdin to "notmuch tag". This can be enabled with the new --batch command line option to "notmuch tag". The input must consist of lines of the format: +|- [...] [--] [...] Each line is interpreted similarly to "notmuch tag" comm

[Patch v9 07/17] notmuch-restore: move query handling for batch restore to parser

2012-12-23 Thread da...@tethera.net
From: David Bremner We are able to detect more errors by looking at the string before it is hex-decoded. We also need this to avoid the query quoting for more general queries (to be written) that will mess up raw message-ids. --- notmuch-restore.c | 19 ++- tag-util.c|

[Patch v9 06/17] unhex_and_quote: new function to quote hex-decoded queries

2012-12-23 Thread da...@tethera.net
From: David Bremner Space delimited tokens are hex decoded and then quoted according to Xapian rules. Prefixes and '*' are passed through unquoted, as is anything that hex-decoding would not change. --- tag-util.c | 94 1 file change

[Patch v9 05/17] util/string-util: add a new string tokenized function

2012-12-23 Thread da...@tethera.net
From: David Bremner This initial target use is in quoting queries for Xapian. We want to split into tokens, but preserve the delimiters between the tokens verbatim. --- util/string-util.c | 12 util/string-util.h | 19 +++ 2 files changed, 31 insertions(+) diff

[Patch v9 04/17] notmuch-tag: factor out double quoting routine

2012-12-23 Thread da...@tethera.net
From: David Bremner This could live in tag-util as well, but it is really nothing specific to tags (although the conventions are arguable specific to Xapian). The API is changed from "caller-allocates" to "readline-like". The scan for max tag length is pushed down into the double quoting routine

[Patch v9 03/17] notmuch-tag.c: convert to use tag-utils

2012-12-23 Thread da...@tethera.net
From: David Bremner Command line parsing is factored out into a function parse_tag_command_line in tag-utils.c. There is some duplicated code eliminated in tag_query, and a bunch of translation from using the bare tag_op structs to using that tag-utils API. --- notmuch-tag.c | 109

[Patch v9 02/17] tag-util: factor out rules for illegal tags, use in parse_tag_line

2012-12-23 Thread da...@tethera.net
From: David Bremner This will allow us to be consistent between batch tagging and command line tagging as far as what is an illegal tag. --- tag-util.c | 36 +++- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/tag-util.c b/tag-util.c index 17d7ac

[Patch v9 01/17] parse_tag_line: use enum for return value.

2012-12-23 Thread da...@tethera.net
From: David Bremner This is essentially cosmetic, since success=0 is promised by the comments in tag-utils.h. --- tag-util.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tag-util.c b/tag-util.c index 705b7ba..17d7ac2 100644 --- a/tag-util.c +++ b/tag-util.c @@ -40,1

v9 of batch tagging

2012-12-23 Thread da...@tethera.net
This obsoletes id:1356095307-22895-1-git-send-email-david at tethera.net The main changes since v8 are the rebasing against the notmuch-restore fixes in master, and the rewrite of the query (pre)-processing unhex_and_quote. This incorporates the changes of id:1356231570-28232-1-git-s

Re: v9 of batch tagging

2012-12-23 Thread David Bremner
Mark Walters writes: > On Mon, 24 Dec 2012, da...@tethera.net wrote: >> Finally I added a test for the new parenthesis handling. > > My recollection is that dump prints the messages unsorted: does this > mean that we could get unstable results for these tests (eg with > different Xapian versions)?

Re: v9 of batch tagging

2012-12-23 Thread Mark Walters
On Mon, 24 Dec 2012, da...@tethera.net wrote: > This obsoletes > > id:1356095307-22895-1-git-send-email-da...@tethera.net > > The main changes since v8 are the rebasing against the notmuch-restore > fixes in master, and the rewrite of the query (pre)-processing > unhex_and_quote. This incorp

[Patch v9 17/17] test/tagging: add test for handling of parenthesized tag queries.

2012-12-23 Thread david
From: David Bremner This test is intended to verify that '(' and ')' are passed through unscathed to Xapian to parse. --- test/tagging | 20 1 file changed, 20 insertions(+) diff --git a/test/tagging b/test/tagging index 748d947..70be943 100755 --- a/test/tagging +++ b/te

[Patch v9 15/17] man: document notmuch tag --batch, --input options

2012-12-23 Thread david
From: Jani Nikula --- man/man1/notmuch-tag.1 | 79 1 file changed, 79 insertions(+) diff --git a/man/man1/notmuch-tag.1 b/man/man1/notmuch-tag.1 index 9444aa4..19ccf7e 100644 --- a/man/man1/notmuch-tag.1 +++ b/man/man1/notmuch-tag.1 @@ -6,6 +6,

[Patch v9 16/17] test/tagging: add test for naked punctuation in tags; compare with quoting spaces.

2012-12-23 Thread david
From: David Bremner This test also serves as documentation of the quoting requirements. The comment lines are so that it exactly matches the man page. Nothing more embarrassing than having an example in the man page fail. --- test/tagging | 24 1 file changed, 24 inser

[Patch v9 10/17] test/tagging: add basic tests for batch tagging functionality

2012-12-23 Thread david
From: David Bremner This tests argument parsing, blank lines and comments, and basic hex decoding functionality. --- test/tagging | 51 +++ 1 file changed, 51 insertions(+) diff --git a/test/tagging b/test/tagging index 30cec48..643f604 100755 -

[Patch v9 14/17] notmuch-tag.1: tidy synopsis formatting, reference

2012-12-23 Thread david
From: David Bremner Consistently use [...]; one less space. Use singular --- man/man1/notmuch-tag.1 |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/man/man1/notmuch-tag.1 b/man/man1/notmuch-tag.1 index 0f86582..9444aa4 100644 --- a/man/man1/notmuch-tag.1 +++ b/man/

[Patch v9 05/17] util/string-util: add a new string tokenized function

2012-12-23 Thread david
From: David Bremner This initial target use is in quoting queries for Xapian. We want to split into tokens, but preserve the delimiters between the tokens verbatim. --- util/string-util.c | 12 util/string-util.h | 19 +++ 2 files changed, 31 insertions(+) diff

[Patch v9 13/17] test/tagging: add test for compound queries with batch tagging

2012-12-23 Thread david
From: David Bremner This is to watch for errors in quoting the query. --- test/tagging | 28 1 file changed, 28 insertions(+) diff --git a/test/tagging b/test/tagging index 9f66f4f..5b48cb7 100755 --- a/test/tagging +++ b/test/tagging @@ -174,6 +174,34 @@ notmuch

[Patch v9 11/17] test/tagging: add tests for exotic tags

2012-12-23 Thread david
From: David Bremner We test quotes seperately because they matter to the query escaper. --- test/tagging | 66 ++ 1 file changed, 66 insertions(+) diff --git a/test/tagging b/test/tagging index 643f604..fc210d6 100755 --- a/test/tagging

v9 of batch tagging

2012-12-23 Thread david
This obsoletes id:1356095307-22895-1-git-send-email-da...@tethera.net The main changes since v8 are the rebasing against the notmuch-restore fixes in master, and the rewrite of the query (pre)-processing unhex_and_quote. This incorporates the changes of id:1356231570-28232-1-git-send

[Patch v9 04/17] notmuch-tag: factor out double quoting routine

2012-12-23 Thread david
From: David Bremner This could live in tag-util as well, but it is really nothing specific to tags (although the conventions are arguable specific to Xapian). The API is changed from "caller-allocates" to "readline-like". The scan for max tag length is pushed down into the double quoting routine

[Patch v9 03/17] notmuch-tag.c: convert to use tag-utils

2012-12-23 Thread david
From: David Bremner Command line parsing is factored out into a function parse_tag_command_line in tag-utils.c. There is some duplicated code eliminated in tag_query, and a bunch of translation from using the bare tag_op structs to using that tag-utils API. --- notmuch-tag.c | 109

[Patch v9 06/17] unhex_and_quote: new function to quote hex-decoded queries

2012-12-23 Thread david
From: David Bremner Space delimited tokens are hex decoded and then quoted according to Xapian rules. Prefixes and '*' are passed through unquoted, as is anything that hex-decoding would not change. --- tag-util.c | 94 1 file change

[Patch v9 07/17] notmuch-restore: move query handling for batch restore to parser

2012-12-23 Thread david
From: David Bremner We are able to detect more errors by looking at the string before it is hex-decoded. We also need this to avoid the query quoting for more general queries (to be written) that will mess up raw message-ids. --- notmuch-restore.c | 19 ++- tag-util.c|

[Patch v9 08/17] cli: add support for batch tagging operations to "notmuch tag"

2012-12-23 Thread david
From: Jani Nikula Add support for batch tagging operations through stdin to "notmuch tag". This can be enabled with the new --batch command line option to "notmuch tag". The input must consist of lines of the format: +|- [...] [--] [...] Each line is interpreted similarly to "notmuch tag" comm

[Patch v9 12/17] test/tagging: add test for exotic message-ids and batch tagging

2012-12-23 Thread david
From: David Bremner The (now fixed) bug that this test revealed is that unquoted message-ids with whitespace or other control characters in them are split into several tokens by the Xapian query parser. --- test/tagging | 18 ++ 1 file changed, 18 insertions(+) diff --git a/te

[Patch v9 09/17] test/tagging: add test for error messages of tag --batch

2012-12-23 Thread david
From: David Bremner This is based on the similar test for notmuch restore, but the parser in batch tagging mode is less tolerant of a few cases, in particular those tested by illegal_tag. --- test/tagging | 37 + 1 file changed, 37 insertions(+) diff --git

[Patch v9 02/17] tag-util: factor out rules for illegal tags, use in parse_tag_line

2012-12-23 Thread david
From: David Bremner This will allow us to be consistent between batch tagging and command line tagging as far as what is an illegal tag. --- tag-util.c | 36 +++- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/tag-util.c b/tag-util.c index 17d7ac

[Patch v9 01/17] parse_tag_line: use enum for return value.

2012-12-23 Thread david
From: David Bremner This is essentially cosmetic, since success=0 is promised by the comments in tag-utils.h. --- tag-util.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tag-util.c b/tag-util.c index 705b7ba..17d7ac2 100644 --- a/tag-util.c +++ b/tag-util.c @@ -40,1

[PATCH] NEWS for emacs part visibility change

2012-12-23 Thread Mark Walters
--- Here is some news for the recent part visibility change. I am not completely happy with the wording so please do read. In particular should it mention how the user's preferred part is chosen (notmuch-multipart/alternative-discouraged etc)? Best wishes Mark NEWS | 10 ++ 1 files c

[PATCH] simplify unhex_and_quote

2012-12-23 Thread Mark Walters
On Sun, 23 Dec 2012, david at tethera.net wrote: > From: David Bremner > > the overgeneral definition of a prefix can be replaced by lower case > alphabetic, and still work fine with current notmuch query syntax. > > token_len++ is moved to the end, and we restore the delimiter just so > we can l

Re: gui client

2012-12-23 Thread Jameson Graef Rollins
On Fri, Dec 21 2012, Sergei Shilovsky wrote: > Is there a GUI notmuch client? Or is somebody working on it? > > I'm thinking of writing one myself, so I want to know current situation. Hi, Sergei. There are some curses front-ends [0], but I haven't heard of any GUI ones. Good luck! jamie. [0]

gui client

2012-12-23 Thread Jameson Graef Rollins
d luck! jamie. [0] http://notmuchmail.org/frontends/ -- next part -- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 835 bytes Desc: not available URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20121223/9d7de67b/attachment.pgp>

[PATCH] NEWS for emacs part visibility change

2012-12-23 Thread Mark Walters
--- Here is some news for the recent part visibility change. I am not completely happy with the wording so please do read. In particular should it mention how the user's preferred part is chosen (notmuch-multipart/alternative-discouraged etc)? Best wishes Mark NEWS | 10 ++ 1 files c

[Patch v8 01/18] parse_tag_line: use enum for return value.

2012-12-23 Thread Jani Nikula
On Fri, 21 Dec 2012, David Bremner wrote: > david at tethera.net writes: > >> From: David Bremner >> >> This is essentially cosmetic, since success=0 is promised by >> the comments in tag-utils.h. > > In an amazing display of skill and style, in attempting to abort a git > send-email run so that

[Patch v8 07/18] unhex_and_quote: new function to quote hex-decoded queries

2012-12-23 Thread Jani Nikula
On Fri, 21 Dec 2012, david at tethera.net wrote: > From: David Bremner > > Space delimited tokens are hex decoded and then quoted according to > Xapian rules. Prefixes and '*' are passed through unquoted, as is > anything that hex-decoding would not change. > --- > tag-util.c | 81 > ++

[Patch v8 09/18] cli: add support for batch tagging operations to "notmuch tag"

2012-12-23 Thread Jani Nikula
On Fri, 21 Dec 2012, david at tethera.net wrote: > From: Jani Nikula > > Add support for batch tagging operations through stdin to "notmuch > tag". This can be enabled with the new --batch command line option to > "notmuch tag". The input must consist of lines of the format: > > +|- [...] [--] [.

Re: [PATCH] simplify unhex_and_quote

2012-12-23 Thread Mark Walters
On Sun, 23 Dec 2012, da...@tethera.net wrote: > From: David Bremner > > the overgeneral definition of a prefix can be replaced by lower case > alphabetic, and still work fine with current notmuch query syntax. > > token_len++ is moved to the end, and we restore the delimiter just so > we can leav