mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-25 04:18:08 +01:00
emacs: Helper for reporting search parsing errors
This removes the last bit of direct output from the parsing function. With the parser now responsible solely for parsing, we can swap it out for another parser.
This commit is contained in:
parent
e4818cc9c5
commit
9b4361d0fe
1 changed files with 7 additions and 1 deletions
|
@ -741,6 +741,11 @@ non-authors is found, assume that all of the authors match."
|
||||||
(put-text-property beg (point) 'notmuch-search-authors authors)
|
(put-text-property beg (point) 'notmuch-search-authors authors)
|
||||||
(put-text-property beg (point) 'notmuch-search-subject subject))))
|
(put-text-property beg (point) 'notmuch-search-subject subject))))
|
||||||
|
|
||||||
|
(defun notmuch-search-show-error (string &rest objects)
|
||||||
|
(insert "Error: Unexpected output from notmuch search:\n")
|
||||||
|
(insert (apply #'format string objects))
|
||||||
|
(insert "\n"))
|
||||||
|
|
||||||
(defun notmuch-search-process-filter (proc string)
|
(defun notmuch-search-process-filter (proc string)
|
||||||
"Process and filter the output of \"notmuch search\""
|
"Process and filter the output of \"notmuch search\""
|
||||||
(let ((buffer (process-buffer proc))
|
(let ((buffer (process-buffer proc))
|
||||||
|
@ -766,7 +771,8 @@ non-authors is found, assume that all of the authors match."
|
||||||
(tag-list (if tags (save-match-data (split-string tags)))))
|
(tag-list (if tags (save-match-data (split-string tags)))))
|
||||||
(goto-char (point-max))
|
(goto-char (point-max))
|
||||||
(if (/= (match-beginning 1) line)
|
(if (/= (match-beginning 1) line)
|
||||||
(insert (concat "Error: Unexpected output from notmuch search:\n" (substring string line (match-beginning 1)) "\n")))
|
(notmuch-search-show-error
|
||||||
|
(substring string line (match-beginning 1))))
|
||||||
(when (string= thread-id notmuch-search-target-thread)
|
(when (string= thread-id notmuch-search-target-thread)
|
||||||
(set 'found-target (point))
|
(set 'found-target (point))
|
||||||
(set 'notmuch-search-target-thread "found"))
|
(set 'notmuch-search-target-thread "found"))
|
||||||
|
|
Loading…
Reference in a new issue