]> git.notmuchmail.org Git - notmuch/blobdiff - emacs/notmuch.el
Merge branch 'release'
[notmuch] / emacs / notmuch.el
index b0fd387ec0107b92c1b9642ad8e5268ec64d22f5..4c1a6cacd4da5bdf47a13919cedaef2538457b30 100644 (file)
@@ -650,11 +650,18 @@ of the result."
                      (insert "Incomplete search results (search process was killed).\n"))
                  (when (eq status 'exit)
                    (insert "End of search results.\n")
                      (insert "Incomplete search results (search process was killed).\n"))
                  (when (eq status 'exit)
                    (insert "End of search results.\n")
-                   (condition-case nil
+                   ;; For version mismatch, there's no point in
+                   ;; showing the search buffer
+                   (when (or (= exit-status 20) (= exit-status 21))
+                     (kill-buffer))
+                   (condition-case err
                        (notmuch-check-async-exit-status proc msg)
                      ;; Suppress the error signal since strange
                        (notmuch-check-async-exit-status proc msg)
                      ;; Suppress the error signal since strange
-                     ;; things happen if a sentinel signals.
-                     (error (throw 'return nil)))
+                     ;; things happen if a sentinel signals.  Mimic
+                     ;; the top-level's handling of error messages.
+                     (error
+                      (message "%s" (error-message-string err))
+                      (throw 'return nil)))
                    (if (and atbob
                             (not (string= notmuch-search-target-thread "found")))
                        (set 'never-found-target-thread t)))))
                    (if (and atbob
                             (not (string= notmuch-search-target-thread "found")))
                        (set 'never-found-target-thread t)))))
@@ -790,9 +797,8 @@ non-authors is found, assume that all of the authors match."
     (notmuch-search-insert-authors format-string (plist-get result :authors)))
 
    ((string-equal field "tags")
     (notmuch-search-insert-authors format-string (plist-get result :authors)))
 
    ((string-equal field "tags")
-    (let ((tags-str (mapconcat 'identity (plist-get result :tags) " ")))
-      (insert (propertize (format format-string tags-str)
-                         'face 'notmuch-tag-face))))))
+    (let ((tags (plist-get result :tags)))
+      (insert (format format-string (notmuch-tag-format-tags tags)))))))
 
 (defun notmuch-search-show-result (result &optional pos)
   "Insert RESULT at POS or the end of the buffer if POS is null."
 
 (defun notmuch-search-show-result (result &optional pos)
   "Insert RESULT at POS or the end of the buffer if POS is null."
@@ -935,7 +941,7 @@ Other optional parameters are used as follows:
        (let ((proc (start-process
                     "notmuch-search" buffer
                     notmuch-command "search"
        (let ((proc (start-process
                     "notmuch-search" buffer
                     notmuch-command "search"
-                    "--format=json"
+                    "--format=json" "--format-version=1"
                     (if oldest-first
                         "--sort=oldest-first"
                       "--sort=newest-first")
                     (if oldest-first
                         "--sort=oldest-first"
                       "--sort=newest-first")