X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=emacs%2Fnotmuch.el;h=af107e28f3aa01b8df3f08da431e777002521bd5;hb=9de0639126091fa0e48cfde69e3f6044d167a76a;hp=b8d9c44475d0bd86c9ae56538799a3baa1baacee;hpb=08fde50bf3a4c54f6413aff4052e0d84392463f9;p=notmuch diff --git a/emacs/notmuch.el b/emacs/notmuch.el index b8d9c444..af107e28 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -58,6 +58,7 @@ (require 'notmuch-hello) (require 'notmuch-maildir-fcc) (require 'notmuch-message) +(require 'notmuch-parser) (defcustom notmuch-search-result-format `(("date" . "%12s ") @@ -561,7 +562,7 @@ will be signaled." (defun notmuch-search-tag-region (beg end &optional tag-changes) "Change tags for threads in the given region." (let ((search-string (notmuch-search-find-thread-id-region-search beg end))) - (setq tag-changes (funcall 'notmuch-tag search-string tag-changes)) + (setq tag-changes (notmuch-tag search-string tag-changes)) (notmuch-search-foreach-result beg end (lambda (pos) (notmuch-search-set-tags @@ -575,7 +576,7 @@ See `notmuch-tag' for information on the format of TAG-CHANGES." (interactive) (let* ((beg (if (region-active-p) (region-beginning) (point))) (end (if (region-active-p) (region-end) (point)))) - (funcall 'notmuch-search-tag-region beg end tag-changes))) + (notmuch-search-tag-region beg end tag-changes))) (defun notmuch-search-add-tag () "Same as `notmuch-search-tag' but sets initial input to '+'." @@ -809,13 +810,6 @@ non-authors is found, assume that all of the authors match." (setq notmuch-search-target-thread "found") (goto-char beg))))) -(defun notmuch-search-show-error (string &rest objects) - (save-excursion - (goto-char (point-max)) - (insert "Error: Unexpected output from notmuch search:\n") - (insert (apply #'format string objects)) - (insert "\n"))) - (defun notmuch-search-process-filter (proc string) "Process and filter the output of \"notmuch search\"" (let ((results-buf (process-buffer proc)) @@ -829,8 +823,7 @@ non-authors is found, assume that all of the authors match." (save-excursion (goto-char (point-max)) (insert string)) - (notmuch-json-parse-partial-list 'notmuch-search-show-result - 'notmuch-search-show-error + (notmuch-sexp-parse-partial-list 'notmuch-search-show-result results-buf))))) (defun notmuch-search-tag-all (&optional tag-changes) @@ -933,7 +926,7 @@ Other optional parameters are used as follows: (save-excursion (let ((proc (notmuch-start-notmuch "notmuch-search" buffer #'notmuch-search-process-sentinel - "search" "--format=json" "--format-version=1" + "search" "--format=sexp" "--format-version=1" (if oldest-first "--sort=oldest-first" "--sort=newest-first")