about summary refs log tree commit diff
path: root/emacs/.emacs.d/wpc/email.el
blob: 78ebe4e5f1d10b23a7db8e6df6675fdc535bc8c7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
;;; email.el --- My Emacs email settings -*- lexical-binding: t -*-
;; Author: William Carroll <wpcarro@gmail.com>

;;; Commentary:
;; Attempting to configure to `notmuch' for my personal use.

;;; Code:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Dependencies
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(require 'notmuch)
(require 'list)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Configuration
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(setq notmuch-saved-searches
      '((:name "inbox" :query "tag:inbox" :key "i")
        (:name "direct" :query "tag:direct and tag:unread and not tag:sent" :key "d")
        (:name "action" :query "tag:action" :key "a")
        (:name "review" :query "tag:review" :key "r")
        (:name "waiting" :query "tag:waiting" :key "w")
        (:name "broadcast" :query "tag:/broadcast\/.+/ and tag:unread" :key "b")
        (:name "systems" :query "tag:/systems\/.+/ and tag:unread" :key "s")
        (:name "sent" :query "tag:sent" :key "t")
        (:name "drafts" :query "tag:draft" :key "D")))

;; Sort results from newest-to-oldest.
(setq notmuch-search-oldest-first nil)

;; Assert that no two saved searches share share a KBD
(prelude/assert
 (list/xs-distinct-by? (lambda (x) (plist-get x :key)) notmuch-saved-searches))

(provide 'email)
;;; email.el ends here