app/email: improve mu4e lifetime management & fix =email
This commit is contained in:
parent
be94fc4d91
commit
6291cb1979
1 changed files with 23 additions and 1 deletions
|
@ -1,10 +1,19 @@
|
||||||
;;; app/email/autoload/email.el -*- lexical-binding: t; -*-
|
;;; app/email/autoload/email.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
(defvar +email-workspace-name "*mu4e*"
|
||||||
|
"TODO")
|
||||||
|
|
||||||
|
(add-hook 'mu4e-main-mode-hook #'+email|init)
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun =email ()
|
(defun =email ()
|
||||||
"Start email client."
|
"Start email client."
|
||||||
(interactive)
|
(interactive)
|
||||||
(call-interactively #'mu4e))
|
(+workspace-switch +email-workspace-name t)
|
||||||
|
(mu4e~start 'mu4e~main-view)
|
||||||
|
;; (save-selected-window
|
||||||
|
;; (prolusion-mail-show))
|
||||||
|
)
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +email/compose ()
|
(defun +email/compose ()
|
||||||
|
@ -13,3 +22,16 @@
|
||||||
;; TODO Interactively select email account
|
;; TODO Interactively select email account
|
||||||
(call-interactively #'mu4e-compose-new))
|
(call-interactively #'mu4e-compose-new))
|
||||||
|
|
||||||
|
|
||||||
|
;;
|
||||||
|
;; Hooks
|
||||||
|
;;
|
||||||
|
|
||||||
|
(defun +email|init ()
|
||||||
|
(add-hook 'kill-buffer-hook #'+email|kill-mu4e nil t))
|
||||||
|
|
||||||
|
(defun +email|kill-mu4e ()
|
||||||
|
;; (prolusion-mail-hide)
|
||||||
|
(when (+workspace-exists-p +email-workspace-name)
|
||||||
|
(+workspace/delete +email-workspace-name)))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue