From 9c5ea07cc66a00132d20db0c8b2094d25ce564ba Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Mon, 9 Jul 2012 17:42:41 -0400 Subject: 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" --- test/emacs | 1 - 1 file changed, 1 deletion(-) (limited to 'test') diff --git a/test/emacs b/test/emacs index 293b12aa..afe35bae 100755 --- a/test/emacs +++ b/test/emacs @@ -36,7 +36,6 @@ test_emacs '(notmuch-search "tag:inbox") test_expect_equal_file OUTPUT $EXPECTED/notmuch-search-tag-inbox test_begin_subtest "Incremental parsing of search results" -test_subtest_known_broken test_emacs "(ad-enable-advice 'notmuch-search-process-filter 'around 'pessimal) (ad-activate 'notmuch-search-process-filter) (notmuch-search \"tag:inbox\") -- cgit v1.2.3