Re: [PATCH v4 2/7] cli: new crypto structure to store crypto contexts and parameters, and functions to support it

2012-05-25 Thread Austin Clements
Quoth Jameson Graef Rollins on May 23 at 3:40 pm: This new structure, notmuch_crypto_t, keeps all relevant crypto contexts and parameters together, and will make it easier to pass the stuff around and clean it up. The name of the crypto context inside this new struct will change, to reflect

Re: [PATCH v4 0/7] cli: improved crypto internals

2012-05-25 Thread Austin Clements
Quoth Jameson Graef Rollins on May 23 at 3:40 pm: Ok, hopefully last version. This addresses Jani's latest comments. The first patch uses a typedef to handle the incompatibility between the crypto context between GMIME 2.4 and 2.6. We probably should have done this originally, as it gets

Re: [PATCH v4 1/7] cli: use typedef to deal with gmime 2.4/2.6 incompatibility

2012-05-25 Thread Austin Clements
Quoth Jameson Graef Rollins on May 25 at 8:47 am: On Fri, May 25 2012, Austin Clements amdra...@mit.edu wrote: diff --git a/notmuch-client.h b/notmuch-client.h index 19b7f01..337409f 100644 --- a/notmuch-client.h +++ b/notmuch-client.h @@ -36,6 +36,8 @@ * these to check the version

[PATCH] notmuch-deliver: Update to new notmuch_database_open API

2012-06-01 Thread Austin Clements
Commit 5fddc07 changed this API, but missed this use of it. --- contrib/notmuch-deliver/src/main.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/contrib/notmuch-deliver/src/main.c b/contrib/notmuch-deliver/src/main.c index 37d2919..032b9d6 100644 ---

[PATCH 0/4] Synchronize maildir flags in new/

2012-06-03 Thread Austin Clements
This problem came up again on IRC a few days ago, so I'm finally posting this series (which I've been running locally for months). The idea---which is explained in detail in the first patch---is that messages in new/ are maildir messages with an empty set of maildir flags. Currently we treat

[PATCH 3/4] lib: Only synchronize maildir flags for messages in maildirs

2012-06-03 Thread Austin Clements
--- lib/message.cc |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/message.cc b/lib/message.cc index ed96477..bbac2ff 100644 --- a/lib/message.cc +++ b/lib/message.cc @@ -1074,7 +1074,7 @@ notmuch_message_maildir_flags_to_tags (notmuch_message_t *message)

[PATCH 2/4] lib: Move _filename_is_in_maildir

2012-06-03 Thread Austin Clements
This way notmuch_message_maildir_flags_to_tags can call it. It makes more sense for this to be just above all of the maildir synchronization code rather than mixed in the middle. --- lib/message.cc | 82 1 file changed, 41 insertions(+),

[PATCH 4/4] lib: Treat messages in new/ as maildir messages with no flags set

2012-06-03 Thread Austin Clements
This fixes the broken test added a few patches ago by synchronizing the tags of messages in new/, even if they have no info part. See the test patch for rationale. --- lib/message.cc| 20 +--- test/maildir-sync |1 - 2 files changed, 13 insertions(+), 8 deletions(-)

Re: [PATCH 1/4] test: Add broken test for tag synchronization on files delivered to new/

2012-06-09 Thread Austin Clements
Quoth Jani Nikula on Jun 04 at 7:10 am: On Sun, 03 Jun 2012, Austin Clements amdra...@mit.edu wrote: Currently, notmuch new only synchronizs maildir flags to tags for +e to synchronizs. Vowels are so web 1.0. Updated series on its way

[PATCH v2 4/5] lib: Treat messages in new/ as maildir messages with no flags set

2012-06-09 Thread Austin Clements
Previously, notmuch new only synchronized maildir flags to tags for files with a maildir info part. Since messages in new/ don't have an info part, notmuch would ignore them for flag-to-tag synchronization. This patch makes notmuch consider messages in new/ to be legitimate maildir messages that

[PATCH v2 3/5] lib: Only synchronize maildir flags for messages in maildirs

2012-06-09 Thread Austin Clements
Previously, we synchronized flags to tags for any message that looked like it had maildir flags in its file name, regardless of whether it was in a maildir-like directory structure. This was asymmetric with tag-to-flag synchronization, which only applied to messages in directories named new/ and

[PATCH v2 2/5] lib: Move _filename_is_in_maildir

2012-06-09 Thread Austin Clements
This way notmuch_message_maildir_flags_to_tags can call it. It makes more sense for this to be just above all of the maildir synchronization code rather than mixed in the middle. --- lib/message.cc | 82 1 file changed, 41 insertions(+),

[PATCH v2 1/5] test: Add broken test for tag synchronization on files delivered to new/

2012-06-09 Thread Austin Clements
Currently, notmuch new only synchronizes maildir flags to tags for files that have an info part. However, in maildir, new mail doesn't gain the info part until it moves from new/ to cur/. Hence, even though mail in new/ doesn't have an info part, it is still a maildir message and thus has

[PATCH v2 0/5] Synchronize maildir flags in new/

2012-06-09 Thread Austin Clements
v2 hopefully addresses Jani's comments about v1's commit messages. It also adds a news patch. ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch

Re: [PATCH v5 0/7] cli: improved crypto internals

2012-06-09 Thread Austin Clements
Quoth Jameson Graef Rollins on May 26 at 11:45 am: I'm not going to claim this is the last version, but I think it addresses the remaining comments. I implemented Austin's of introducing a new type to handle the gmime 2.4/2.6 context incompatibility. LGTM. Sorry for dropping the ball on

Re: miraculous from: field

2012-06-20 Thread Austin Clements
Quoth David Belohrad on Jun 20 at 1:25 pm: Dear All, could someone give a hint? I have an opened mail message. When I press 'r' to reply, a new mail buffer is opened and the 'From' field is correctly filled with 'da...@belohrad.ch'. When on the same message I press however 'f' to

Re: [Patch v8 2/6] cli: Let json output null messages for non --entire-thread

2012-06-23 Thread Austin Clements
The JSON format change LGTM. This seems like the right way to do this. On Sat, 16 Jun 2012, Mark Walters markwalters1...@gmail.com wrote: All formats except Json can output empty messages for non entire-thread, but in Json format we output null to keep the other elements (e.g. the replies to

Re: [Patch v8 4/6] Update devel/schemata for --entire-thread=false

2012-06-23 Thread Austin Clements
On Sat, 16 Jun 2012, Mark Walters markwalters1...@gmail.com wrote: Also remove the Json --entire-thread item from devel/TODO. --- devel/TODO |2 -- devel/schemata |2 +- 2 files changed, 1 insertions(+), 3 deletions(-) diff --git a/devel/TODO b/devel/TODO index

Re: [PATCH 0/3] Speed up notmuch new for unchanged directories

2012-06-25 Thread Austin Clements
Quoth Sascha Silbe on Jun 26 at 12:13 am: Austin Clements amdra...@mit.edu writes: On Sun, 24 Jun 2012, Sascha Silbe sascha-...@silbe.org wrote: [notmuch new listing every directory, even if it's unchanged] I haven't looked over your patches yet, but this result surprises me. Could you

Re: [Patch v2] Minor correction to devel/schemata

2012-06-30 Thread Austin Clements
LGTM. On Sat, 30 Jun 2012, Mark Walters markwalters1...@gmail.com wrote: In id:87sjdm12d1@awakening.csail.mit.edu Austin pointed out that devel/schemata needs a slight correction with the new --entire-thread=false option. This is that correction. --- Resend with better commit message

Re: [PATCH] cli: notmuch-show with framing newlines between threads in JSON.

2012-07-01 Thread Austin Clements
Quoth Tomi Ollila on Jul 02 at 1:13 am: On Sat, Jun 30 2012, Mark Walters markwalters1...@gmail.com wrote: Add newlines between complete threads to make asynchronous parsing of the JSON easier. --- notmuch-pick uses the JSON output of notmuch show but, in many cases, for many

Re: [PATCH] cli: notmuch-show with framing newlines between threads in JSON.

2012-07-01 Thread Austin Clements
Quoth myself on Jul 01 at 8:12 pm: Quoth Tomi Ollila on Jul 02 at 1:13 am: On Sat, Jun 30 2012, Mark Walters markwalters1...@gmail.com wrote: Add newlines between complete threads to make asynchronous parsing of the JSON easier. --- notmuch-pick uses the JSON output of

[PATCH] Add missing tags field to search schema

2012-07-02 Thread Austin Clements
This field is output by search, but it didn't make it into the documentation. --- devel/schemata |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/devel/schemata b/devel/schemata index 8fcab8e..06320f4 100644 --- a/devel/schemata +++ b/devel/schemata @@ -128,7 +128,8 @@

[PATCH 3/8] emacs: Move search-target logic to `notmuch-search-show-result'

2012-07-03 Thread Austin Clements
This is a simpler place to do this, since we can avoid any point motion and hence any save-excursions in `notmuch-search-process-filter', which in turn lets us put all of the search-target logic outside of any save-excursions. `notmuch-search-process-filter' could use some reindentation after

[PATCH 4/8] emacs: Helper for reporting search parsing errors

2012-07-03 Thread Austin Clements
This removes the last bit of direct output from the parsing function. With the parser now responsible solely for parsing, we can swap it out for another parser. --- emacs/notmuch.el | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/emacs/notmuch.el b/emacs/notmuch.el

[PATCH 5/8] emacs: Pass plist to `notmuch-search-show-result'

2012-07-03 Thread Austin Clements
Rather than passing lots of arguments and then further passing those to `notmuch-search-insert-field', pass a plist containing all of the search result information. This plist is compatible JSON format search results. --- emacs/notmuch.el | 65

[PATCH 6/8] test: New test for incremental search output parsing

2012-07-03 Thread Austin Clements
This advises the search process filter to make it process one character at a time in order to test the pessimal case for incremental search output parsing. The text parser fails this test because it gets tricked into thinking a parenthetical remark in a subject is the tag list. --- test/emacs

[PATCH 2/8] emacs: Separate search line parsing and display

2012-07-03 Thread Austin Clements
Previously, much of the display of search lines was done in the same function that parsed the CLI's output. Now the parsing function only parses, and notmuch-search-show-result fully inserts the search result in the search buffer. --- emacs/notmuch.el | 33 + 1

[PATCH 7/8] emacs: Implement an incremental JSON parser

2012-07-03 Thread Austin Clements
This parser is designed to read streaming JSON whose structure is known to the caller. Like a typical JSON parsing interface, it provides a function to read a complete JSON value from the input. However, it extends this with an additional function that requires the next value in the input to be a

Re: [PATCH 3/8] emacs: Move search-target logic to `notmuch-search-show-result'

2012-07-04 Thread Austin Clements
Quoth Mark Walters on Jul 04 at 9:34 am: On Tue, 03 Jul 2012, Austin Clements amdra...@mit.edu wrote: This is a simpler place to do this, since we can avoid any point motion and hence any save-excursions in `notmuch-search-process-filter', which in turn lets us put all of the search

Re: [PATCH 1/8] emacs: Clean up notmuch-search-show-result

2012-07-04 Thread Austin Clements
Quoth Mark Walters on Jul 04 at 8:53 am: On Tue, 03 Jul 2012, Austin Clements amdra...@mit.edu wrote: This simplifies the code and makes it no longer cubic in the number of result fields. This looks good to me and all tests pass, and I agree that this patch can be pushed independently

Re: [PATCH 2/3] show: output Reply-To headers

2012-07-05 Thread Austin Clements
Quoth Mark Walters on Jul 05 at 9:47 am: On Wed, 04 Jul 2012, Peter Wang noval...@gmail.com wrote: On Tue, 03 Jul 2012 19:22:18 -0700, Jameson Graef Rollins jroll...@finestructure.net wrote: On Tue, Jul 03 2012, Peter Wang noval...@gmail.com wrote: I want to see what the sender

Re: [PATCH 7/8] emacs: Implement an incremental JSON parser

2012-07-05 Thread Austin Clements
Quoth Mark Walters on Jul 05 at 9:30 am: On Tue, 03 Jul 2012, Austin Clements amdra...@mit.edu wrote: This parser is designed to read streaming JSON whose structure is known to the caller. Like a typical JSON parsing interface, it provides a function to read a complete JSON value from

[PATCH v2 9/9] News for JSON-based search

2012-07-05 Thread Austin Clements
--- NEWS | 17 + 1 file changed, 17 insertions(+) diff --git a/NEWS b/NEWS index d29ec5b..a1a6e93 100644 --- a/NEWS +++ b/NEWS @@ -14,6 +14,23 @@ Maildir tag synchronization messages (typically causing new messages to not receive the unread tag). +Emacs Interface

[PATCH v2 0/9] JSON-based search-mode

2012-07-05 Thread Austin Clements
This should account for all of Mark's and Tomi's comments. This version * renames the format variables to format-string and spec to be less confusing, * reverts to the original behavior of ignoring the user's format specification for tags (since we make assumptions about this format

[PATCH v2 5/9] emacs: Pass plist to `notmuch-search-show-result'

2012-07-05 Thread Austin Clements
Rather than passing lots of arguments and then further passing those to `notmuch-search-insert-field', pass a plist containing all of the search result information. This plist is compatible with the JSON format search results. --- emacs/notmuch.el | 65

[PATCH v2 3/9] emacs: Helper for reporting search parsing errors

2012-07-05 Thread Austin Clements
This removes the last bit of direct output from the parsing function. With the parser now responsible solely for parsing, we can swap it out for another parser. --- emacs/notmuch.el |8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/emacs/notmuch.el b/emacs/notmuch.el

[PATCH v2 8/9] emacs: Switch from text to JSON format for search results

2012-07-05 Thread Austin Clements
The JSON format eliminates the complex escaping issues that have plagued the text search format. This uses the incremental JSON parser so that, like the text parser, it can output search results incrementally. This slows down the parser by about ~4X, but puts us in a good position to optimize

[PATCH v2 7/9] emacs: Implement an incremental JSON parser

2012-07-05 Thread Austin Clements
This parser is designed to read streaming JSON whose structure is known to the caller. Like a typical JSON parsing interface, it provides a function to read a complete JSON value from the input. However, it extends this with an additional function that requires the next value in the input to be a

[PATCH v2 1/9] emacs: Clean up notmuch-search-show-result

2012-07-05 Thread Austin Clements
This simplifies the code and makes it no longer cubic in the number of result fields. --- emacs/notmuch.el | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index c6236db..8ad0b68 100644 --- a/emacs/notmuch.el +++

[PATCH v2 4/9] emacs: Move search-target logic to `notmuch-search-show-result'

2012-07-05 Thread Austin Clements
This is a simpler place to do this, since we can avoid any point motion and hence any save-excursions in `notmuch-search-process-filter', which in turn lets us put all of the search-target logic outside of any save-excursions. `notmuch-search-show-{result,error}' are now responsible for their own

Re: [PATCH v2 0/9] JSON-based search-mode

2012-07-05 Thread Austin Clements
Quoth Mark Walters on Jul 05 at 10:44 pm: On Thu, 05 Jul 2012, Austin Clements amdra...@mit.edu wrote: This should account for all of Mark's and Tomi's comments. This version * renames the format variables to format-string and spec to be less confusing, * reverts to the original

Re: query on a subset of messages ?

2012-07-09 Thread Austin Clements
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, status := notmuch.OpenDatabase(db_path,

[PATCH v3 1/9] emacs: Clean up notmuch-search-show-result

2012-07-09 Thread Austin Clements
This simplifies the code and makes it no longer cubic in the number of result fields. --- emacs/notmuch.el | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index c6236db..8ad0b68 100644 --- a/emacs/notmuch.el +++

[PATCH v3 2/9] emacs: Separate search line parsing and display

2012-07-09 Thread Austin Clements
Previously, much of the display of search lines was done in the same function that parsed the CLI's output. Now the parsing function only parses, and notmuch-search-show-result fully inserts the search result in the search buffer. --- emacs/notmuch.el | 33 + 1

[PATCH v3 0/9] JSON-based search-mode

2012-07-09 Thread Austin Clements
This fixes the docstings for notmuch-json-read and notmuch-json-eof as suggested by Mark. No other changes. ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch

[PATCH v3 6/9] test: New test for incremental search output parsing

2012-07-09 Thread Austin Clements
This advises the search process filter to make it process one character at a time in order to test the pessimal case for incremental search output parsing. The text parser fails this test because it gets tricked into thinking a parenthetical remark in a subject is the tag list. --- test/emacs

[PATCH v3 5/9] emacs: Pass plist to `notmuch-search-show-result'

2012-07-09 Thread Austin Clements
Rather than passing lots of arguments and then further passing those to `notmuch-search-insert-field', pass a plist containing all of the search result information. This plist is compatible with the JSON format search results. --- emacs/notmuch.el | 65

[PATCH v3 3/9] emacs: Helper for reporting search parsing errors

2012-07-09 Thread Austin Clements
This removes the last bit of direct output from the parsing function. With the parser now responsible solely for parsing, we can swap it out for another parser. --- emacs/notmuch.el |8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/emacs/notmuch.el b/emacs/notmuch.el

[PATCH v3 7/9] emacs: Implement an incremental JSON parser

2012-07-09 Thread Austin Clements
This parser is designed to read streaming JSON whose structure is known to the caller. Like a typical JSON parsing interface, it provides a function to read a complete JSON value from the input. However, it extends this with an additional function that requires the next value in the input to be a

[PATCH v3 4/9] emacs: Move search-target logic to `notmuch-search-show-result'

2012-07-09 Thread Austin Clements
This is a simpler place to do this, since we can avoid any point motion and hence any save-excursions in `notmuch-search-process-filter', which in turn lets us put all of the search-target logic outside of any save-excursions. `notmuch-search-show-{result,error}' are now responsible for their own

Re: [PATCH] FIXED: Added better support for multiple structured output formats.

2012-07-10 Thread Austin Clements
Quoth Jameson Graef Rollins on Jul 10 at 10:04 am: On Tue, Jul 10 2012, Mark Walters markwalters1...@gmail.com wrote: I think I would also add something saying that the text format is just different (and that a significant chunk of the patch is just that). Can we not just dump this output

Re: [PATCH] v2: Added better support for multiple structured output formats.

2012-07-10 Thread Austin Clements
Since it would be great to use the structure printer for show as well, it would make sense to put it in its own source file, where it can easily be shared between commands. There are a few systematic code formatting problems in your patch. To be consistent with other notmuch code, there should

Re: [PATCH v4 1/3] Add support for structured output formatters.

2012-07-12 Thread Austin Clements
Quoth cra...@gmx.net on Jul 12 at 9:43 am: This patch adds a new type sprinter_t, which is used for structured formatting, e.g. JSON or S-Expressions. The structure printer is the code from Austin Clements (id:87d34hsdx8@awakening.csail.mit.edu). The structure printer contains

Re: [PATCH v4 2/3] Add structured output formatter for JSON.

2012-07-12 Thread Austin Clements
Quoth Tomi Ollila on Jul 12 at 1:10 pm: On Thu, Jul 12 2012, cra...@gmx.net wrote: Using the new structured printer support in sprinter.h, implement sprinter_json_new, which returns a new JSON structured output formatter. The formatter prints output similar to the existing JSON, but

Re: [PATCH v4 2/3] Add structured output formatter for JSON.

2012-07-12 Thread Austin Clements
Quoth cra...@gmx.net on Jul 12 at 9:43 am: Using the new structured printer support in sprinter.h, implement sprinter_json_new, which returns a new JSON structured output formatter. The formatter prints output similar to the existing JSON, but with differences in whitespace (mostly

Re: [PATCH v4 1/3] Add support for structured output formatters.

2012-07-12 Thread Austin Clements
Quoth cra...@gmx.net on Jul 12 at 9:43 am: This patch adds a new type sprinter_t, which is used for structured formatting, e.g. JSON or S-Expressions. The structure printer is the code from Austin Clements (id:87d34hsdx8@awakening.csail.mit.edu). The structure printer contains

Re: [PATCH v4 3/3] Use the structured format printer for JSON in notmuch search.

2012-07-12 Thread Austin Clements
This is fantastic. It simplifies the code a lot, and I think it opens up opportunities to simplify it even further. Detailed comments are below, but first one general comment. For the text format, I wonder if most of the special case code would go away with a stub sprinter that did nothing for

Re: [PATCH v4 3/3] Use the structured format printer for JSON in notmuch search.

2012-07-12 Thread Austin Clements
Quoth myself on Jul 12 at 8:02 pm: This is fantastic. It simplifies the code a lot, and I think it opens up opportunities to simplify it even further. Detailed comments are below, but first one general comment. For the text format, I wonder if most of the special case code would go away

[PATCH 2/7] emacs: Use text properties instead of overlays for tag coloring

2012-07-12 Thread Austin Clements
Previously, tag-based search result highlighting was done by creating an overlay over each search result. However, overlays have annoying front- and rear-advancement semantics that make it difficult to manipulate text at their boundaries, which the next patch will do. They also have performance

[PATCH 4/7] emacs: Use result text properties for search result iteration

2012-07-12 Thread Austin Clements
This simplifies the traversal of regions of results and eliminates the need for save-excursions (which tend to get in the way of maintaining point when we make changes to the buffer). It also fixes some strange corner cases in the old line-based code where results that bordered the region but

[PATCH 1/7] emacs: Record thread search result object in a text property

2012-07-12 Thread Austin Clements
This also provides utility functions for working with this text property that get its value, find its start, and find its end. --- emacs/notmuch.el | 27 +++ 1 file changed, 27 insertions(+) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index fabb7c0..ef18927 100644

[PATCH 3/7] emacs: Update tags by rewriting the search result line in place

2012-07-12 Thread Austin Clements
Now that we keep the full thread result object, we can refresh a result after any changes by simply deleting and reconstructing the result line from scratch. A convenient side-effect of this wholesale replacement is that search now re-applies notmuch-search-line-faces when tags change. ---

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

2012-07-12 Thread Austin Clements
This series builds on the JSON-based search series [0] to clean up several other aspects of search-mode. It removes constraints on the formatting of tags in the result line (you can even leave them out entirely), it recolors lines when tags change, it adds supports for multi-line result formats,

[PATCH 7/7] emacs: Fix navigation of multi-line search result formats

2012-07-12 Thread Austin Clements
At this point, the only remaining functions that don't support multi-line search result formats are the thread navigation functions. This patch fixes that by rewriting them in terms of notmuch-search-result-{beginning,end}. --- emacs/notmuch.el | 12 +--- 1 file changed, 9

[PATCH 5/7] emacs: Replace other search text properties with result property

2012-07-12 Thread Austin Clements
Since the result object contains everything that the other text properties recorded, we can remove the other text properties and simply look in the plist of the appropriate result object. --- emacs/notmuch.el | 24 ++-- 1 file changed, 10 insertions(+), 14 deletions(-) diff

Re: [PATCH 1/3] emacs: add no-display arg to notmuch-hello-refresh-hook

2012-07-12 Thread Austin Clements
Quoth Jani Nikula on Jul 10 at 8:10 am: On Jul 10, 2012 4:49 AM, Austin Clements [1]amdra...@mit.edu wrote: Quoth Jani Nikula on Jun 15 at  6:53 pm: Add no-display arg to notmuch-hello-refresh-hook to allow each hook to decide what is appropriate when no-display is t

Re: [PATCH 7/7] emacs: Fix navigation of multi-line search result formats

2012-07-13 Thread Austin Clements
Quoth Mark Walters on Jul 13 at 6:21 pm: On Fri, 13 Jul 2012, Austin Clements amdra...@mit.edu wrote: At this point, the only remaining functions that don't support multi-line search result formats are the thread navigation functions. This patch fixes that by rewriting them in terms

Re: [PATCH 2/7] emacs: Use text properties instead of overlays for tag coloring

2012-07-13 Thread Austin Clements
Quoth Mark Walters on Jul 13 at 6:59 pm: On Fri, 13 Jul 2012, Austin Clements amdra...@mit.edu wrote: Previously, tag-based search result highlighting was done by creating an overlay over each search result. However, overlays have annoying front- and rear-advancement semantics that make

Re: [PATCH v5 1/3] Add support for structured output formatters.

2012-07-13 Thread Austin Clements
Quoth Peter Feigl on Jul 13 at 10:11 am: From: cra...@gmx.net This patch adds a new type sprinter_t, which is used for structured formatting, e.g. JSON or S-Expressions. The structure printer is the code from Austin Clements (id:87d34hsdx8@awakening.csail.mit.edu) with minor

Re: [PATCH v5 2/3] Add structured output formatter for JSON and text.

2012-07-13 Thread Austin Clements
Quoth Peter Feigl on Jul 13 at 10:11 am: From: cra...@gmx.net 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

Re: [PATCH v5 3/3] Use the structured formatters in notmuch-search.c.

2012-07-13 Thread Austin Clements
Just one comment below. Otherwise this patch LGTM (though some of my comments on the previous patch will affect this one). It's nice to see all of that old newline logic disappear. Quoth Peter Feigl on Jul 13 at 10:11 am: From: cra...@gmx.net This patch switches from the current ad-hoc

[PATCH v2 6/7] emacs: Allow custom tags formatting

2012-07-13 Thread Austin Clements
Previously we ignored any notmuch-search-result-format customizations for tag formatting because we needed to be able to parse back in the result line and update the tags in place. We no longer do either of these things, so we can allow customization of this format. (Coincidentally, previously

[PATCH v2 2/7] emacs: Use text properties instead of overlays for tag coloring

2012-07-13 Thread Austin Clements
Previously, tag-based search result highlighting was done by creating an overlay over each search result. However, overlays have annoying front- and rear-advancement semantics that make it difficult to manipulate text at their boundaries, which the next patch will do. They also have performance

[PATCH v2 3/7] emacs: Update tags by rewriting the search result line in place

2012-07-13 Thread Austin Clements
Now that we keep the full thread result object, we can refresh a result after any changes by simply deleting and reconstructing the result line from scratch. A convenient side-effect of this wholesale replacement is that search now re-applies notmuch-search-line-faces when tags change. ---

[PATCH v2 0/7] emacs: JSON-based search cleanups

2012-07-13 Thread Austin Clements
This version updates the docstrings for notmuch-search-update-result and notmuch-search-show-result and fixes the scrolling artifact in notmuch-search-update-result. I also updated the commit message of patch 7 to mention that it changes the behavior of notmuch-search-previous-thread. The diff

[PATCH v2 4/7] emacs: Use result text properties for search result iteration

2012-07-13 Thread Austin Clements
This simplifies the traversal of regions of results and eliminates the need for save-excursions (which tend to get in the way of maintaining point when we make changes to the buffer). It also fixes some strange corner cases in the old line-based code where results that bordered the region but

[PATCH v2 1/7] emacs: Record thread search result object in a text property

2012-07-13 Thread Austin Clements
This also provides utility functions for working with this text property that get its value, find its start, and find its end. --- emacs/notmuch.el | 27 +++ 1 file changed, 27 insertions(+) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index fabb7c0..ef18927 100644

[PATCH] emacs: Make moving to the previous message move to the previous boundary

2012-07-13 Thread Austin Clements
Previously, notmuch-show-previous-message would move to the beginning of the message before the message containing point. This patch makes it instead move to the previous message *boundary*. That is, if point isn't already at the beginning of the message, it moves to the beginning of the current

Re: [PATCH v2 4/7] emacs: Use result text properties for search result iteration

2012-07-14 Thread Austin Clements
Quoth Jameson Graef Rollins on Jul 14 at 12:31 pm: On Fri, Jul 13 2012, Austin Clements amdra...@mit.edu wrote: Coincidentally, this also essentially enables multi-line search result formats; the only remaining non-multi-line-capable functions are notmuch-search-{next,previous}-thread

Re: [PATCH v2 4/7] emacs: Use result text properties for search result iteration

2012-07-14 Thread Austin Clements
Quoth myself on Jul 14 at 3:50 pm: Quoth Jameson Graef Rollins on Jul 14 at 12:31 pm: On Fri, Jul 13 2012, Austin Clements amdra...@mit.edu wrote: +(defmacro notmuch-search-do-results (beg end pos-sym rest body) + Invoke BODY for each result between BEG and END. + +POS-SYM

Re: [PATCH v2 4/7] emacs: Use result text properties for search result iteration

2012-07-14 Thread Austin Clements
Quoth Jameson Graef Rollins on Jul 14 at 2:13 pm: On Sat, Jul 14 2012, Austin Clements amdra...@mit.edu wrote: That's strange. What was the error? I've been testing with ((date . %12s ) (count . %-7s ) (authors . %-20s ) (subject . \n%s ) (tags . (%s

[PATCH v3 1/8] emacs: Record thread search result object in a text property

2012-07-14 Thread Austin Clements
This also provides utility functions for working with this text property that get its value, find its start, and find its end. --- emacs/notmuch.el | 27 +++ 1 file changed, 27 insertions(+) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index fabb7c0..ef18927 100644

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

2012-07-14 Thread Austin Clements
This version swaps out the notmuch-search-do-results macro for a higher-order function, notmuch-search-foreach-result. This requires less squiting to understand and clearly distinguishes the arguments passed in to the function from the arguments passed to the callback. This version also updates

[PATCH v3 7/8] emacs: Fix navigation of multi-line search result formats

2012-07-14 Thread Austin Clements
At this point, the only remaining functions that don't support multi-line search result formats are the thread navigation functions. This patch fixes that by rewriting them in terms of notmuch-search-result-{beginning,end}. This changes the behavior of notmuch-search-previous-thread slightly so

[PATCH v3 5/8] emacs: Replace other search text properties with result property

2012-07-14 Thread Austin Clements
Since the result object contains everything that the other text properties recorded, we can remove the other text properties and simply look in the plist of the appropriate result object. --- emacs/notmuch.el | 24 ++-- 1 file changed, 10 insertions(+), 14 deletions(-) diff

[PATCH v3 4/8] emacs: Use result text properties for search result iteration

2012-07-14 Thread Austin Clements
This simplifies the traversal of regions of results and eliminates the need for save-excursions (which tend to get in the way of maintaining point when we make changes to the buffer). It also fixes some strange corner cases in the old line-based code where results that bordered the region but

[PATCH v3 3/8] emacs: Update tags by rewriting the search result line in place

2012-07-14 Thread Austin Clements
Now that we keep the full thread result object, we can refresh a result after any changes by simply deleting and reconstructing the result line from scratch. A convenient side-effect of this wholesale replacement is that search now re-applies notmuch-search-line-faces when tags change. ---

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

2012-07-15 Thread Austin Clements
On Sun, 15 Jul 2012, Mark Walters markwalters1...@gmail.com wrote: On Sun, 15 Jul 2012, Austin Clements amdra...@mit.edu wrote: This version swaps out the notmuch-search-do-results macro for a higher-order function, notmuch-search-foreach-result. This requires less squiting to understand

Re: [PATCH v6 2/3] Add structured output formatter for JSON and plain text.

2012-07-18 Thread Austin Clements
Quoth cra...@gmx.net on Jul 16 at 10:35 am: 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

Re: [PATCH v6 3/3] Use the structured formatters in notmuch-search.c.

2012-07-18 Thread Austin Clements
Just a few comments (don't forget to scroll all the way down). Overall this is looking pretty good. Quoth cra...@gmx.net on Jul 16 at 10:35 am: This patch switches from the current ad-hoc printer to the structured formatters in sprinter.h, sprinter-text-search.c and sprinter-json.c. The JSON

Re: [PATCH 1/7] go: Use iota in enum bindings

2012-07-18 Thread Austin Clements
Hah. I guess nobody has tried to modify a notmuch database using the Go bindings. Could this instead assign the constants to C.NOTMUCH_DATABASE_MODE_READ_ONLY, etc, rather than duplicating their values? It would be nice to do that for the Status values as well (which are correctly using iota,

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

2012-07-18 Thread Austin Clements
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 destroyed from the talloc leaves up. Just one inline

Re: [PATCH 5/7] go: Partially bind notmuch_database_upgrade

2012-07-18 Thread Austin Clements
Quoth Adrien Bustany on Jul 18 at 9:34 pm: This binding does not handle the progress callback, but at least allows opening and upgrading a database if needed. --- bindings/go/src/notmuch/notmuch.go | 13 - 1 files changed, 12 insertions(+), 1 deletions(-) diff --git

Re: [PATCH 7/7] go: Bind notmuch_thread_t functions

2012-07-18 Thread Austin Clements
Quoth Adrien Bustany on Jul 18 at 9:34 pm: --- bindings/go/src/notmuch/notmuch.go | 253 +++- 1 files changed, 252 insertions(+), 1 deletions(-) diff --git a/bindings/go/src/notmuch/notmuch.go b/bindings/go/src/notmuch/notmuch.go index be4cb8c..f667dbb

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

2012-07-18 Thread Austin Clements
This series looks good to me other than the few things I commented on. It's nice to see the Go bindings get a bit of love! Quoth Adrien Bustany on Jul 18 at 9:34 pm: The following patches fix some serious memory management issues with the Go bindings, and add some missing functions as well.

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 order

Re: bug in parsing?

2012-07-20 Thread Austin Clements
On Fri, 15 Jun 2012, David Belohrad da...@belohrad.ch wrote: Dear all, recently I got an email from matplotlib list, which fails to parse in notmuch-saved-search-unread. It looks like this: Yest. 21:04 [3/5] Jesse Rosenthal, Tomi Ollila [PATCHv2] emacs: derive correct timestamp in FCC

[PATCH v4 7/8] emacs: Fix navigation of multi-line search result formats

2012-07-21 Thread Austin Clements
At this point, the only remaining functions that don't support multi-line search result formats are the thread navigation functions. This patch fixes that by rewriting them in terms of notmuch-search-result-{beginning,end}. This changes the behavior of notmuch-search-previous-thread slightly so

[PATCH v4 4/8] emacs: Use result text properties for search result iteration

2012-07-21 Thread Austin Clements
This simplifies the traversal of regions of results and eliminates the need for save-excursions (which tend to get in the way of maintaining point when we make changes to the buffer). It also fixes some strange corner cases in the old line-based code where results that bordered the region but

<    3   4   5   6   7   8   9   10   11   12   >