mirror of https://github.com/djcb/mu.git
mu4e: improve startup routine
Switch to main buffer if it already exists, in the non-background case.
This commit is contained in:
parent
171fe9a018
commit
2058f15506
15
mu4e/mu4e.el
15
mu4e/mu4e.el
|
@ -61,13 +61,14 @@
|
||||||
Then, show the main window, unless BACKGROUND (prefix-argument)
|
Then, show the main window, unless BACKGROUND (prefix-argument)
|
||||||
is non-nil."
|
is non-nil."
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
(if (and (not background) (buffer-live-p mu4e-main-buffer-name))
|
(if (not (mu4e-running-p))
|
||||||
;; already running.
|
(progn
|
||||||
(switch-to-buffer mu4e-main-buffer-name)
|
(mu4e--init-handlers)
|
||||||
;; start mu4e, then show the main view
|
(mu4e--start (unless background #'mu4e--main-view)))
|
||||||
(mu4e--init-handlers)
|
;; mu4e already running
|
||||||
(mu4e--start
|
(when (and (not background)
|
||||||
(unless background #'mu4e--main-view))))
|
(buffer-live-p (get-buffer mu4e-main-buffer-name)))
|
||||||
|
(switch-to-buffer mu4e-main-buffer-name))))
|
||||||
|
|
||||||
(defun mu4e-quit(&optional bury)
|
(defun mu4e-quit(&optional bury)
|
||||||
"Quit the mu4e session or bury the buffer.
|
"Quit the mu4e session or bury the buffer.
|
||||||
|
|
Loading…
Reference in New Issue