2015-11-11 20:45:30 +00:00
|
|
|
;;; packages.el --- mu4e Layer packages File for Spacemacs
|
2015-08-02 05:30:30 +00:00
|
|
|
;;
|
2017-01-06 03:51:13 +00:00
|
|
|
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
|
2015-08-02 05:30:30 +00:00
|
|
|
;;
|
|
|
|
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
;;
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
;;
|
|
|
|
;;; License: GPLv3
|
|
|
|
|
2015-11-11 20:45:30 +00:00
|
|
|
(setq mu4e-packages
|
2016-01-12 03:25:03 +00:00
|
|
|
'(
|
2016-02-21 04:05:36 +00:00
|
|
|
(mu4e :location site)
|
2016-01-30 01:56:33 +00:00
|
|
|
mu4e-alert
|
2016-01-12 04:20:20 +00:00
|
|
|
mu4e-maildirs-extension
|
|
|
|
org
|
2017-04-29 17:30:07 +00:00
|
|
|
persp-mode
|
2016-01-12 04:20:20 +00:00
|
|
|
))
|
2015-08-02 05:30:30 +00:00
|
|
|
|
2017-04-29 17:30:07 +00:00
|
|
|
(defun mu4e/post-init-persp-mode ()
|
|
|
|
(spacemacs|define-custom-layout mu4e-spacemacs-layout-name
|
|
|
|
:binding mu4e-spacemacs-layout-binding
|
|
|
|
:body
|
|
|
|
(progn
|
|
|
|
(defun spacemacs-layouts/add-mu4e-buffer-to-persp ()
|
|
|
|
(persp-add-buffer (current-buffer)
|
|
|
|
(persp-get-by-name
|
|
|
|
mu4e-spacemacs-layout-name)))
|
|
|
|
(add-hook 'mu4e-main-mode #'spacemacs-layouts/add-mu4e-buffer-to-persp)
|
|
|
|
(add-hook 'mu4e-headers-mode #'spacemacs-layouts/add-mu4e-buffer-to-persp)
|
|
|
|
(add-hook 'mu4e-view-mode #'spacemacs-layouts/add-mu4e-buffer-to-persp)
|
|
|
|
(add-hook 'mu4e-compose-mode #'spacemacs-layouts/add-mu4e-buffer-to-persp)
|
|
|
|
(call-interactively 'mu4e)
|
|
|
|
(call-interactively 'mu4e-update-index))))
|
|
|
|
|
2015-08-02 05:30:30 +00:00
|
|
|
(defun mu4e/init-mu4e ()
|
|
|
|
(use-package mu4e
|
2015-11-11 20:45:30 +00:00
|
|
|
:commands (mu4e mu4e-compose-new)
|
2015-08-02 05:30:30 +00:00
|
|
|
:init
|
|
|
|
(progn
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys "a M" 'mu4e)
|
2016-01-12 03:25:03 +00:00
|
|
|
(global-set-key (kbd "C-x m") 'mu4e-compose-new))
|
2015-08-02 05:30:30 +00:00
|
|
|
:config
|
|
|
|
(progn
|
2015-11-19 05:24:27 +00:00
|
|
|
(evilified-state-evilify-map mu4e-main-mode-map
|
2015-08-02 05:30:30 +00:00
|
|
|
:mode mu4e-main-mode
|
|
|
|
:bindings
|
|
|
|
(kbd "j") 'mu4e~headers-jump-to-maildir)
|
2015-11-23 06:55:56 +00:00
|
|
|
|
|
|
|
(evilified-state-evilify-map
|
|
|
|
mu4e-headers-mode-map
|
|
|
|
:mode mu4e-headers-mode
|
|
|
|
:bindings
|
|
|
|
(kbd "C-j") 'mu4e-headers-next
|
|
|
|
(kbd "C-k") 'mu4e-headers-prev
|
|
|
|
(kbd "J") (lambda ()
|
|
|
|
(interactive)
|
|
|
|
(mu4e-headers-mark-thread nil '(read))))
|
|
|
|
|
|
|
|
(evilified-state-evilify-map
|
|
|
|
mu4e-view-mode-map
|
|
|
|
:mode mu4e-view-mode
|
|
|
|
:bindings
|
|
|
|
(kbd "C-j") 'mu4e-view-headers-next
|
|
|
|
(kbd "C-k") 'mu4e-view-headers-prev
|
|
|
|
(kbd "J") (lambda ()
|
|
|
|
(interactive)
|
|
|
|
(mu4e-view-mark-thread '(read))))
|
2015-08-02 05:30:30 +00:00
|
|
|
|
2017-02-03 13:40:29 +00:00
|
|
|
(spacemacs/set-leader-keys-for-major-mode 'mu4e-compose-mode
|
2017-05-23 13:39:35 +00:00
|
|
|
dotspacemacs-major-mode-leader-key 'message-send-and-exit
|
2017-02-03 13:40:29 +00:00
|
|
|
"c" 'message-send-and-exit
|
|
|
|
"k" 'message-kill-buffer
|
|
|
|
"a" 'message-kill-buffer
|
|
|
|
"s" 'message-dont-send ; saves as draft
|
|
|
|
"f" 'mml-attach-file)
|
|
|
|
|
2016-03-02 04:29:00 +00:00
|
|
|
(setq mu4e-completing-read-function 'completing-read)
|
2015-08-02 05:30:30 +00:00
|
|
|
|
|
|
|
(add-to-list 'mu4e-view-actions
|
|
|
|
'("View in browser" . mu4e-action-view-in-browser) t)
|
2015-11-13 09:03:25 +00:00
|
|
|
|
|
|
|
(when mu4e-account-alist
|
|
|
|
(add-hook 'mu4e-compose-pre-hook 'mu4e/set-account)
|
|
|
|
(add-hook 'message-sent-hook 'mu4e/mail-account-reset)))))
|
2016-01-05 17:45:57 +00:00
|
|
|
|
2016-01-30 01:56:33 +00:00
|
|
|
(defun mu4e/init-mu4e-alert ()
|
|
|
|
(use-package mu4e-alert
|
|
|
|
:defer t
|
2016-02-14 16:20:14 +00:00
|
|
|
:init (with-eval-after-load 'mu4e
|
|
|
|
(when mu4e-enable-notifications
|
|
|
|
(mu4e-alert-enable-notifications))
|
|
|
|
(when mu4e-enable-mode-line
|
|
|
|
(mu4e-alert-enable-mode-line-display)))))
|
2016-01-30 01:56:33 +00:00
|
|
|
|
2016-01-05 17:45:57 +00:00
|
|
|
(defun mu4e/init-mu4e-maildirs-extension ()
|
|
|
|
(use-package mu4e-maildirs-extension
|
2016-01-09 03:34:52 +00:00
|
|
|
:defer t
|
|
|
|
:init (with-eval-after-load 'mu4e (mu4e-maildirs-extension-load))))
|
2016-01-12 04:20:20 +00:00
|
|
|
|
|
|
|
(defun mu4e/post-init-org ()
|
|
|
|
;; load org-mu4e when org is actually loaded
|
2016-01-12 05:08:51 +00:00
|
|
|
(with-eval-after-load 'org (require 'org-mu4e nil 'noerror)))
|
2016-01-12 04:20:20 +00:00
|
|
|
|
|
|
|
|