email/mu4e: restore window config when mu4e quit
- see https://github.com/hlissner/doom-emacs/pull/2123#issuecomment-560010891
This commit is contained in:
parent
4126d3be81
commit
a7eef56b9d
1 changed files with 10 additions and 4 deletions
|
@ -44,6 +44,7 @@ default/fallback account."
|
||||||
|
|
||||||
(defvar +mu4e-workspace-name "*mu4e*"
|
(defvar +mu4e-workspace-name "*mu4e*"
|
||||||
"TODO")
|
"TODO")
|
||||||
|
(defvar +mu4e--old-wconf nil)
|
||||||
|
|
||||||
(add-hook 'mu4e-main-mode-hook #'+mu4e-init-h)
|
(add-hook 'mu4e-main-mode-hook #'+mu4e-init-h)
|
||||||
|
|
||||||
|
@ -53,7 +54,8 @@ default/fallback account."
|
||||||
(interactive)
|
(interactive)
|
||||||
(require 'mu4e)
|
(require 'mu4e)
|
||||||
(if (featurep :ui 'workspaces)
|
(if (featurep :ui 'workspaces)
|
||||||
(+workspace-switch +mu4e-workspace-name t))
|
(+workspace-switch +mu4e-workspace-name t)
|
||||||
|
(setq +mu4e--old-wconf (current-window-configuration)))
|
||||||
(delete-other-windows)
|
(delete-other-windows)
|
||||||
(switch-to-buffer (doom-fallback-buffer))
|
(switch-to-buffer (doom-fallback-buffer))
|
||||||
(mu4e~start 'mu4e~main-view)
|
(mu4e~start 'mu4e~main-view)
|
||||||
|
@ -77,6 +79,10 @@ default/fallback account."
|
||||||
|
|
||||||
(defun +mu4e-kill-mu4e-h ()
|
(defun +mu4e-kill-mu4e-h ()
|
||||||
;; (prolusion-mail-hide)
|
;; (prolusion-mail-hide)
|
||||||
(when (and (featurep :ui 'workspaces)
|
(cond
|
||||||
(+workspace-exists-p +mu4e-workspace-name))
|
((and (featurep :ui 'workspaces) (+workspace-exists-p +mu4e-workspace-name))
|
||||||
(+workspace/delete +mu4e-workspace-name)))
|
(+workspace/delete +mu4e-workspace-name))
|
||||||
|
|
||||||
|
(+mu4e--old-wconf
|
||||||
|
(set-window-configuration +mu4e--old-wconf)
|
||||||
|
(setq +mu4e--old-wconf nil))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue