diff options
author | Carl Worth <cworth@cworth.org> | 2011-03-10 15:29:24 -0800 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2011-03-10 16:25:37 -0800 |
commit | 8a534dc60d5f4bf579eabda9ae482a1982de3e4e (patch) | |
tree | 7af07c6fc510b4293bfb491bc496bb7e2493dbda /emacs | |
parent | 44d3c57e2a62e8d8a299894619389d90c2b97a14 (diff) |
emacs: Fix notmuch-search-process-filter to handle incomplete lines
This fixes the recently-added emacs-large-search-buffer test. This is
as simple as saving any trailing input and then pre-prepending it on
the next call.
MAny thanks to Thomas Schwinge <thomas@schwinge.name> for tracking
down this problem and contributing a preliminary version of this fix.
Diffstat (limited to 'emacs')
-rw-r--r-- | emacs/notmuch.el | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/emacs/notmuch.el b/emacs/notmuch.el index 057b1aec..dbf269a5 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -736,6 +736,10 @@ non-authors is found, assume that all of the authors match." do (notmuch-search-insert-field field date count authors subject tags))) (insert "\n")) +(defvar notmuch-search-process-filter-data nil + "Data that has not yet been processed.") +(make-variable-buffer-local 'notmuch-search-process-filter-data) + (defun notmuch-search-process-filter (proc string) "Process and filter the output of \"notmuch search\"" (let ((buffer (process-buffer proc)) @@ -745,7 +749,9 @@ non-authors is found, assume that all of the authors match." (save-excursion (let ((line 0) (more t) - (inhibit-read-only t)) + (inhibit-read-only t) + (string (concat notmuch-search-process-filter-data string))) + (setq notmuch-search-process-filter-data nil) (while more (while (and (< line (length string)) (= (elt string line) ?\n)) (setq line (1+ line))) @@ -775,7 +781,7 @@ non-authors is found, assume that all of the authors match." (while (and (< line (length string)) (= (elt string line) ?\n)) (setq line (1+ line))) (if (< line (length string)) - (insert (concat "Error: Unexpected output from notmuch search:\n" (substring string line) "\n"))) + (setq notmuch-search-process-filter-data (substring string line))) )))) (if found-target (goto-char found-target))) |