aboutsummaryrefslogtreecommitdiffhomepage
path: root/emacs/notmuch.el
diff options
context:
space:
mode:
authorGravatar Austin Clements <amdragon@MIT.EDU>2012-12-15 15:04:19 -0500
committerGravatar David Bremner <bremner@debian.org>2012-12-16 17:17:41 -0400
commit19e5b2d912b52145403c3f11b0c30c84d7f2b409 (patch)
tree10059d311b3d33c7904559a0b8360a89caa942eb /emacs/notmuch.el
parentb3dc31f78d7b489e30842aa19733261769afb84d (diff)
emacs: Use unified error handling in search
This slightly changes the output of an existing test since we now report non-zero exits with a pop-up buffer instead of at the end of the search results.
Diffstat (limited to 'emacs/notmuch.el')
-rw-r--r--emacs/notmuch.el13
1 files changed, 8 insertions, 5 deletions
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 9da8df4d..b0fd387e 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -638,6 +638,7 @@ of the result."
(exit-status (process-exit-status proc))
(never-found-target-thread nil))
(when (memq status '(exit signal))
+ (catch 'return
(kill-buffer (process-get proc 'parse-buf))
(if (buffer-live-p buffer)
(with-current-buffer buffer
@@ -648,17 +649,19 @@ of the result."
(if (eq status 'signal)
(insert "Incomplete search results (search process was killed).\n"))
(when (eq status 'exit)
- (insert "End of search results.")
- (unless (= exit-status 0)
- (insert (format " (process returned %d)" exit-status)))
- (insert "\n")
+ (insert "End of search results.\n")
+ (condition-case nil
+ (notmuch-check-async-exit-status proc msg)
+ ;; Suppress the error signal since strange
+ ;; things happen if a sentinel signals.
+ (error (throw 'return nil)))
(if (and atbob
(not (string= notmuch-search-target-thread "found")))
(set 'never-found-target-thread t)))))
(when (and never-found-target-thread
notmuch-search-target-line)
(goto-char (point-min))
- (forward-line (1- notmuch-search-target-line))))))))
+ (forward-line (1- notmuch-search-target-line)))))))))
(defcustom notmuch-search-line-faces '(("unread" :weight bold)
("flagged" :foreground "blue"))