Move mu4e config into README.org
Start to rearrange some things to appropriate headings Add an empty diary file to stop complaining about file not being found
This commit is contained in:
parent
731bde0ac0
commit
b288d7b018
383
README.org
383
README.org
|
@ -2,24 +2,17 @@
|
||||||
#+author: Evie Litherland-Smith
|
#+author: Evie Litherland-Smith
|
||||||
#+email: evie@xenia.me.uk
|
#+email: evie@xenia.me.uk
|
||||||
#+filetags: :emacs:config:org:
|
#+filetags: :emacs:config:org:
|
||||||
Personal Emacs config.
|
Personal Emacs configuration. Clone to =~/.config/emacs/= (or
|
||||||
|
=~/.emacs.d/=) and install specified plugins.
|
||||||
Clone to =~/.config/emacs/= (or =~/.emacs.d/=).
|
|
||||||
|
|
||||||
* Config
|
* Config
|
||||||
|
Customise =use-package= first, configuration must be set before first
|
||||||
|
time it's used.
|
||||||
|
|
||||||
** Initial copy from =init.el=
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
;; Customise `use-package' behaviour, must be set before first time
|
;; Configure packages archives with priority
|
||||||
;; it's used. Configure packages archives with priority
|
|
||||||
(setopt use-package-check-before-init t
|
(setopt use-package-check-before-init t
|
||||||
use-package-enable-imenu-support t)
|
use-package-enable-imenu-support t)
|
||||||
|
|
||||||
(setq custom-file (locate-user-emacs-file "custom.el"))
|
|
||||||
(when (and custom-file
|
|
||||||
(file-exists-p custom-file))
|
|
||||||
(load custom-file nil 'nomessage))
|
|
||||||
|
|
||||||
(use-package package
|
(use-package package
|
||||||
:custom
|
:custom
|
||||||
(package-archive-priorities '(("melpa" . 4) ("stable" . 3) ("nongnu" . 2) ("gnu" . 1)))
|
(package-archive-priorities '(("melpa" . 4) ("stable" . 3) ("nongnu" . 2) ("gnu" . 1)))
|
||||||
|
@ -50,25 +43,53 @@ Clone to =~/.config/emacs/= (or =~/.emacs.d/=).
|
||||||
:config
|
:config
|
||||||
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
|
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
|
||||||
(add-to-list 'package-archives '("stable" . "https://stable.melpa.org/packages/"))
|
(add-to-list 'package-archives '("stable" . "https://stable.melpa.org/packages/"))
|
||||||
(package-initialize)
|
(package-initialize))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
Add custom function to ensure required packages are installed and
|
||||||
|
updated.
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp
|
||||||
(defun my/package-ensure ()
|
(defun my/package-ensure ()
|
||||||
"Update package archives and ensure packages are installed."
|
"Ensure packages are installed and updated."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
(require 'use-package)
|
||||||
(package-refresh-contents)
|
(package-refresh-contents)
|
||||||
(package-install-selected-packages)
|
(package-install-selected-packages)
|
||||||
(package-autoremove)))
|
(package-autoremove)
|
||||||
|
(package-upgrade-all))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
(set-default-coding-systems 'utf-8)
|
Load =custom.el= if file exists in default location.
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(setq custom-file (locate-user-emacs-file "custom.el"))
|
||||||
|
(when (and custom-file (file-exists-p custom-file))
|
||||||
|
(load custom-file nil 'nomessage))
|
||||||
|
#+end_src
|
||||||
|
** Defaults
|
||||||
|
Set some useful defaults. Some of these should be moved to relevant
|
||||||
|
section of config.
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp
|
||||||
(setq user-full-name "Evie Litherland-Smith"
|
(setq user-full-name "Evie Litherland-Smith"
|
||||||
user-mail-address "evie@xenia.me.uk"
|
user-mail-address "evie@xenia.me.uk"
|
||||||
inhibit-splash-screen t
|
|
||||||
use-short-answers t
|
use-short-answers t
|
||||||
tab-always-indent 'complete
|
kill-do-not-save-duplicates t)
|
||||||
completion-cycle-threshold nil
|
|
||||||
completions-detailed t
|
(set-default-coding-systems 'utf-8)
|
||||||
kill-do-not-save-duplicates t
|
(global-auto-revert-mode +1)
|
||||||
|
(delete-selection-mode +1)
|
||||||
|
|
||||||
|
;; Bind normal forward/back buttons on mouse to next/previous buffer respectively
|
||||||
|
(keymap-global-set "<mouse-8>" #'previous-buffer)
|
||||||
|
(keymap-global-set "<mouse-9>" #'next-buffer)
|
||||||
|
#+end_src
|
||||||
|
** UI and Appearance
|
||||||
|
Configure the look and feel of Emacs
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(setq inhibit-splash-screen t
|
||||||
initial-frame-alist nil
|
initial-frame-alist nil
|
||||||
default-frame-alist nil)
|
default-frame-alist nil)
|
||||||
|
|
||||||
|
@ -80,12 +101,321 @@ Clone to =~/.config/emacs/= (or =~/.emacs.d/=).
|
||||||
compilation-scroll-output t)
|
compilation-scroll-output t)
|
||||||
|
|
||||||
(global-prettify-symbols-mode +1)
|
(global-prettify-symbols-mode +1)
|
||||||
(global-auto-revert-mode +1)
|
|
||||||
(delete-selection-mode +1)
|
|
||||||
(which-function-mode +1)
|
(which-function-mode +1)
|
||||||
(tool-bar-mode -1)
|
(tool-bar-mode -1)
|
||||||
(scroll-bar-mode -1)
|
(scroll-bar-mode -1)
|
||||||
|
#+end_src
|
||||||
|
** Completion
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(setq tab-always-indent 'complete
|
||||||
|
completion-cycle-threshold nil
|
||||||
|
completions-detailed t)
|
||||||
|
#+end_src
|
||||||
|
** Org Mode
|
||||||
|
** Email and Messaging
|
||||||
|
*** MU4E
|
||||||
|
Configure email with iCalendar event support, to integrate with
|
||||||
|
=org-agenda=.
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package sendmail
|
||||||
|
:custom
|
||||||
|
(sendmail-program (executable-find "msmtp"))
|
||||||
|
(send-mail-function #'sendmail-send-it))
|
||||||
|
|
||||||
|
(use-package message
|
||||||
|
:custom
|
||||||
|
(message-send-mail-function #'message-send-mail-with-sendmail)
|
||||||
|
(message-sendmail-f-is-evil t)
|
||||||
|
(message-sendmail-extra-arguments '("--read-envelope-from"))
|
||||||
|
(message-auto-save-directory nil)
|
||||||
|
(message-kill-buffer-on-exit t))
|
||||||
|
|
||||||
|
(setq mail-user-agent 'mu4e-user-agent
|
||||||
|
read-mail-command 'mu4e)
|
||||||
|
|
||||||
|
(use-package mm-decode
|
||||||
|
:custom
|
||||||
|
(mm-discouraged-alternatives '("text/html")))
|
||||||
|
|
||||||
|
(use-package mu4e
|
||||||
|
:if (package-installed-p 'mu4e)
|
||||||
|
:bind
|
||||||
|
(("C-c m" . mu4e)
|
||||||
|
:map mu4e-view-mode-map
|
||||||
|
("o n" . mu4e-org-store-and-capture))
|
||||||
|
:custom
|
||||||
|
(mu4e-read-option-use-builtin nil)
|
||||||
|
(mu4e-completing-read-function #'completing-read)
|
||||||
|
(mu4e-split-view 'horizontal)
|
||||||
|
(mu4e-attachment-dir "~/Downloads")
|
||||||
|
(mu4e-get-mail-command "mbsync -a")
|
||||||
|
(mu4e-update-interval (* 5 60)) ; Every 5 minutes
|
||||||
|
(mu4e-headers-auto-update nil)
|
||||||
|
(mu4e-sent-messages-behavior 'sent)
|
||||||
|
(mu4e-change-filenames-when-moving t)
|
||||||
|
(mu4e-context-policy 'pick-first)
|
||||||
|
(mu4e-compose-context-policy 'ask)
|
||||||
|
(mu4e-compose-signature-auto-include nil)
|
||||||
|
(mu4e-compose-complete-only-personal nil)
|
||||||
|
(mu4e-eldoc-support t)
|
||||||
|
(mu4e-search-full nil)
|
||||||
|
(mu4e-search-include-related t)
|
||||||
|
(mu4e-search-threads t)
|
||||||
|
(mu4e-search-skip-duplicates t)
|
||||||
|
(mu4e-maildir-shortcuts '((:maildir "/Proton/Inbox/" :key ?p)
|
||||||
|
(:maildir "/iCloud/Inbox/" :key ?i)
|
||||||
|
(:maildir "/Outlook/Inbox/" :key ?w)))
|
||||||
|
(mu4e-bookmarks '((:name "Inbox" :query "maildir:/inbox/" :key ?i :favorite t)
|
||||||
|
(:name "Today" :query "date:today..now AND maildir:/inbox/" :key ?t)
|
||||||
|
(:name "Drafts" :query "flag:draft AND NOT flag:trashed" :key ?d :hide-unread t)
|
||||||
|
(:name "Unread" :query "flag:unread AND maildir:/inbox/" :key ?u :hide-unread t)
|
||||||
|
(:name "Flagged" :query "flag:flagged AND NOT flag:trashed" :key ?f :hide-unread t)
|
||||||
|
(:name "Spam" :query "maildir:/spam/ OR maildir:/junk/" :key ?s :hide-unread t)))
|
||||||
|
(mu4e-headers-visible-lines 3)
|
||||||
|
(mu4e-headers-fields
|
||||||
|
'((:human-date . 8)
|
||||||
|
(:flags . 10)
|
||||||
|
(:from . 22)
|
||||||
|
(:subject)))
|
||||||
|
(mu4e-headers-visible-flags
|
||||||
|
'(draft
|
||||||
|
flagged
|
||||||
|
unread
|
||||||
|
passed
|
||||||
|
replied
|
||||||
|
trashed
|
||||||
|
attach
|
||||||
|
calendar
|
||||||
|
encrypted
|
||||||
|
signed
|
||||||
|
list
|
||||||
|
personal))
|
||||||
|
:config
|
||||||
|
(setq mu4e-use-fancy-chars t)
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
(with-eval-after-load 'mu4e
|
||||||
|
(require 'mu4e-context)
|
||||||
|
(setq mu4e-contexts
|
||||||
|
(list
|
||||||
|
(make-mu4e-context
|
||||||
|
:name "Personal"
|
||||||
|
:match-func (lambda (msg) (when msg (string-prefix-p "/Proton" (mu4e-message-field msg :maildir))))
|
||||||
|
:vars '(
|
||||||
|
(user-mail-address . "e.litherlandsmith@proton.me")
|
||||||
|
(mu4e-sent-folder . "/Proton/Sent")
|
||||||
|
(mu4e-trash-folder . "/Proton/Trash")
|
||||||
|
(mu4e-refile-folder . "/Proton/Archive")
|
||||||
|
(message-cite-style . message-cite-style-thunderbird)
|
||||||
|
(message-signature . (concat "Evelyn Litherland-Smith (she/they)\n"))
|
||||||
|
))
|
||||||
|
(make-mu4e-context
|
||||||
|
:name "Alternate"
|
||||||
|
:match-func (lambda (msg) (when msg (string-prefix-p "/iCloud" (mu4e-message-field msg :maildir))))
|
||||||
|
:vars '(
|
||||||
|
(user-mail-address . "e.litherlandsmith@icloud.com")
|
||||||
|
(mu4e-sent-folder . "/iCloud/Sent Messages")
|
||||||
|
(mu4e-trash-folder . "/iCloud/Deleted Messages")
|
||||||
|
(mu4e-refile-folder . "/iCloud/Archive")
|
||||||
|
(message-cite-style . message-cite-style-thunderbird)
|
||||||
|
(message-signature . (concat "Evelyn Litherland-Smith (she/they)\n"))
|
||||||
|
))
|
||||||
|
(make-mu4e-context
|
||||||
|
:name "Work"
|
||||||
|
:match-func (lambda (msg) (when msg (string-prefix-p "/Outlook" (mu4e-message-field msg :maildir))))
|
||||||
|
:vars '(
|
||||||
|
(user-mail-address . "evie.litherland-smith@ukaea.uk")
|
||||||
|
(mu4e-sent-folder . "/Outlook/Sent")
|
||||||
|
(mu4e-trash-folder . "/Outlook/Trash")
|
||||||
|
(mu4e-refile-folder . "/Outlook/Archive")
|
||||||
|
(message-cite-style . message-cite-style-outlook)
|
||||||
|
(message-signature . (concat "Evelyn Litherland-Smith (she/they)\n"
|
||||||
|
"Spectroscopy Diagnostic Physicist\n"
|
||||||
|
"Plasma Science and Fusion Operations\n"
|
||||||
|
"UK Atomic Energy Authority"))
|
||||||
|
)))))
|
||||||
|
|
||||||
|
(with-eval-after-load 'mu4e
|
||||||
|
(require 'mu4e-modeline)
|
||||||
|
(setq mu4e-modeline-all-read '("R:" . " ")
|
||||||
|
mu4e-modeline-all-clear '("C:" . " ")
|
||||||
|
mu4e-modeline-new-items '("N:" . " ")
|
||||||
|
mu4e-modeline-unread-items '("U:" . " "))
|
||||||
|
(mu4e-modeline-mode +1))
|
||||||
|
|
||||||
|
(with-eval-after-load 'mu4e
|
||||||
|
(setq mu4e-search-full-label '("F" . " ")
|
||||||
|
mu4e-search-hide-label '("H" . " ")
|
||||||
|
mu4e-search-related-label '("R" . " ")
|
||||||
|
mu4e-search-skip-duplicates-label '("D" . " ")
|
||||||
|
mu4e-search-threaded-label'("T" . " ")
|
||||||
|
mu4e-headers-draft-mark '("D" . " ")
|
||||||
|
mu4e-headers-flagged-mark '("F" . " ")
|
||||||
|
mu4e-headers-unread-mark '("u" . " ")
|
||||||
|
mu4e-headers-passed-mark '("P" . " ")
|
||||||
|
mu4e-headers-replied-mark '("R" . " ")
|
||||||
|
mu4e-headers-trashed-mark '("T" . " ")
|
||||||
|
mu4e-headers-attach-mark '("a" . " ")
|
||||||
|
mu4e-headers-calendar-mark '("c" . " ")
|
||||||
|
mu4e-headers-encrypted-mark '("x" . " ")
|
||||||
|
mu4e-headers-signed-mark '("s" . " ")
|
||||||
|
mu4e-headers-list-mark '("l" . " ")
|
||||||
|
mu4e-headers-personal-mark '("p" . " ")
|
||||||
|
mu4e-headers-seen-mark '("S" . " ")
|
||||||
|
mu4e-headers-new-mark '("N" . " ")
|
||||||
|
mu4e-headers-from-or-to-prefix '(" " . "To ")
|
||||||
|
mu4e-headers-thread-root-prefix '("* " . "* ")
|
||||||
|
mu4e-headers-thread-duplicate-prefix '("= " . "= ")
|
||||||
|
mu4e-headers-thread-blank-prefix '(" " . " ")
|
||||||
|
mu4e-headers-thread-single-orphan-prefix '("─>" . "─>")
|
||||||
|
mu4e-headers-thread-orphan-prefix '("┬>" . "┬>")
|
||||||
|
mu4e-headers-thread-connection-prefix '("│ " . "│ ")
|
||||||
|
mu4e-headers-thread-first-child-prefix '("├>" . "├>")
|
||||||
|
mu4e-headers-thread-child-prefix '("├>" . "├>")
|
||||||
|
mu4e-headers-thread-last-child-prefix '("└>" . "╰>")))
|
||||||
|
|
||||||
|
(with-eval-after-load 'mu4e
|
||||||
|
(setq mu4e-marks '((refile :char
|
||||||
|
("r" . " ")
|
||||||
|
:prompt "refile" :dyn-target
|
||||||
|
(lambda
|
||||||
|
(target msg)
|
||||||
|
(mu4e-get-refile-folder msg))
|
||||||
|
:action
|
||||||
|
(lambda
|
||||||
|
(docid msg target)
|
||||||
|
(mu4e--server-move docid
|
||||||
|
(mu4e--mark-check-target target)
|
||||||
|
"-N")))
|
||||||
|
(delete :char
|
||||||
|
("D" . " ")
|
||||||
|
:prompt "Delete" :show-target
|
||||||
|
(lambda
|
||||||
|
(target)
|
||||||
|
"delete")
|
||||||
|
:action
|
||||||
|
(lambda
|
||||||
|
(docid msg target)
|
||||||
|
(mu4e--server-remove docid)))
|
||||||
|
(flag :char
|
||||||
|
("+" . " ")
|
||||||
|
:prompt "+flag" :show-target
|
||||||
|
(lambda
|
||||||
|
(target)
|
||||||
|
"flag")
|
||||||
|
:action
|
||||||
|
(lambda
|
||||||
|
(docid msg target)
|
||||||
|
(mu4e--server-move docid nil "+F-u-N")))
|
||||||
|
(move :char
|
||||||
|
("m" . " ")
|
||||||
|
:prompt "move" :ask-target mu4e--mark-get-move-target :action
|
||||||
|
(lambda
|
||||||
|
(docid msg target)
|
||||||
|
(mu4e--server-move docid
|
||||||
|
(mu4e--mark-check-target target)
|
||||||
|
"-N")))
|
||||||
|
(read :char
|
||||||
|
("!" . " ")
|
||||||
|
:prompt "!read" :show-target
|
||||||
|
(lambda
|
||||||
|
(target)
|
||||||
|
"read")
|
||||||
|
:action
|
||||||
|
(lambda
|
||||||
|
(docid msg target)
|
||||||
|
(mu4e--server-move docid nil "+S-u-N")))
|
||||||
|
(trash :char
|
||||||
|
("d" . " ")
|
||||||
|
:prompt "dtrash" :dyn-target
|
||||||
|
(lambda
|
||||||
|
(target msg)
|
||||||
|
(mu4e-get-trash-folder msg))
|
||||||
|
:action
|
||||||
|
(lambda
|
||||||
|
(docid msg target)
|
||||||
|
(mu4e--server-move docid
|
||||||
|
(mu4e--mark-check-target target)
|
||||||
|
"+T-N")))
|
||||||
|
(unflag :char
|
||||||
|
("-" . " ")
|
||||||
|
:prompt "-unflag" :show-target
|
||||||
|
(lambda
|
||||||
|
(target)
|
||||||
|
"unflag")
|
||||||
|
:action
|
||||||
|
(lambda
|
||||||
|
(docid msg target)
|
||||||
|
(mu4e--server-move docid nil "-F-N")))
|
||||||
|
(untrash :char
|
||||||
|
("=" . " ")
|
||||||
|
:prompt "=untrash" :show-target
|
||||||
|
(lambda
|
||||||
|
(target)
|
||||||
|
"untrash")
|
||||||
|
:action
|
||||||
|
(lambda
|
||||||
|
(docid msg target)
|
||||||
|
(mu4e--server-move docid nil "-T")))
|
||||||
|
(unread :char
|
||||||
|
("?" . " ")
|
||||||
|
:prompt "?unread" :show-target
|
||||||
|
(lambda
|
||||||
|
(target)
|
||||||
|
"unread")
|
||||||
|
:action
|
||||||
|
(lambda
|
||||||
|
(docid msg target)
|
||||||
|
(mu4e--server-move docid nil "-S+u-N")))
|
||||||
|
(unmark :char " " :prompt "unmark" :action
|
||||||
|
(mu4e-error "No action for unmarking"))
|
||||||
|
(action :char
|
||||||
|
("a" . " ")
|
||||||
|
:prompt "action" :ask-target
|
||||||
|
(lambda nil
|
||||||
|
(mu4e-read-option "Action: " mu4e-headers-actions))
|
||||||
|
:action
|
||||||
|
(lambda
|
||||||
|
(docid msg actionfunc)
|
||||||
|
(save-excursion
|
||||||
|
(when
|
||||||
|
(mu4e~headers-goto-docid docid)
|
||||||
|
(mu4e-headers-action actionfunc)))))
|
||||||
|
(something :char
|
||||||
|
("*" . " ")
|
||||||
|
:prompt "*something" :action
|
||||||
|
(mu4e-error "No action for deferred mark")))))
|
||||||
|
|
||||||
|
(with-eval-after-load 'mu4e
|
||||||
|
(require 'mu4e-notification)
|
||||||
|
(setq mu4e-notification-support t))
|
||||||
|
|
||||||
|
(use-package gnus-icalendar
|
||||||
|
:after (org-agenda)
|
||||||
|
:custom
|
||||||
|
(gnus-icalendar-org-capture-file (expand-file-name "calendar/email.org.gpg" org-directory))
|
||||||
|
(gnus-icalendar-org-capture-headline '("Inbox"))
|
||||||
|
:config
|
||||||
|
(require 'org-agenda)
|
||||||
|
(require 'org-capture)
|
||||||
|
(gnus-icalendar-org-setup))
|
||||||
|
|
||||||
|
(use-package mu4e-icalendar
|
||||||
|
:after (mu4e org-agenda)
|
||||||
|
:custom
|
||||||
|
(mu4e-icalendar-trash-after-reply nil)
|
||||||
|
:config
|
||||||
|
(require 'gnus-icalendar)
|
||||||
|
(mu4e-icalendar-setup)
|
||||||
|
(gnus-icalendar-org-setup))
|
||||||
|
#+end_src
|
||||||
|
*** IRC
|
||||||
|
** Development Tools
|
||||||
|
** Other
|
||||||
|
** Initial copy from =init.el=
|
||||||
|
#+begin_src emacs-lisp
|
||||||
(use-package pixel-scroll
|
(use-package pixel-scroll
|
||||||
:init
|
:init
|
||||||
(pixel-scroll-precision-mode +1))
|
(pixel-scroll-precision-mode +1))
|
||||||
|
@ -96,10 +426,6 @@ Clone to =~/.config/emacs/= (or =~/.emacs.d/=).
|
||||||
(mouse-wheel-progressive-speed nil)
|
(mouse-wheel-progressive-speed nil)
|
||||||
(mouse-wheel-follow-mouse t))
|
(mouse-wheel-follow-mouse t))
|
||||||
|
|
||||||
;; Bind normal forward/back buttons on mouse to next/previous buffer respectively
|
|
||||||
(keymap-global-set "<mouse-8>" #'previous-buffer)
|
|
||||||
(keymap-global-set "<mouse-9>" #'next-buffer)
|
|
||||||
|
|
||||||
;; Quick bind for calling `git-sync-all'
|
;; Quick bind for calling `git-sync-all'
|
||||||
(defun my/git-sync-all ()
|
(defun my/git-sync-all ()
|
||||||
"Run shell command `git-sync-all' asynchronously."
|
"Run shell command `git-sync-all' asynchronously."
|
||||||
|
@ -1119,9 +1445,6 @@ Clone to =~/.config/emacs/= (or =~/.emacs.d/=).
|
||||||
:after (markdown-mode)
|
:after (markdown-mode)
|
||||||
:hook (markdown-mode . conditionally-turn-on-pandoc))
|
:hook (markdown-mode . conditionally-turn-on-pandoc))
|
||||||
|
|
||||||
(if (package-installed-p 'mu4e)
|
|
||||||
(load-file (locate-user-emacs-file "modules/my-mu4e.el")))
|
|
||||||
|
|
||||||
(use-package bbdb
|
(use-package bbdb
|
||||||
:bind (("M-g b" . bbdb-display-all-records))
|
:bind (("M-g b" . bbdb-display-all-records))
|
||||||
:custom
|
:custom
|
||||||
|
|
|
@ -1,298 +0,0 @@
|
||||||
;;; my-mu4e.el -- mu4e -*- lexical-binding: t -*-
|
|
||||||
;;; Commentary:
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(use-package sendmail
|
|
||||||
:custom
|
|
||||||
(sendmail-program (executable-find "msmtp"))
|
|
||||||
(send-mail-function #'sendmail-send-it))
|
|
||||||
|
|
||||||
(use-package message
|
|
||||||
:custom
|
|
||||||
(message-send-mail-function #'message-send-mail-with-sendmail)
|
|
||||||
(message-sendmail-f-is-evil t)
|
|
||||||
(message-sendmail-extra-arguments '("--read-envelope-from"))
|
|
||||||
(message-auto-save-directory nil)
|
|
||||||
(message-kill-buffer-on-exit t))
|
|
||||||
|
|
||||||
(setq mail-user-agent 'mu4e-user-agent
|
|
||||||
read-mail-command 'mu4e)
|
|
||||||
|
|
||||||
(use-package mm-decode
|
|
||||||
:custom
|
|
||||||
(mm-discouraged-alternatives '("text/html")))
|
|
||||||
|
|
||||||
(use-package mu4e
|
|
||||||
:bind
|
|
||||||
(("C-c m" . mu4e)
|
|
||||||
:map mu4e-view-mode-map
|
|
||||||
("o n" . mu4e-org-store-and-capture))
|
|
||||||
:custom
|
|
||||||
(mu4e-read-option-use-builtin nil)
|
|
||||||
(mu4e-completing-read-function #'completing-read)
|
|
||||||
(mu4e-split-view 'horizontal)
|
|
||||||
(mu4e-attachment-dir "~/Downloads")
|
|
||||||
(mu4e-get-mail-command "mbsync -a")
|
|
||||||
(mu4e-update-interval (* 5 60)) ; Every 5 minutes
|
|
||||||
(mu4e-headers-auto-update nil)
|
|
||||||
(mu4e-sent-messages-behavior 'sent)
|
|
||||||
(mu4e-change-filenames-when-moving t)
|
|
||||||
(mu4e-context-policy 'pick-first)
|
|
||||||
(mu4e-compose-context-policy 'ask)
|
|
||||||
(mu4e-compose-signature-auto-include nil)
|
|
||||||
(mu4e-compose-complete-only-personal nil)
|
|
||||||
(mu4e-eldoc-support t)
|
|
||||||
(mu4e-search-full nil)
|
|
||||||
(mu4e-search-include-related t)
|
|
||||||
(mu4e-search-threads t)
|
|
||||||
(mu4e-search-skip-duplicates t)
|
|
||||||
(mu4e-maildir-shortcuts '((:maildir "/Proton/Inbox/" :key ?p)
|
|
||||||
(:maildir "/iCloud/Inbox/" :key ?i)
|
|
||||||
(:maildir "/Outlook/Inbox/" :key ?w)))
|
|
||||||
(mu4e-bookmarks '((:name "Inbox" :query "maildir:/inbox/" :key ?i :favorite t)
|
|
||||||
(:name "Today" :query "date:today..now AND maildir:/inbox/" :key ?t)
|
|
||||||
(:name "Drafts" :query "flag:draft AND NOT flag:trashed" :key ?d :hide-unread t)
|
|
||||||
(:name "Unread" :query "flag:unread AND maildir:/inbox/" :key ?u :hide-unread t)
|
|
||||||
(:name "Flagged" :query "flag:flagged AND NOT flag:trashed" :key ?f :hide-unread t)
|
|
||||||
(:name "Spam" :query "maildir:/spam/ OR maildir:/junk/" :key ?s :hide-unread t)))
|
|
||||||
(mu4e-headers-visible-lines 3)
|
|
||||||
(mu4e-headers-fields
|
|
||||||
'((:human-date . 8)
|
|
||||||
(:flags . 10)
|
|
||||||
(:from . 22)
|
|
||||||
(:subject)))
|
|
||||||
(mu4e-headers-visible-flags
|
|
||||||
'(draft
|
|
||||||
flagged
|
|
||||||
unread
|
|
||||||
passed
|
|
||||||
replied
|
|
||||||
trashed
|
|
||||||
attach
|
|
||||||
calendar
|
|
||||||
encrypted
|
|
||||||
signed
|
|
||||||
list
|
|
||||||
personal))
|
|
||||||
:config
|
|
||||||
(setq mu4e-use-fancy-chars t)
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
(with-eval-after-load 'mu4e
|
|
||||||
(require 'mu4e-context)
|
|
||||||
(setq mu4e-contexts
|
|
||||||
(list
|
|
||||||
(make-mu4e-context
|
|
||||||
:name "Personal"
|
|
||||||
:match-func (lambda (msg) (when msg (string-prefix-p "/Proton" (mu4e-message-field msg :maildir))))
|
|
||||||
:vars '(
|
|
||||||
(user-mail-address . "e.litherlandsmith@proton.me")
|
|
||||||
(mu4e-sent-folder . "/Proton/Sent")
|
|
||||||
(mu4e-trash-folder . "/Proton/Trash")
|
|
||||||
(mu4e-refile-folder . "/Proton/Archive")
|
|
||||||
(message-cite-style . message-cite-style-thunderbird)
|
|
||||||
(message-signature . (concat "Evelyn Litherland-Smith (she/they)\n"))
|
|
||||||
))
|
|
||||||
(make-mu4e-context
|
|
||||||
:name "Alternate"
|
|
||||||
:match-func (lambda (msg) (when msg (string-prefix-p "/iCloud" (mu4e-message-field msg :maildir))))
|
|
||||||
:vars '(
|
|
||||||
(user-mail-address . "e.litherlandsmith@icloud.com")
|
|
||||||
(mu4e-sent-folder . "/iCloud/Sent Messages")
|
|
||||||
(mu4e-trash-folder . "/iCloud/Deleted Messages")
|
|
||||||
(mu4e-refile-folder . "/iCloud/Archive")
|
|
||||||
(message-cite-style . message-cite-style-thunderbird)
|
|
||||||
(message-signature . (concat "Evelyn Litherland-Smith (she/they)\n"))
|
|
||||||
))
|
|
||||||
(make-mu4e-context
|
|
||||||
:name "Work"
|
|
||||||
:match-func (lambda (msg) (when msg (string-prefix-p "/Outlook" (mu4e-message-field msg :maildir))))
|
|
||||||
:vars '(
|
|
||||||
(user-mail-address . "evie.litherland-smith@ukaea.uk")
|
|
||||||
(mu4e-sent-folder . "/Outlook/Sent")
|
|
||||||
(mu4e-trash-folder . "/Outlook/Trash")
|
|
||||||
(mu4e-refile-folder . "/Outlook/Archive")
|
|
||||||
(message-cite-style . message-cite-style-outlook)
|
|
||||||
(message-signature . (concat "Evelyn Litherland-Smith (she/they)\n"
|
|
||||||
"Spectroscopy Diagnostic Physicist\n"
|
|
||||||
"Plasma Science and Fusion Operations\n"
|
|
||||||
"UK Atomic Energy Authority"))
|
|
||||||
)))))
|
|
||||||
|
|
||||||
(with-eval-after-load 'mu4e
|
|
||||||
(require 'mu4e-modeline)
|
|
||||||
(setq mu4e-modeline-all-read '("R:" . " ")
|
|
||||||
mu4e-modeline-all-clear '("C:" . " ")
|
|
||||||
mu4e-modeline-new-items '("N:" . " ")
|
|
||||||
mu4e-modeline-unread-items '("U:" . " "))
|
|
||||||
(mu4e-modeline-mode +1))
|
|
||||||
|
|
||||||
(with-eval-after-load 'mu4e
|
|
||||||
(setq mu4e-search-full-label '("F" . " ")
|
|
||||||
mu4e-search-hide-label '("H" . " ")
|
|
||||||
mu4e-search-related-label '("R" . " ")
|
|
||||||
mu4e-search-skip-duplicates-label '("D" . " ")
|
|
||||||
mu4e-search-threaded-label'("T" . " ")
|
|
||||||
mu4e-headers-draft-mark '("D" . " ")
|
|
||||||
mu4e-headers-flagged-mark '("F" . " ")
|
|
||||||
mu4e-headers-unread-mark '("u" . " ")
|
|
||||||
mu4e-headers-passed-mark '("P" . " ")
|
|
||||||
mu4e-headers-replied-mark '("R" . " ")
|
|
||||||
mu4e-headers-trashed-mark '("T" . " ")
|
|
||||||
mu4e-headers-attach-mark '("a" . " ")
|
|
||||||
mu4e-headers-calendar-mark '("c" . " ")
|
|
||||||
mu4e-headers-encrypted-mark '("x" . " ")
|
|
||||||
mu4e-headers-signed-mark '("s" . " ")
|
|
||||||
mu4e-headers-list-mark '("l" . " ")
|
|
||||||
mu4e-headers-personal-mark '("p" . " ")
|
|
||||||
mu4e-headers-seen-mark '("S" . " ")
|
|
||||||
mu4e-headers-new-mark '("N" . " ")
|
|
||||||
mu4e-headers-from-or-to-prefix '(" " . "To ")
|
|
||||||
mu4e-headers-thread-root-prefix '("* " . "* ")
|
|
||||||
mu4e-headers-thread-duplicate-prefix '("= " . "= ")
|
|
||||||
mu4e-headers-thread-blank-prefix '(" " . " ")
|
|
||||||
mu4e-headers-thread-single-orphan-prefix '("─>" . "─>")
|
|
||||||
mu4e-headers-thread-orphan-prefix '("┬>" . "┬>")
|
|
||||||
mu4e-headers-thread-connection-prefix '("│ " . "│ ")
|
|
||||||
mu4e-headers-thread-first-child-prefix '("├>" . "├>")
|
|
||||||
mu4e-headers-thread-child-prefix '("├>" . "├>")
|
|
||||||
mu4e-headers-thread-last-child-prefix '("└>" . "╰>")))
|
|
||||||
|
|
||||||
(with-eval-after-load 'mu4e
|
|
||||||
(setq mu4e-marks '((refile :char
|
|
||||||
("r" . " ")
|
|
||||||
:prompt "refile" :dyn-target
|
|
||||||
(lambda
|
|
||||||
(target msg)
|
|
||||||
(mu4e-get-refile-folder msg))
|
|
||||||
:action
|
|
||||||
(lambda
|
|
||||||
(docid msg target)
|
|
||||||
(mu4e--server-move docid
|
|
||||||
(mu4e--mark-check-target target)
|
|
||||||
"-N")))
|
|
||||||
(delete :char
|
|
||||||
("D" . " ")
|
|
||||||
:prompt "Delete" :show-target
|
|
||||||
(lambda
|
|
||||||
(target)
|
|
||||||
"delete")
|
|
||||||
:action
|
|
||||||
(lambda
|
|
||||||
(docid msg target)
|
|
||||||
(mu4e--server-remove docid)))
|
|
||||||
(flag :char
|
|
||||||
("+" . " ")
|
|
||||||
:prompt "+flag" :show-target
|
|
||||||
(lambda
|
|
||||||
(target)
|
|
||||||
"flag")
|
|
||||||
:action
|
|
||||||
(lambda
|
|
||||||
(docid msg target)
|
|
||||||
(mu4e--server-move docid nil "+F-u-N")))
|
|
||||||
(move :char
|
|
||||||
("m" . " ")
|
|
||||||
:prompt "move" :ask-target mu4e--mark-get-move-target :action
|
|
||||||
(lambda
|
|
||||||
(docid msg target)
|
|
||||||
(mu4e--server-move docid
|
|
||||||
(mu4e--mark-check-target target)
|
|
||||||
"-N")))
|
|
||||||
(read :char
|
|
||||||
("!" . " ")
|
|
||||||
:prompt "!read" :show-target
|
|
||||||
(lambda
|
|
||||||
(target)
|
|
||||||
"read")
|
|
||||||
:action
|
|
||||||
(lambda
|
|
||||||
(docid msg target)
|
|
||||||
(mu4e--server-move docid nil "+S-u-N")))
|
|
||||||
(trash :char
|
|
||||||
("d" . " ")
|
|
||||||
:prompt "dtrash" :dyn-target
|
|
||||||
(lambda
|
|
||||||
(target msg)
|
|
||||||
(mu4e-get-trash-folder msg))
|
|
||||||
:action
|
|
||||||
(lambda
|
|
||||||
(docid msg target)
|
|
||||||
(mu4e--server-move docid
|
|
||||||
(mu4e--mark-check-target target)
|
|
||||||
"+T-N")))
|
|
||||||
(unflag :char
|
|
||||||
("-" . " ")
|
|
||||||
:prompt "-unflag" :show-target
|
|
||||||
(lambda
|
|
||||||
(target)
|
|
||||||
"unflag")
|
|
||||||
:action
|
|
||||||
(lambda
|
|
||||||
(docid msg target)
|
|
||||||
(mu4e--server-move docid nil "-F-N")))
|
|
||||||
(untrash :char
|
|
||||||
("=" . " ")
|
|
||||||
:prompt "=untrash" :show-target
|
|
||||||
(lambda
|
|
||||||
(target)
|
|
||||||
"untrash")
|
|
||||||
:action
|
|
||||||
(lambda
|
|
||||||
(docid msg target)
|
|
||||||
(mu4e--server-move docid nil "-T")))
|
|
||||||
(unread :char
|
|
||||||
("?" . " ")
|
|
||||||
:prompt "?unread" :show-target
|
|
||||||
(lambda
|
|
||||||
(target)
|
|
||||||
"unread")
|
|
||||||
:action
|
|
||||||
(lambda
|
|
||||||
(docid msg target)
|
|
||||||
(mu4e--server-move docid nil "-S+u-N")))
|
|
||||||
(unmark :char " " :prompt "unmark" :action
|
|
||||||
(mu4e-error "No action for unmarking"))
|
|
||||||
(action :char
|
|
||||||
("a" . " ")
|
|
||||||
:prompt "action" :ask-target
|
|
||||||
(lambda nil
|
|
||||||
(mu4e-read-option "Action: " mu4e-headers-actions))
|
|
||||||
:action
|
|
||||||
(lambda
|
|
||||||
(docid msg actionfunc)
|
|
||||||
(save-excursion
|
|
||||||
(when
|
|
||||||
(mu4e~headers-goto-docid docid)
|
|
||||||
(mu4e-headers-action actionfunc)))))
|
|
||||||
(something :char
|
|
||||||
("*" . " ")
|
|
||||||
:prompt "*something" :action
|
|
||||||
(mu4e-error "No action for deferred mark")))))
|
|
||||||
|
|
||||||
(with-eval-after-load 'mu4e
|
|
||||||
(require 'mu4e-notification)
|
|
||||||
(setq mu4e-notification-support t))
|
|
||||||
|
|
||||||
(use-package gnus-icalendar
|
|
||||||
:after (mu4e org-agenda)
|
|
||||||
:custom
|
|
||||||
(gnus-icalendar-org-capture-file (expand-file-name "calendar/email.org.gpg" org-directory))
|
|
||||||
(gnus-icalendar-org-capture-headline '("Inbox"))
|
|
||||||
:config
|
|
||||||
(require 'org-agenda)
|
|
||||||
(require 'org-capture)
|
|
||||||
(gnus-icalendar-org-setup))
|
|
||||||
|
|
||||||
(use-package mu4e-icalendar
|
|
||||||
:after mu4e
|
|
||||||
:custom
|
|
||||||
(mu4e-icalendar-trash-after-reply nil)
|
|
||||||
:config
|
|
||||||
(require 'gnus-icalendar)
|
|
||||||
(mu4e-icalendar-setup)
|
|
||||||
(gnus-icalendar-org-setup))
|
|
||||||
|
|
||||||
(provide 'my-mu4e)
|
|
||||||
;;; my-mu4e.el ends here
|
|
Loading…
Reference in a new issue