mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-22 02:48:08 +01:00
emacs: Use unified error handling in notmuch-call-notmuch-process
This makes notmuch-call-notmuch-process use the unified CLI error handling, which basically refines the error handling this function already did.
This commit is contained in:
parent
693cf03cee
commit
0844af35eb
1 changed files with 7 additions and 13 deletions
|
@ -536,19 +536,13 @@ If BARE is set then do not prefix with \"thread:\""
|
||||||
(defun notmuch-call-notmuch-process (&rest args)
|
(defun notmuch-call-notmuch-process (&rest args)
|
||||||
"Synchronously invoke \"notmuch\" with the given list of arguments.
|
"Synchronously invoke \"notmuch\" with the given list of arguments.
|
||||||
|
|
||||||
Output from the process will be presented to the user as an error
|
If notmuch exits with a non-zero status, output from the process
|
||||||
and will also appear in a buffer named \"*Notmuch errors*\"."
|
will appear in a buffer named \"*Notmuch errors*\" and an error
|
||||||
(let ((error-buffer (get-buffer-create "*Notmuch errors*")))
|
will be signaled."
|
||||||
(with-current-buffer error-buffer
|
(with-temp-buffer
|
||||||
(erase-buffer))
|
(let ((status (apply #'call-process notmuch-command nil t nil args)))
|
||||||
(if (eq (apply 'call-process notmuch-command nil error-buffer nil args) 0)
|
(notmuch-check-exit-status status (cons notmuch-command args)
|
||||||
(point)
|
(buffer-string)))))
|
||||||
(progn
|
|
||||||
(with-current-buffer error-buffer
|
|
||||||
(let ((beg (point-min))
|
|
||||||
(end (- (point-max) 1)))
|
|
||||||
(error (buffer-substring beg end))
|
|
||||||
))))))
|
|
||||||
|
|
||||||
(defun notmuch-search-set-tags (tags &optional pos)
|
(defun notmuch-search-set-tags (tags &optional pos)
|
||||||
(let ((new-result (plist-put (notmuch-search-get-result pos) :tags tags)))
|
(let ((new-result (plist-put (notmuch-search-get-result pos) :tags tags)))
|
||||||
|
|
Loading…
Reference in a new issue