mu4e: improve startup routine

Switch to main buffer if it already exists, in the non-background case.
This commit is contained in:
Dirk-Jan C. Binnema 2023-11-10 16:33:50 +02:00
parent 171fe9a018
commit 2058f15506
1 changed files with 8 additions and 7 deletions

View File

@ -61,13 +61,14 @@
Then, show the main window, unless BACKGROUND (prefix-argument)
is non-nil."
(interactive "P")
(if (and (not background) (buffer-live-p mu4e-main-buffer-name))
;; already running.
(switch-to-buffer mu4e-main-buffer-name)
;; start mu4e, then show the main view
(mu4e--init-handlers)
(mu4e--start
(unless background #'mu4e--main-view))))
(if (not (mu4e-running-p))
(progn
(mu4e--init-handlers)
(mu4e--start (unless background #'mu4e--main-view)))
;; mu4e already running
(when (and (not background)
(buffer-live-p (get-buffer mu4e-main-buffer-name)))
(switch-to-buffer mu4e-main-buffer-name))))
(defun mu4e-quit(&optional bury)
"Quit the mu4e session or bury the buffer.