+ (insert string))
+ (notmuch-json-parse-partial-list 'notmuch-search-show-result
+ 'notmuch-search-show-error
+ results-buf)))))
+
+(defun notmuch-json-parse-partial-list (result-function error-function results-buf)
+ "Parse a partial JSON list from current buffer.
+
+This function consumes a JSON list from the current buffer,
+applying RESULT-FUNCTION in buffer RESULT-BUFFER to each complete
+value in the list. It operates incrementally and should be
+called whenever the buffer has been extended with additional
+data.
+
+If there is a syntax error, this will attempt to resynchronize
+with the input and will apply ERROR-FUNCTION in buffer
+RESULT-BUFFER to any input that was skipped."
+ (let (done)
+ (unless (local-variable-p 'notmuch-search-json-parser)
+ (set (make-local-variable 'notmuch-search-json-parser)
+ (notmuch-json-create-parser (current-buffer)))
+ (set (make-local-variable 'notmuch-search-process-state) 'begin))