ea9ce5ef6d
This commit deactivates account selection and switching support if the account list isn't defined. We also don't need the follow-up action of undoing the account selection changes, so we can just skip both of the hooks. This is useful for users who only have 1 account - they don't need the helm popup to select which account to use. They can just define the variables outside of the `mu4e-account-list`.
40 lines
1.2 KiB
EmacsLisp
40 lines
1.2 KiB
EmacsLisp
;;; packages.el --- mu4e Layer packages File for Spacemacs
|
|
;;
|
|
;; Copyright (c) 2012-2014 Sylvain Benner
|
|
;; Copyright (c) 2014-2015 Sylvain Benner & Contributors
|
|
;;
|
|
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
;;
|
|
;; This file is not part of GNU Emacs.
|
|
;;
|
|
;;; License: GPLv3
|
|
|
|
(setq mu4e-packages
|
|
'((mu4e :location built-in)))
|
|
|
|
(defun mu4e/init-mu4e ()
|
|
(use-package mu4e
|
|
:commands (mu4e mu4e-compose-new)
|
|
:init
|
|
(progn
|
|
(evil-leader/set-key "a M" 'mu4e)
|
|
(global-set-key (kbd "C-x m") 'mu4e-compose-new))
|
|
:config
|
|
(progn
|
|
(spacemacs|evilify-map mu4e-main-mode-map
|
|
:mode mu4e-main-mode
|
|
:bindings
|
|
(kbd "j") 'mu4e~headers-jump-to-maildir)
|
|
(spacemacs|evilify-map mu4e-headers-mode-map :mode mu4e-headers-mode)
|
|
(spacemacs|evilify-map mu4e-view-mode-map :mode mu4e-view-mode)
|
|
|
|
(setq mu4e-completing-read-function 'helm--completing-read-default)
|
|
|
|
(add-to-list 'mu4e-view-actions
|
|
'("View in browser" . mu4e-action-view-in-browser) t)
|
|
|
|
(when mu4e-account-alist
|
|
(add-hook 'mu4e-compose-pre-hook 'mu4e/set-account)
|
|
(add-hook 'message-sent-hook 'mu4e/mail-account-reset)))))
|