]> git.notmuchmail.org Git - notmuch/commit
emacs: Switch from text to JSON format for search results
authorAustin Clements <amdragon@MIT.EDU>
Mon, 9 Jul 2012 21:42:41 +0000 (17:42 -0400)
committerDavid Bremner <bremner@debian.org>
Thu, 12 Jul 2012 23:39:36 +0000 (17:39 -0600)
commit9c5ea07cc66a00132d20db0c8b2094d25ce564ba
tree70fff130e40b75a38c71d8d88498efa764d7807b
parent889dda3731dcdf779cef347576c5d59d1923d26b
emacs: Switch from text to JSON format for search results

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 either by improving the JSON parser (evidence
suggests this can reduce the overhead to ~40% over the text format) or
by switching to S-expressions (evidence suggests this will more than
double performance over the text parser).  [1]

This also fixes the incremental search parsing test.

This has one minor side-effect on search result formatting.
Previously, the date field was always padded to a fixed width of 12
characters because of how the text parser's regexp was written.  The
JSON format doesn't do this.  We could pad it out in Emacs before
formatting it, but, since all of the other fields are variable width,
we instead fix notmuch-search-result-format to take the variable-width
field and pad it out.  For users who have customized this variable,
we'll mention in the NEWS how to fix this slight format change.

[1] id:"20110720205007.GB21316@mit.edu"
emacs/notmuch.el
test/emacs