[PATCH v7 1/3] Add support for structured output formatters.

2012-07-19 Thread craven
From: This patch adds a new struct type sprinter_t, which is used for structured formatting, e.g. JSON or S-Expressions. The structure printer is heavily based on code from Austin Clements (id:87d34hsdx8@awakening.csail.mit.edu). It includes the following functions: /* Start a new map/d

[PATCH v7 2/3] Add structured output formatter for JSON and plain text (but don't use them yet).

2012-07-19 Thread craven
From: Using the new structured printer support in sprinter.h, implement sprinter_json_create, which returns a new JSON structured output formatter. The formatter prints output similar to the existing JSON, but with differences in whitespace (mostly newlines, --output=summary prints the entire mes

[PATCH v7 3/3] Use the structured formatters in notmuch-search.c.

2012-07-19 Thread craven
From: This patch switches from the current ad-hoc printer to the structured formatters in sprinter.h, sprinter-text.c and sprinter-json.c. The JSON tests are changed slightly in order to make them PASS for the new structured output formatter. The text tests pass without adaptation. --- notmuch

notmuch-reply: Structured Formatters

2012-07-19 Thread craven
Currently there is no easy way to add support for different structured formatters (like JSON). For example, adding support for S-Expressions would result in code duplication. This patch series amends the situation by introducing structured formatters, which allow different implementations of struc

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

2012-07-19 Thread Austin Clements
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 the fact that Go finalizers are run in dependency orde

[PATCH 2/2] Add notmuch_database_reopen method

2012-07-19 Thread Adrien Bustany
Calling notmuch_database_reopen is needed to refresh the database contents when the database on disk was modified by another notmuch_database_t instance, for example in a different thread. --- lib/database.cc | 17 + lib/notmuch.h |8 2 files changed, 25 insertions

[PATCH 1/2] Add notmuch_database_flush method

2012-07-19 Thread Adrien Bustany
This method explicitly flushes the pending modifications to disk. It is useful if your program has various threads, each with a read only DB and one writer thread with a read/write DB. In that case, you most likely want the writer to sync the changes to disk so that the readers can see them, withou

[PATCH 0/2] Add flush/reopen methods to notmuch_database_t

2012-07-19 Thread Adrien Bustany
Xapian (and therefore Notmuch? I would not mind a confirmation here) is thread safe as long as you don't share DB instances across threads. The database backend supports one writer and several concurrent readers. One possible model for multi threaded apps using Notmuch is to have one thread with a

[PATCH 0/7] Various fixes for the Go bindings

2012-07-19 Thread Adrien Bustany
Well, thanks for the quick review :) I have updated all the patches to take your fixes into account, there is still the discussion left about the GC integration. Once we get that sorted out, I'll send the updated version. Le 18/07/2012 23:51, Austin Clements a ?crit : > This series looks good t

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

2012-07-19 Thread Adrien Bustany
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 the fact that Go finalizers are run in dependency order, ensures > that the C objects will always be de

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

2012-07-19 Thread Austin Clements
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 the fact that Go finalizers are run in dependency orde

[PATCH 2/2] Add notmuch_database_reopen method

2012-07-19 Thread Adrien Bustany
Calling notmuch_database_reopen is needed to refresh the database contents when the database on disk was modified by another notmuch_database_t instance, for example in a different thread. --- lib/database.cc | 17 + lib/notmuch.h |8 2 files changed, 25 insertions

[PATCH 0/2] Add flush/reopen methods to notmuch_database_t

2012-07-19 Thread Adrien Bustany
Xapian (and therefore Notmuch? I would not mind a confirmation here) is thread safe as long as you don't share DB instances across threads. The database backend supports one writer and several concurrent readers. One possible model for multi threaded apps using Notmuch is to have one thread with a

[PATCH 1/2] Add notmuch_database_flush method

2012-07-19 Thread Adrien Bustany
This method explicitly flushes the pending modifications to disk. It is useful if your program has various threads, each with a read only DB and one writer thread with a read/write DB. In that case, you most likely want the writer to sync the changes to disk so that the readers can see them, withou

Re: [PATCH 0/7] Various fixes for the Go bindings

2012-07-19 Thread Adrien Bustany
Well, thanks for the quick review :) I have updated all the patches to take your fixes into account, there is still the discussion left about the GC integration. Once we get that sorted out, I'll send the updated version. Le 18/07/2012 23:51, Austin Clements a écrit : This series looks good

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

2012-07-19 Thread Adrien Bustany
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 the fact that Go finalizers are run in dependency order, ensures that the C objects will always be destroye

query on a subset of messages ?

2012-07-19 Thread Sebastien Binet
tried that, but will do. > >> >> Note that there is an important optimization in notmuch tag that you >> might have to replicate. It manipulates the original query to exclude >> messages that already have the desired tags, so that they get skipped >> very efficiently at the earliest stage possible. > I already have this in my original shell script. > (wouldn't be too hard to automatically do, though.) FYI, I've put this into a new notmuch-mtag go-based binary over here: https://github.com/sbinet/notmuch/blob/dev/go-bindings/bindings/go/src/notmuch-mtag/main.go -s -- next part -- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: not available URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20120719/4a91371d/attachment-0001.pgp>

Notmuch scripts (again), now with more usenet

2012-07-19 Thread David Bremner
ccx at webprojekty.cz writes: > > I might not always have time to read the entirety of the ML, so it would > be great if people CC me when posting there. > OK, please add some kind of README file explaining the best way to report bugs. > > You can consider it public domain. I guess I should add

Re: Notmuch scripts (again), now with more usenet

2012-07-19 Thread David Bremner
c...@webprojekty.cz writes: > > I might not always have time to read the entirety of the ML, so it would > be great if people CC me when posting there. > OK, please add some kind of README file explaining the best way to report bugs. > > You can consider it public domain. I guess I should add wt

Re: query on a subset of messages ?

2012-07-19 Thread Sebastien Binet
Sebastien Binet writes: > Austin Clements writes: > >> Quoth Sebastien Binet on Jul 09 at 10:25 am: >>> >>> hi there, >>> >>> I was trying to reduce the I/O stress during my usual email >>> fetching+tagging by writing a little program using the go bindings to >>> notmuch. >>> >>> ie: >>> db,