Re: [PATCH v3 00/15] reply refactor, fixes

2016-09-13 Thread Tomi Ollila
On Tue, Sep 13 2016, Jani Nikula wrote: > Updated version of [1] to address David's review comments, mostly just > commit message updates. Also incorporates the multiple corpora support > from [2], with the commit message extended a bit, and rebasing patch 2 > on top of it. I

[PATCH v3 15/15] cli/reply: only pass gmime message to add recipients to reply message

2016-09-13 Thread Jani Nikula
The notmuch message is no longer needed. Simplify. --- notmuch-reply.c | 37 ++--- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/notmuch-reply.c b/notmuch-reply.c index 5421ca80116e..8c894974485d 100644 --- a/notmuch-reply.c +++ b/notmuch-reply.c

[PATCH v3 09/15] cli/reply: reduce the reply format abstractions

2016-09-13 Thread Jani Nikula
Now that we've made the various reply formats quite similar to each other, there's no point in keeping the abstractions. They are now close enough to be put in one function. For now, a mime node will be uselessly created for the headers-only case, but this is insignificant, and may change in the

[PATCH v3 10/15] cli/reply: use dedicated functions for reply to mapping

2016-09-13 Thread Jani Nikula
The main motivation here is to move the special casing around reply-to/from handling into a function of its own, clarifying the main logic. --- notmuch-reply.c | 82 ++--- 1 file changed, 49 insertions(+), 33 deletions(-) diff --git

[PATCH v3 08/15] cli/reply: reuse create_reply_message() also for headers-only format

2016-09-13 Thread Jani Nikula
Add an option for "limited" headers for the (slightly misleadingly named) headers-only format. There should be no functional changes. --- notmuch-reply.c | 46 +++--- 1 file changed, 15 insertions(+), 31 deletions(-) diff --git a/notmuch-reply.c

[PATCH v3 13/15] cli/reply: do not parse Reply-To: header into internet address list twice

2016-09-13 Thread Jani Nikula
Avoid parsing Reply-To: header into internet address list twice. Move the parsing outside of reply_to_header_is_redundant(), and pass the parsed internet address list in as parameter. This also avoids leaking the memory of one copy of the internet address list. --- notmuch-reply.c | 20

[PATCH v3 11/15] cli/reply: check for NULL list first in scan_address_list()

2016-09-13 Thread Jani Nikula
Support passing NULL list later on. Also use it to simplify the recursion. --- notmuch-reply.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/notmuch-reply.c b/notmuch-reply.c index 9b78ea2c2b20..d90f46f9bed3 100644 --- a/notmuch-reply.c +++ b/notmuch-reply.c @@ -192,6

[PATCH v3 12/15] cli/reply: return internet address list from get header funcs

2016-09-13 Thread Jani Nikula
Pass in GMimeMessage to simplify To/Cc/Bcc headers. We'll eventually remove the notmuch message passing altogether, but keep both for now to not make too big changes at once. Getting the headers from GMimeMessage using GMime functions fixes the error on duplicate Cc headers reported by Daniel

[PATCH v3 06/15] cli/reply: reorganize create_reply_message()

2016-09-13 Thread Jani Nikula
Again, in preparation for later unification, reorganize create_reply_message() to be more similar to the headers-only format reply code in notmuch_reply_format_headers_only(). Due to "pretty" header ordering, there should be no change in output. There should be no functional changes. ---

[PATCH v3 07/15] cli/reply: make references header creation easier to follow

2016-09-13 Thread Jani Nikula
Just use strdup when original references is not available, instead of trying to cram everything into a monster asprintf. There should be no functional changes. --- notmuch-reply.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/notmuch-reply.c b/notmuch-reply.c

[PATCH v3 03/15] cli/reply: push notmuch reply format abstraction lower in the stack

2016-09-13 Thread Jani Nikula
There's quite a bit of duplication, and some consequent deviation, between the various notmuch reply format code paths. Perform the query and message iteration in common code, and make the format specific functions operate on single messages. There should be no functional changes. ---

[PATCH v3 05/15] cli/reply: unify reply format functions

2016-09-13 Thread Jani Nikula
Prepare for further future unification by making the code similar. The only functional change is that errors in mime_node_open() also break execution in default reply format. --- notmuch-reply.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git

[PATCH v3 04/15] cli/reply: reuse show_reply_headers() in headers-only format

2016-09-13 Thread Jani Nikula
Align the code with default format reply. There should be no changes in output. --- notmuch-reply.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/notmuch-reply.c b/notmuch-reply.c index 847e306f94d2..5adbab624ad7 100644 --- a/notmuch-reply.c +++ b/notmuch-reply.c @@

[PATCH v3 02/15] test: add known broken test for reply to message with multiple Cc headers

2016-09-13 Thread Jani Nikula
As Daniel Kahn Gillmor reports in id:87d1ngv95p@alice.fifthhorseman.net, notmuch show combines multiple Cc: fields into one, while notmuch reply does not. While such messages are in violation of RFC 5322, it would be reasonable to expect notmuch to be consistent. Add a

[PATCH v3 00/15] reply refactor, fixes

2016-09-13 Thread Jani Nikula
Updated version of [1] to address David's review comments, mostly just commit message updates. Also incorporates the multiple corpora support from [2], with the commit message extended a bit, and rebasing patch 2 on top of it. BR, Jani. [1] id:cover.1471088022.git.j...@nikula.org [2]

[PATCH v3 01/15] test: make it possible to have multiple corpora

2016-09-13 Thread Jani Nikula
We largely use the corpus under test/corpus for testing. Unfortunately, many of our tests have grown to depend on having exactly this set of messages, making it hard to add new message files for testing specific cases. We do use a lot of add_message from within the tests, but it's not possible to

Re: [PATCH v2] emacs: reply: remove wrong sig/enc status buttons

2016-09-13 Thread Mark Walters
On Tue, 13 Sep 2016, Daniel Kahn Gillmor wrote: > [ Unknown signature status ] > Hi Mark-- > > On Tue 2016-09-13 00:12:19 +0200, Mark Walters wrote: >> This stopps the (usually incorrect) sigstatus and encstatus buttons >> appearing when replying in emacs, and updates the