X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=emacs%2Fnotmuch.el;h=057b1aecbe3d15737eccde3f65187c8641f9dfc9;hp=3d82f0d093ff9f98f43839dbd0b9acf5870a48ac;hb=44d3c57e2a62e8d8a299894619389d90c2b97a14;hpb=4e414e2a5a72e8345df6371b3524030d07c2ce96 diff --git a/emacs/notmuch.el b/emacs/notmuch.el index 3d82f0d0..057b1aec 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -747,6 +747,8 @@ non-authors is found, assume that all of the authors match." (more t) (inhibit-read-only t)) (while more + (while (and (< line (length string)) (= (elt string line) ?\n)) + (setq line (1+ line))) (if (string-match "^\\(thread:[0-9A-Fa-f]*\\) \\([^][]*\\) \\(\\[[0-9/]*\\]\\) \\([^;]*\\); \\(.*\\) (\\([^()]*\\))$" string line) (let* ((thread-id (match-string 1 string)) (date (match-string 2 string)) @@ -756,6 +758,8 @@ non-authors is found, assume that all of the authors match." (tags (match-string 6 string)) (tag-list (if tags (save-match-data (split-string tags))))) (goto-char (point-max)) + (if (/= (match-beginning 1) line) + (insert (concat "Error: Unexpected output from notmuch search:\n" (substring string line (match-beginning 1)) "\n"))) (let ((beg (point-marker))) (notmuch-search-show-result date count authors subject tags) (notmuch-search-color-line beg (point-marker) tag-list) @@ -767,7 +771,12 @@ non-authors is found, assume that all of the authors match." (set 'found-target beg) (set 'notmuch-search-target-thread "found")))) (set 'line (match-end 0))) - (set 'more nil))))) + (set 'more nil) + (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"))) + )))) (if found-target (goto-char found-target))) (delete-process proc))))