org-mu4e: use pre-init and post-init functions

This commit is contained in:
syl20bnr 2016-01-11 23:20:20 -05:00
parent 408e710e39
commit ac8a4bc7df
2 changed files with 15 additions and 4 deletions

View File

@ -15,7 +15,9 @@
;; This is a hack because mu4e is installed as part of
;; mu installation.
(mu4e :location built-in)
(mu4e-maildirs-extension)))
mu4e-maildirs-extension
org
))
(defun mu4e/init-mu4e ()
(use-package mu4e
@ -40,9 +42,6 @@
(add-to-list 'mu4e-view-actions
'("View in browser" . mu4e-action-view-in-browser) t)
(when (configuration-layer/layer-usedp 'org)
(require 'org-mu4e))
(when mu4e-account-alist
(add-hook 'mu4e-compose-pre-hook 'mu4e/set-account)
(add-hook 'message-sent-hook 'mu4e/mail-account-reset)))))
@ -51,3 +50,9 @@
(use-package mu4e-maildirs-extension
:defer t
:init (with-eval-after-load 'mu4e (mu4e-maildirs-extension-load))))
(defun mu4e/post-init-org ()
;; load org-mu4e when org is actually loaded
(with-eval-after-load 'org (require 'org-mu4e)))

View File

@ -19,6 +19,7 @@
flyspell
gnuplot
htmlize
mu4e
;; org and org-agenda are installed by `org-plus-contrib'
(org :location built-in)
(org-agenda :location built-in)
@ -73,6 +74,11 @@
:init (spacemacs/set-leader-keys-for-major-mode 'org-mode
"tp" 'org-plot/gnuplot)))
(defun org/pre-init-mu4e ()
;; Load org-mu4e when mu4e is actually loaded
(spacemacs|use-package-add-hook mu4e
:post-config (require 'org-mu4e)))
;; dummy init function to force installation of `org-plus-contrib'
(defun org/init-org-plus-contrib ())