summary refs log tree commit diff stats
path: root/emacs
diff options
context:
space:
mode:
Diffstat (limited to 'emacs')
-rw-r--r--emacs/.emacs.d/main.el210
1 files changed, 102 insertions, 108 deletions
diff --git a/emacs/.emacs.d/main.el b/emacs/.emacs.d/main.el
index 64306bc..655afdf 100644
--- a/emacs/.emacs.d/main.el
+++ b/emacs/.emacs.d/main.el
@@ -1227,114 +1227,108 @@ With two prefix arguments, write out the day and month name."
 
 ;;;;; mu
 
-(when (executable-find "mu")
-  (add-to-list 'load-path (expand-file-name
-                           "../share/emacs/site-lisp/mu4e"
-                           (f-dirname
-                            (file-truename
-                             (executable-find "mu")))))
-  (use-package mu4e
-    :defines (mu4e-use-fancy-chars
-              mu4e-attachment-dir
-              mu4e-view-show-images
-              mu4e-update-interval
-              mu4e-maildir-shortcuts
-              mu4e-headers-date-format
-              mu4e-maildir
-              mu4e-mu-home
-              mu4e-sent-folder
-              mu4e-drafts-folder
-              mu4e-refile-folder
-              mu4e-trash-folder
-              mu4e-user-mail-address-list
-              mu4e-contexts)
-    :init (setq mail-user-agent 'mu4e-user-agent)
-    :config (progn
-              (setq mu4e-use-fancy-chars nil
-                    mu4e-attachment-dir "~/Downloads/"
-                    mu4e-view-show-images t
-                    mu4e-hide-index-messages t
-                    mu4e-completing-read-function #'ivy-completing-read
-                    mu4e-headers-date-format "%Y-%m-%d %H:%M"
-                    mu4e-update-interval 900
-                    mu4e-index-cleanup nil
-                    mu4e-index-lazy-check t
-
-                    mu4e-maildir (expand-file-name "~/mail")
-
-                    mu4e-change-filenames-when-moving t
-
-                    message-kill-buffer-on-exit t
-                    mu4e-compose-format-flowed t
-                    message-send-mail-function #'message-send-mail-with-sendmail
-                    sendmail-program "msmtp"
-
-                    mu4e-get-mail-command "mbsync -a"
-
-                    mu4e-contexts
-                    (list
-                     (make-mu4e-context
-                      :name "Personal"
-                      :match-func (lambda (msg)
-                                    (when msg
-                                      (mu4e-message-contact-field-matches
-                                       msg :to "alan@alanpearce\..*")))
-                      :vars `((user-mail-address . "alan@alanpearce.eu")
-                              (mu4e-sent-messages-behavior . sent)
-                              (mu4e-sent-folder . "/personal/alanpearce/Sent")
-                              (mu4e-drafts-folder . "/personal/alanpearce/Drafts")
-                              (mu4e-refile-folder . "/personal/alanpearce/Archive")
-                              (mu4e-trash-folder . "/personal/alanpearce/Trash")
-                              (mu4e-maildir-shortcuts . (("/personal/alanpearce/INBOX" . ?i)
-                                                         ("/personal/alanpearce/Archive" . ?a)
-                                                         ("/personal/alanpearce/Sent" . ?s)
-                                                         ("/personal/alanpearce/Spam" . ?p)
-                                                         ("/personal/alanpearce/Orders" . ?r)))
-                              ))
-                     (make-mu4e-context
-                      :name "Riseup"
-                      :match-func (lambda (msg)
-                                    (when msg
-                                      (mu4e-message-contact-field-matches
-                                       msg :to "alanpearce@riseup.net")))
-                      :vars `((user-mail-address . "alanpearce@riseup.net")
-                              (mu4e-sent-messages-behavior . sent)
-                              (mu4e-sent-folder . "/personal/riseup/Sent")
-                              (mu4e-drafts-folder . "/personal/riseup/Drafts")
-                              (mu4e-refile-folder . "/personal/riseup/Archive")
-                              (mu4e-trash-folder . "/personal/riseup/Trash")
-                              (mu4e-maildir-shortcuts . (("/personal/riseup/INBOX" . ?i)
-                                                         ("/personal/riseup/Archive" . ?a)
-                                                         ("/personal/riseup/Sent" . ?s)
-                                                         ("/personal/riseup/Spam" . ?p)))))
-                     (make-mu4e-context
-                      :name "Satoshipay"
-                      :match-func (lambda (msg)
-                                    (when msg
-                                      (mu4e-message-contact-field-matches
-                                       msg :to "alan@satoshipay.io")))
-                      :vars `((user-mail-address . "alan@satoshipay.io")
-                              (mu4e-sent-messages-behavior . sent)
-                              (mu4e-drafts-folder . "/satoshipay/[Gmail]/Drafts")
-                              (mu4e-sent-folder .   "/satoshipay/[Gmail]/Sent Mail")
-                              (mu4e-refile-folder . "/satoshipay/[Gmail]/All Mail")
-                              (mu4e-trash-folder .  "/satoshipay/[Gmail]/Bin")
-                              (mu4e-maildir-shortcuts . (("/satoshipay/INBOX" . ?i)
-                                                         ("/satoshipay/[Gmail]/All Mail" . ?a)
-                                                         ("/satoshipay/[Gmail]/Sent Mail" . ?s)
-                                                         ("/satoshipay/[Gmail]/Spam" . ?p))))))
-                    mu4e-user-mail-address-list (append
-                                                 (delq nil
-                                                       (mapcar (lambda (context)
-                                                                 (when (mu4e-context-vars context)
-                                                                   (cdr (assq 'user-mail-address (mu4e-context-vars context)))))
-                                                               mu4e-contexts))
-                                                 '("alan@alanpearce.uk"
-                                                   "alan@alanpearce.co.uk")))
-           (define-hook-helper mu4e-view-mode ()
-             ;; try to emulate some of the eww key-bindings
-             (local-set-key (kbd "<tab>") 'shr-next-link)
-             (local-set-key (kbd "<backtab>") 'shr-previous-link)))))
+(use-package mu4e
+  :defines (mu4e-use-fancy-chars
+            mu4e-attachment-dir
+            mu4e-view-show-images
+            mu4e-update-interval
+            mu4e-maildir-shortcuts
+            mu4e-headers-date-format
+            mu4e-maildir
+            mu4e-mu-home
+            mu4e-sent-folder
+            mu4e-drafts-folder
+            mu4e-refile-folder
+            mu4e-trash-folder
+            mu4e-user-mail-address-list
+            mu4e-contexts)
+  :init (setq mail-user-agent 'mu4e-user-agent)
+  :config (progn
+            (setq mu4e-use-fancy-chars nil
+                  mu4e-attachment-dir "~/Downloads/"
+                  mu4e-view-show-images t
+                  mu4e-hide-index-messages t
+                  mu4e-completing-read-function #'ivy-completing-read
+                  mu4e-headers-date-format "%Y-%m-%d %H:%M"
+                  mu4e-update-interval 900
+                  mu4e-index-cleanup nil
+                  mu4e-index-lazy-check t
+
+                  mu4e-maildir (expand-file-name "~/mail")
+
+                  mu4e-change-filenames-when-moving t
+
+                  message-kill-buffer-on-exit t
+                  mu4e-compose-format-flowed t
+                  message-send-mail-function #'message-send-mail-with-sendmail
+                  sendmail-program "msmtp"
+
+                  mu4e-get-mail-command "mbsync -a"
+
+                  mu4e-contexts
+                  (list
+                   (make-mu4e-context
+                    :name "Personal"
+                    :match-func (lambda (msg)
+                                  (when msg
+                                    (mu4e-message-contact-field-matches
+                                     msg :to "alan@alanpearce\..*")))
+                    :vars `((user-mail-address . "alan@alanpearce.eu")
+                            (mu4e-sent-messages-behavior . sent)
+                            (mu4e-sent-folder . "/personal/alanpearce/Sent")
+                            (mu4e-drafts-folder . "/personal/alanpearce/Drafts")
+                            (mu4e-refile-folder . "/personal/alanpearce/Archive")
+                            (mu4e-trash-folder . "/personal/alanpearce/Trash")
+                            (mu4e-maildir-shortcuts . (("/personal/alanpearce/INBOX" . ?i)
+                                                       ("/personal/alanpearce/Archive" . ?a)
+                                                       ("/personal/alanpearce/Sent" . ?s)
+                                                       ("/personal/alanpearce/Spam" . ?p)
+                                                       ("/personal/alanpearce/Orders" . ?r)))
+                            ))
+                   (make-mu4e-context
+                    :name "Riseup"
+                    :match-func (lambda (msg)
+                                  (when msg
+                                    (mu4e-message-contact-field-matches
+                                     msg :to "alanpearce@riseup.net")))
+                    :vars `((user-mail-address . "alanpearce@riseup.net")
+                            (mu4e-sent-messages-behavior . sent)
+                            (mu4e-sent-folder . "/personal/riseup/Sent")
+                            (mu4e-drafts-folder . "/personal/riseup/Drafts")
+                            (mu4e-refile-folder . "/personal/riseup/Archive")
+                            (mu4e-trash-folder . "/personal/riseup/Trash")
+                            (mu4e-maildir-shortcuts . (("/personal/riseup/INBOX" . ?i)
+                                                       ("/personal/riseup/Archive" . ?a)
+                                                       ("/personal/riseup/Sent" . ?s)
+                                                       ("/personal/riseup/Spam" . ?p)))))
+                   (make-mu4e-context
+                    :name "Satoshipay"
+                    :match-func (lambda (msg)
+                                  (when msg
+                                    (mu4e-message-contact-field-matches
+                                     msg :to "alan@satoshipay.io")))
+                    :vars `((user-mail-address . "alan@satoshipay.io")
+                            (mu4e-sent-messages-behavior . sent)
+                            (mu4e-drafts-folder . "/satoshipay/[Gmail]/Drafts")
+                            (mu4e-sent-folder .   "/satoshipay/[Gmail]/Sent Mail")
+                            (mu4e-refile-folder . "/satoshipay/[Gmail]/All Mail")
+                            (mu4e-trash-folder .  "/satoshipay/[Gmail]/Bin")
+                            (mu4e-maildir-shortcuts . (("/satoshipay/INBOX" . ?i)
+                                                       ("/satoshipay/[Gmail]/All Mail" . ?a)
+                                                       ("/satoshipay/[Gmail]/Sent Mail" . ?s)
+                                                       ("/satoshipay/[Gmail]/Spam" . ?p))))))
+                  mu4e-user-mail-address-list (append
+                                               (delq nil
+                                                     (mapcar (lambda (context)
+                                                               (when (mu4e-context-vars context)
+                                                                 (cdr (assq 'user-mail-address (mu4e-context-vars context)))))
+                                                             mu4e-contexts))
+                                               '("alan@alanpearce.uk"
+                                                 "alan@alanpearce.co.uk")))
+            (define-hook-helper mu4e-view-mode ()
+              ;; try to emulate some of the eww key-bindings
+              (local-set-key (kbd "<tab>") 'shr-next-link)
+              (local-set-key (kbd "<backtab>") 'shr-previous-link))))
 
 ;;;; Misc