]> git.notmuchmail.org Git - notmuch/blobdiff - emacs/notmuch.el
Merge remote-tracking branch 'amdragon/eager-metadata-v4'
[notmuch] / emacs / notmuch.el
index 057b1aecbe3d15737eccde3f65187c8641f9dfc9..a23d0c2031654ec563cd729092bb49d4f94d557a 100644 (file)
@@ -563,6 +563,10 @@ This function advances the next thread when finished."
   (notmuch-search-remove-tag-thread "inbox")
   (forward-line))
 
   (notmuch-search-remove-tag-thread "inbox")
   (forward-line))
 
+(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-sentinel (proc msg)
   "Add a message to let user know when \"notmuch search\" exits"
   (let ((buffer (process-buffer proc))
 (defun notmuch-search-process-sentinel (proc msg)
   "Add a message to let user know when \"notmuch search\" exits"
   (let ((buffer (process-buffer proc))
@@ -580,6 +584,8 @@ This function advances the next thread when finished."
                      (insert "Incomplete search results (search process was killed).\n"))
                  (if (eq status 'exit)
                      (progn
                      (insert "Incomplete search results (search process was killed).\n"))
                  (if (eq status 'exit)
                      (progn
+                       (if notmuch-search-process-filter-data
+                           (insert (concat "Error: Unexpected output from notmuch search:\n" notmuch-search-process-filter-data)))
                        (insert "End of search results.")
                        (if (not (= exit-status 0))
                            (insert (format " (process returned %d)" exit-status)))
                        (insert "End of search results.")
                        (if (not (= exit-status 0))
                            (insert (format " (process returned %d)" exit-status)))
@@ -606,7 +612,7 @@ The attributes defined for matching tags are merged, with later
 attributes overriding earlier. A message having both \"delete\"
 and \"unread\" tags with the above settings would have a green
 foreground and blue background."
 attributes overriding earlier. A message having both \"delete\"
 and \"unread\" tags with the above settings would have a green
 foreground and blue background."
-  :type '(alist :key-type (string) :value-type (list))
+  :type '(alist :key-type (string) :value-type (custom-face-edit))
   :group 'notmuch)
 
 (defun notmuch-search-color-line (start end line-tag-list)
   :group 'notmuch)
 
 (defun notmuch-search-color-line (start end line-tag-list)
@@ -745,7 +751,9 @@ non-authors is found, assume that all of the authors match."
          (save-excursion
            (let ((line 0)
                  (more t)
          (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)))
              (while more
                (while (and (< line (length string)) (= (elt string line) ?\n))
                  (setq line (1+ line)))
@@ -775,7 +783,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))
                  (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)))
                  ))))
          (if found-target
              (goto-char found-target)))