* mu4e: don't try to kill the visible window when there is none (thanks to thierryvolpiatto)

This commit is contained in:
djcb 2013-10-13 19:48:08 +03:00
parent 44011351da
commit 66ebdf21e0
1 changed files with 10 additions and 13 deletions

View File

@ -824,17 +824,14 @@ in the background; otherwise, pop up a window."
;; not really an error of course, but it's hard to distinguish
;; from a genuine error
(maybe-error (or (not (eq status 'exit)) (/= code 0)))
(buf (process-buffer proc)))
(buf (process-buffer proc))
(visible-window (get-buffer-window buf 'visible)))
(message nil)
;; there may be an error, give the user up to 5 seconds to check
(when maybe-error (sit-for 5))
(mu4e-update-index)
(ignore-errors
;; XXXX something goes wrong here, perhaps we're trying to quit
;; while we're in the echo area? the ignore-errors silences the
;; problem for now...
(when (buffer-live-p buf)
(with-selected-window (get-buffer-window buf) (quit-window t)))))))
(when (and (buffer-live-p buf) visible-window)
(with-selected-window (get-buffer-window buf) (quit-window t))))))
;; if we're running in the foreground, handle password requests
(unless run-in-background
(process-put proc 'x-interactive (not run-in-background))