Re: [PATCH v8 0/3] notmuch-search: Structured Output Formatters

2012-07-24 Thread David Bremner
cra...@gmx.net writes: This patch series amends the situation by introducing structured formatters, which allow different implementations of structures like lists, maps, strings and numbers. pushed, d ___ notmuch mailing list

Re: [PATCH v4 0/8] emacs: JSON-based search cleanups

2012-07-24 Thread David Bremner
Austin Clements amdra...@mit.edu writes: This version fixes several bugs found in the previous version. pushed, d ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch

Re: [PATCH] emacs: Fix notmuch-message-mark-replied.

2012-07-24 Thread David Bremner
Ingo Lohmar i.loh...@gmail.com writes: notmuch-message-mark-replied used apply to change message tags according to notmuch-message-replied-tags after sending a reply. This works if the latter is a single-element list. But with the recently changed format of tag changes, it breaks for

Re: notmuch-emacs and bbdb

2012-07-24 Thread Daniel Reusche
On 22.07.2012 02:24, Daniel Bergey wrote: Glad to hear I have another user! Your welcome, nice snippet! My function bbdb/notmuch-snarf-to doesn't work yet on more than one recipient. Probably not before late August, though. Well, if I find some time, I will at least try it too. best, dan

Re: [PATCH v2 0/4] Add a --body option to notmuch show

2012-07-24 Thread David Bremner
Mark Walters markwalters1...@gmail.com writes: Version 2 of this patch set (version 1 at id:1343060241-18283-1-git-send-email-markwalters1...@gmail.com). This corrects the errors Austin spotted in v1, and makes it explicit that --body=false and --part0 are incompatible. 2/4 doesn't apply

[PATCH v2 (rebased) 0/4] Add a --body option to notmuch show

2012-07-24 Thread Mark Walters
This is a rebased version of the series id:1343066259-22523-1-git-send-email-markwalters1...@gmail.com It is otherwise unchanged. (The rebase is a change in the context part of the test patch). Best wishes Mark Mark Walters (4): cli: add --body=true|false option to notmuch-show.c test:

[PATCH v2 (rebased) 1/4] cli: add --body=true|false option to notmuch-show.c

2012-07-24 Thread Mark Walters
This option allows the caller to suppress the output of the bodies of the messages. Currently this is only implemented for format=json. This is used by notmuch-pick.el (although not needed) because it gives a speed-up of at least a factor of a two (and in some cases a speed up of more than a

[PATCH v2 (rebased) 3/4] man: update man page for the new --body=true|false option

2012-07-24 Thread Mark Walters
--- man/man1/notmuch-show.1 | 16 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/man/man1/notmuch-show.1 b/man/man1/notmuch-show.1 index b51a54c..506583a 100644 --- a/man/man1/notmuch-show.1 +++ b/man/man1/notmuch-show.1 @@ -152,6 +152,22 @@ The default is

[PATCH v2 (rebased) 4/4] schemata: update for --body=true|false option

2012-07-24 Thread Mark Walters
Previously body: was a compulsory field in a message. The new --body=false option causes notmuch show to omit this field so update schemata to reflect this. --- devel/schemata |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/devel/schemata b/devel/schemata index

[PATCH v2 (rebased) 2/4] test: add tests for the new --body=true|false option

2012-07-24 Thread Mark Walters
--- test/json |9 + 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/test/json b/test/json index 337b3f5..831e105 100755 --- a/test/json +++ b/test/json @@ -7,6 +7,15 @@ add_message [subject]=\json-show-subject\ [date]=\Sat, 01 Jan 2000 12:00:0 output=$(notmuch show

Re: [PATCH v2 (rebased) 0/4] Add a --body option to notmuch show

2012-07-24 Thread David Bremner
Mark Walters markwalters1...@gmail.com writes: This is a rebased version of the series id:1343066259-22523-1-git-send-email-markwalters1...@gmail.com It is otherwise unchanged. (The rebase is a change in the context part of the test patch). pushed, thanks. d

[PATCH v2] man: show: update man page for entire-thread and json.

2012-07-24 Thread Mark Walters
Previously in notmuch show --format=json implied --entire-thread. This is still the default but it is now possible to disable this. Update the manpage to reflect this. --- Update the manpage since --format=json and --entire-thread=false is now supported. Reworded as Austin suggested. Best wishes

[PATCH 0/5] Notmuch Pick (WIP or contrib)

2012-07-24 Thread Mark Walters
Hello Notmuch pick is an emacs view which displays a threaded view of messages: each message has its own line and the thread structure is shown with UTF-8 graphics characters (so it looks vaguely similar to mutt's threaded view): see http://kanelephant.com/screen.png for a screenshot. Pick was

[PATCH 2/5] emacs: make notmuch-show return its buffer

2012-07-24 Thread Mark Walters
notmuch-pick uses the returned buffer to try and make sure it does not close the wrong buffer. --- emacs/notmuch-show.el |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 6335d45..1cabd17 100644 ---

[PATCH 1/5] emacs: compile and load notmuch-pick.el if present.

2012-07-24 Thread Mark Walters
Compile and load notmuch-pick.el if present. All the actual setup of pick is done in the function notmuch-pick-init so we call that in the notmuch init function if it is bound. This function will setup all extra keybinding etc. --- emacs/Makefile.local |3 ++- emacs/notmuch.el |5

[PATCH 4/5] contrib: Added pick README.

2012-07-24 Thread Mark Walters
--- contrib/notmuch-pick/README | 36 1 files changed, 36 insertions(+), 0 deletions(-) create mode 100644 contrib/notmuch-pick/README diff --git a/contrib/notmuch-pick/README b/contrib/notmuch-pick/README new file mode 100644 index 000..1b2399f ---

[PATCH 5/5] contrib: add pick TODO file

2012-07-24 Thread Mark Walters
--- contrib/notmuch-pick/TODO | 25 + 1 files changed, 25 insertions(+), 0 deletions(-) create mode 100644 contrib/notmuch-pick/TODO diff --git a/contrib/notmuch-pick/TODO b/contrib/notmuch-pick/TODO new file mode 100644 index 000..2d0796e --- /dev/null +++

[PATCH 3/5] contrib: add notmuch-pick.el file itself

2012-07-24 Thread Mark Walters
This adds the main notmuch-pick.el file. --- contrib/notmuch-pick/notmuch-pick.el | 876 ++ 1 files changed, 876 insertions(+), 0 deletions(-) create mode 100644 contrib/notmuch-pick/notmuch-pick.el diff --git a/contrib/notmuch-pick/notmuch-pick.el

[PATCH 04/13] show: Associate an sprinter with each format

2012-07-24 Thread Austin Clements
This associates an sprinter constructor with each show format and uses this to construct the appropriate sprinter. Currently nothing is done with this sprinter, but the following patches will weave it through the layers of notmuch show. --- notmuch-client.h |2 ++ notmuch-show.c |9

[PATCH 09/13] show: Convert non-envelope format_part_json to use sprinter

2012-07-24 Thread Austin Clements
--- notmuch-show.c | 74 +++- 1 file changed, 46 insertions(+), 28 deletions(-) diff --git a/notmuch-show.c b/notmuch-show.c index 3ff32df..afbd9d0 100644 --- a/notmuch-show.c +++ b/notmuch-show.c @@ -588,7 +588,6 @@ format_part_json (const

[PATCH 12/13] show: Convert do_show to use sprinter

2012-07-24 Thread Austin Clements
--- notmuch-show.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/notmuch-show.c b/notmuch-show.c index 5ee2156..a0da48a 100644 --- a/notmuch-show.c +++ b/notmuch-show.c @@ -961,11 +961,9 @@ do_show (void *ctx, notmuch_threads_t *threads;

[PATCH 07/13] show: Convert format_headers_json to use sprinter

2012-07-24 Thread Austin Clements
This no longer requires a talloc context (not that it really did before since it didn't return anything), so we remove its context argument. --- notmuch-client.h |3 ++- notmuch-reply.c |2 +- notmuch-show.c | 58 ++ 3 files

[PATCH 13/13] show: Remove now unused fields from notmuch_show_format

2012-07-24 Thread Austin Clements
The message_set_{begin,sep,end} and null_message fields are no longer used because we now use the structure printer provided by the format. --- notmuch-client.h |4 notmuch-show.c |4 2 files changed, 8 deletions(-) diff --git a/notmuch-client.h b/notmuch-client.h index

[PATCH 11/13] show: Convert show_message to use sprinter

2012-07-24 Thread Austin Clements
Unlike the previous patches, this function is used for all formats. However, for formats other than the JSON format, the sprinter methods used by show_message are all no-ops, so this code continues to function correctly for all of the formats. Converting show_message eliminates show_null_message

[PATCH 01/13] test: Uniformly canonicalize actual and expected JSON

2012-07-24 Thread Austin Clements
Previously, we used a variety of ad-hoc canonicalizations for JSON output in the test suite, but were ultimately very sensitive to JSON irrelevancies such as whitespace. This introduces a new test comparison function, test_expect_equal_json, that first pretty-prints *both* the actual and expected

[PATCH 10/13] show: Convert envelope format_part_json to use sprinter

2012-07-24 Thread Austin Clements
--- notmuch-show.c | 57 +--- 1 file changed, 34 insertions(+), 23 deletions(-) diff --git a/notmuch-show.c b/notmuch-show.c index afbd9d0..fa1e6e9 100644 --- a/notmuch-show.c +++ b/notmuch-show.c @@ -110,34 +110,44 @@ _get_one_line_summary

[PATCH 08/13] show: Convert format_part_sigstatus_json to use sprinter

2012-07-24 Thread Austin Clements
--- notmuch-show.c | 118 +--- 1 file changed, 61 insertions(+), 57 deletions(-) diff --git a/notmuch-show.c b/notmuch-show.c index 9852119..3ff32df 100644 --- a/notmuch-show.c +++ b/notmuch-show.c @@ -337,134 +337,138 @@

[PATCH 06/13] show: Feed the sprinter down to part formatters

2012-07-24 Thread Austin Clements
There are several levels of function calls between where we create the sprinter and the call to the part formatter in show_message. This feeds the sprinter through all of them and into the part formatters. --- notmuch-client.h |5 +++-- notmuch-reply.c |2 +- notmuch-show.c | 50

[PATCH 00/13] Convert notmuch show to use structure printers

2012-07-24 Thread Austin Clements
This patch series converts notmuch show to use the new structure printer infrastructure, cleaning up the code and paving the way to easily support other structure types. There are a lot of patches, but most of them are small and the conversion is very mechanical. The first three patches set up

[PATCH 05/13] reply: Create a JSON sprinter

2012-07-24 Thread Austin Clements
--- notmuch-reply.c |4 1 file changed, 4 insertions(+) diff --git a/notmuch-reply.c b/notmuch-reply.c index de21f3b..e42ba79 100644 --- a/notmuch-reply.c +++ b/notmuch-reply.c @@ -22,6 +22,7 @@ #include notmuch-client.h #include gmime-filter-headers.h +#include sprinter.h static

[PATCH 03/13] sprinter: Add a string_len method

2012-07-24 Thread Austin Clements
This method allows callers to output strings with specific lengths. It's useful both for strings with embedded NULs (which JSON can represent, though parser support is apparently spotty), and non-terminated strings. --- sprinter-json.c | 11 +-- sprinter-text.c | 11 +--

[PATCH 02/13] test: Remove unnecessary JSON canonicalization

2012-07-24 Thread Austin Clements
Format canonicalization of JSON output is no longer necessary, so remove it. Value canonicalization (e.g., normalizing thread IDs) is still necessary, so all of the sanitization functions remain. --- test/json |4 ++-- test/maildir-sync |1 - test/multipart| 40

Re: [PATCH v2] man: show: update man page for entire-thread and json.

2012-07-24 Thread Austin Clements
LGTM. On Tue, 24 Jul 2012, Mark Walters markwalters1...@gmail.com wrote: Previously in notmuch show --format=json implied --entire-thread. This is still the default but it is now possible to disable this. Update the manpage to reflect this. --- Update the manpage since --format=json and

Re: [PATCH 0/5] Notmuch Pick (WIP or contrib)

2012-07-24 Thread Aneesh Kumar K.V
Mark Walters markwalters1...@gmail.com writes: Hello Notmuch pick is an emacs view which displays a threaded view of messages: each message has its own line and the thread structure is shown with UTF-8 graphics characters (so it looks vaguely similar to mutt's threaded view): see

[PATCH 3/7] go: Allow notmuch objects to be garbage collected

2012-07-24 Thread Adrien Bustany
Le 20/07/2012 06:23, Austin Clements a ?crit : > Quoth Adrien Bustany on Jul 19 at 9:25 pm: >> Le 18/07/2012 23:40, Austin Clements a ?crit : >>> This is subtle enough that I think it deserves a comment in the source >>> code explaining that tracking the talloc owner reference, combined >>> with

[PATCH v8 0/3] notmuch-search: Structured Output Formatters

2012-07-24 Thread David Bremner
craven at gmx.net writes: > This patch series amends the situation by introducing structured > formatters, which allow different implementations of structures like > lists, maps, strings and numbers. > pushed, d

[PATCH v4 0/8] emacs: JSON-based search cleanups

2012-07-24 Thread David Bremner
Austin Clements writes: > This version fixes several bugs found in the previous version. pushed, d

[PATCH] emacs: Fix notmuch-message-mark-replied.

2012-07-24 Thread David Bremner
Ingo Lohmar writes: > notmuch-message-mark-replied used "apply" to change message tags > according to notmuch-message-replied-tags after sending a reply. This > works if the latter is a single-element list. But with the recently > changed format of tag changes, it breaks for multiple-element

notmuch-emacs and bbdb

2012-07-24 Thread Daniel Reusche
On 22.07.2012 02:24, Daniel Bergey wrote: > Glad to hear I have another user! Your welcome, nice snippet! > My function bbdb/notmuch-snarf-to doesn't work yet on more than one > recipient. > > Probably not before late August, though. Well, if I find some time, I will at least try it too. best,

[PATCH v2 (rebased) 0/4] Add a --body option to notmuch show

2012-07-24 Thread Mark Walters
This is a rebased version of the series id:"1343066259-22523-1-git-send-email-markwalters1009 at gmail.com" It is otherwise unchanged. (The rebase is a change in the context part of the test patch). Best wishes Mark Mark Walters (4): cli: add --body=true|false option to notmuch-show.c

[PATCH v2 (rebased) 1/4] cli: add --body=true|false option to notmuch-show.c

2012-07-24 Thread Mark Walters
This option allows the caller to suppress the output of the bodies of the messages. Currently this is only implemented for format=json. This is used by notmuch-pick.el (although not needed) because it gives a speed-up of at least a factor of a two (and in some cases a speed up of more than a

[PATCH v2 (rebased) 3/4] man: update man page for the new --body=true|false option

2012-07-24 Thread Mark Walters
--- man/man1/notmuch-show.1 | 16 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/man/man1/notmuch-show.1 b/man/man1/notmuch-show.1 index b51a54c..506583a 100644 --- a/man/man1/notmuch-show.1 +++ b/man/man1/notmuch-show.1 @@ -152,6 +152,22 @@ The default is

[PATCH v2 (rebased) 4/4] schemata: update for --body=true|false option

2012-07-24 Thread Mark Walters
Previously body: was a compulsory field in a message. The new --body=false option causes notmuch show to omit this field so update schemata to reflect this. --- devel/schemata |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/devel/schemata b/devel/schemata index

[PATCH v2 (rebased) 2/4] test: add tests for the new --body=true|false option

2012-07-24 Thread Mark Walters
--- test/json |9 + 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/test/json b/test/json index 337b3f5..831e105 100755 --- a/test/json +++ b/test/json @@ -7,6 +7,15 @@ add_message "[subject]=\"json-show-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:0 output=$(notmuch

[PATCH v2 (rebased) 0/4] Add a --body option to notmuch show

2012-07-24 Thread David Bremner
Mark Walters writes: > This is a rebased version of the series > id:"1343066259-22523-1-git-send-email-markwalters1009 at gmail.com" > > It is otherwise unchanged. (The rebase is a change in the context part > of the test patch). pushed, thanks. d

[PATCH v2] man: show: update man page for entire-thread and json.

2012-07-24 Thread Mark Walters
Previously in notmuch show --format=json implied --entire-thread. This is still the default but it is now possible to disable this. Update the manpage to reflect this. --- Update the manpage since --format=json and --entire-thread=false is now supported. Reworded as Austin suggested. Best wishes

[PATCH 0/5] Notmuch Pick (WIP or contrib)

2012-07-24 Thread Mark Walters
Hello Notmuch pick is an emacs view which displays a threaded view of messages: each message has its own line and the thread structure is shown with UTF-8 graphics characters (so it looks vaguely similar to mutt's threaded view): see http://kanelephant.com/screen.png for a screenshot. Pick was

[PATCH 2/5] emacs: make notmuch-show return its buffer

2012-07-24 Thread Mark Walters
notmuch-pick uses the returned buffer to try and make sure it does not close the wrong buffer. --- emacs/notmuch-show.el |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 6335d45..1cabd17 100644 ---

[PATCH 1/5] emacs: compile and load notmuch-pick.el if present.

2012-07-24 Thread Mark Walters
Compile and load notmuch-pick.el if present. All the actual setup of pick is done in the function notmuch-pick-init so we call that in the notmuch init function if it is bound. This function will setup all extra keybinding etc. --- emacs/Makefile.local |3 ++- emacs/notmuch.el |5

[PATCH 4/5] contrib: Added pick README.

2012-07-24 Thread Mark Walters
--- contrib/notmuch-pick/README | 36 1 files changed, 36 insertions(+), 0 deletions(-) create mode 100644 contrib/notmuch-pick/README diff --git a/contrib/notmuch-pick/README b/contrib/notmuch-pick/README new file mode 100644 index 000..1b2399f ---

[PATCH 5/5] contrib: add pick TODO file

2012-07-24 Thread Mark Walters
--- contrib/notmuch-pick/TODO | 25 + 1 files changed, 25 insertions(+), 0 deletions(-) create mode 100644 contrib/notmuch-pick/TODO diff --git a/contrib/notmuch-pick/TODO b/contrib/notmuch-pick/TODO new file mode 100644 index 000..2d0796e --- /dev/null +++

[PATCH 3/5] contrib: add notmuch-pick.el file itself

2012-07-24 Thread Mark Walters
This adds the main notmuch-pick.el file. --- contrib/notmuch-pick/notmuch-pick.el | 876 ++ 1 files changed, 876 insertions(+), 0 deletions(-) create mode 100644 contrib/notmuch-pick/notmuch-pick.el diff --git a/contrib/notmuch-pick/notmuch-pick.el

[PATCH 04/13] show: Associate an sprinter with each format

2012-07-24 Thread Austin Clements
This associates an sprinter constructor with each show format and uses this to construct the appropriate sprinter. Currently nothing is done with this sprinter, but the following patches will weave it through the layers of notmuch show. --- notmuch-client.h |2 ++ notmuch-show.c |9

[PATCH 09/13] show: Convert non-envelope format_part_json to use sprinter

2012-07-24 Thread Austin Clements
--- notmuch-show.c | 74 +++- 1 file changed, 46 insertions(+), 28 deletions(-) diff --git a/notmuch-show.c b/notmuch-show.c index 3ff32df..afbd9d0 100644 --- a/notmuch-show.c +++ b/notmuch-show.c @@ -588,7 +588,6 @@ format_part_json (const

[PATCH 12/13] show: Convert do_show to use sprinter

2012-07-24 Thread Austin Clements
--- notmuch-show.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/notmuch-show.c b/notmuch-show.c index 5ee2156..a0da48a 100644 --- a/notmuch-show.c +++ b/notmuch-show.c @@ -961,11 +961,9 @@ do_show (void *ctx, notmuch_threads_t *threads;

[PATCH 07/13] show: Convert format_headers_json to use sprinter

2012-07-24 Thread Austin Clements
This no longer requires a talloc context (not that it really did before since it didn't return anything), so we remove its context argument. --- notmuch-client.h |3 ++- notmuch-reply.c |2 +- notmuch-show.c | 58 ++ 3 files

[PATCH 13/13] show: Remove now unused fields from notmuch_show_format

2012-07-24 Thread Austin Clements
The message_set_{begin,sep,end} and null_message fields are no longer used because we now use the structure printer provided by the format. --- notmuch-client.h |4 notmuch-show.c |4 2 files changed, 8 deletions(-) diff --git a/notmuch-client.h b/notmuch-client.h index

[PATCH 11/13] show: Convert show_message to use sprinter

2012-07-24 Thread Austin Clements
Unlike the previous patches, this function is used for all formats. However, for formats other than the JSON format, the sprinter methods used by show_message are all no-ops, so this code continues to function correctly for all of the formats. Converting show_message eliminates show_null_message

[PATCH 01/13] test: Uniformly canonicalize actual and expected JSON

2012-07-24 Thread Austin Clements
Previously, we used a variety of ad-hoc canonicalizations for JSON output in the test suite, but were ultimately very sensitive to JSON irrelevancies such as whitespace. This introduces a new test comparison function, test_expect_equal_json, that first pretty-prints *both* the actual and expected

[PATCH 10/13] show: Convert envelope format_part_json to use sprinter

2012-07-24 Thread Austin Clements
--- notmuch-show.c | 57 +--- 1 file changed, 34 insertions(+), 23 deletions(-) diff --git a/notmuch-show.c b/notmuch-show.c index afbd9d0..fa1e6e9 100644 --- a/notmuch-show.c +++ b/notmuch-show.c @@ -110,34 +110,44 @@ _get_one_line_summary

[PATCH 08/13] show: Convert format_part_sigstatus_json to use sprinter

2012-07-24 Thread Austin Clements
--- notmuch-show.c | 118 +--- 1 file changed, 61 insertions(+), 57 deletions(-) diff --git a/notmuch-show.c b/notmuch-show.c index 9852119..3ff32df 100644 --- a/notmuch-show.c +++ b/notmuch-show.c @@ -337,134 +337,138 @@

[PATCH 06/13] show: Feed the sprinter down to part formatters

2012-07-24 Thread Austin Clements
There are several levels of function calls between where we create the sprinter and the call to the part formatter in show_message. This feeds the sprinter through all of them and into the part formatters. --- notmuch-client.h |5 +++-- notmuch-reply.c |2 +- notmuch-show.c | 50

[PATCH 00/13] Convert notmuch show to use structure printers

2012-07-24 Thread Austin Clements
This patch series converts notmuch show to use the new structure printer infrastructure, cleaning up the code and paving the way to easily support other structure types. There are a lot of patches, but most of them are small and the conversion is very mechanical. The first three patches set up

[PATCH 05/13] reply: Create a JSON sprinter

2012-07-24 Thread Austin Clements
--- notmuch-reply.c |4 1 file changed, 4 insertions(+) diff --git a/notmuch-reply.c b/notmuch-reply.c index de21f3b..e42ba79 100644 --- a/notmuch-reply.c +++ b/notmuch-reply.c @@ -22,6 +22,7 @@ #include "notmuch-client.h" #include "gmime-filter-headers.h" +#include "sprinter.h"

[PATCH 03/13] sprinter: Add a string_len method

2012-07-24 Thread Austin Clements
This method allows callers to output strings with specific lengths. It's useful both for strings with embedded NULs (which JSON can represent, though parser support is apparently spotty), and non-terminated strings. --- sprinter-json.c | 11 +-- sprinter-text.c | 11 +--

[PATCH 02/13] test: Remove unnecessary JSON canonicalization

2012-07-24 Thread Austin Clements
Format canonicalization of JSON output is no longer necessary, so remove it. Value canonicalization (e.g., normalizing thread IDs) is still necessary, so all of the sanitization functions remain. --- test/json |4 ++-- test/maildir-sync |1 - test/multipart| 40