2019-05-05 14:11:59 -04:00
|
|
|
;;; email/notmuch/config.el -*- lexical-binding: t; -*-
|
2018-07-31 19:33:27 +02:00
|
|
|
|
|
|
|
;; FIXME This module is a WIP!
|
|
|
|
|
2020-09-03 23:43:19 -07:00
|
|
|
(defvar +notmuch-home-function #'notmuch
|
|
|
|
"Function for customizing the landing page for doom-emacs =notmuch.")
|
|
|
|
|
2018-08-08 12:06:07 -04:00
|
|
|
(defvar +notmuch-sync-backend 'gmi
|
|
|
|
"Which backend to use. Can be either gmi, mbsync, offlineimap or nil (manual).")
|
|
|
|
|
2019-10-23 23:24:56 -04:00
|
|
|
(defvar +notmuch-sync-command nil
|
|
|
|
"Command for custom notmuch sync")
|
|
|
|
|
2018-08-08 12:06:07 -04:00
|
|
|
(defvar +notmuch-mail-folder "~/.mail/account.gmail"
|
|
|
|
"Where your email folder is located (for use with gmailieer).")
|
|
|
|
|
2019-12-16 03:54:15 -05:00
|
|
|
|
|
|
|
;;
|
|
|
|
;;; Packages
|
|
|
|
|
2020-05-18 14:10:24 -04:00
|
|
|
(use-package! notmuch
|
|
|
|
:defer t
|
|
|
|
:init
|
|
|
|
(after! org
|
|
|
|
(add-to-list 'org-modules 'ol-notmuch))
|
|
|
|
:config
|
2018-07-31 19:33:27 +02:00
|
|
|
(set-company-backend! 'notmuch-message-mode
|
2020-10-15 16:52:51 -04:00
|
|
|
'notmuch-company '(company-ispell company-yasnippet))
|
2018-07-31 19:33:27 +02:00
|
|
|
|
|
|
|
(set-popup-rule! "^\\*notmuch-hello" :side 'left :size 30 :ttl 0)
|
|
|
|
|
|
|
|
(setq notmuch-fcc-dirs nil
|
|
|
|
message-kill-buffer-on-exit t
|
|
|
|
message-send-mail-function 'message-send-mail-with-sendmail
|
|
|
|
notmuch-search-oldest-first nil
|
|
|
|
send-mail-function 'sendmail-send-it
|
|
|
|
;; sendmail-program "/usr/local/bin/msmtp"
|
|
|
|
notmuch-search-result-format
|
|
|
|
'(("date" . "%12s ")
|
|
|
|
("count" . "%-7s ")
|
|
|
|
("authors" . "%-30s ")
|
|
|
|
("subject" . "%-72s ")
|
|
|
|
("tags" . "(%s)"))
|
|
|
|
notmuch-tag-formats
|
|
|
|
'(("unread" (propertize tag 'face 'notmuch-tag-unread)))
|
|
|
|
notmuch-saved-searches
|
|
|
|
'((:name "inbox" :query "tag:inbox not tag:trash" :key "i")
|
|
|
|
(:name "flagged" :query "tag:flagged" :key "f")
|
|
|
|
(:name "sent" :query "tag:sent" :key "s")
|
|
|
|
(:name "drafts" :query "tag:draft" :key "d"))
|
|
|
|
notmuch-archive-tags '("-inbox" "-unread"))
|
|
|
|
|
2019-10-23 22:58:51 -04:00
|
|
|
;; only unfold unread messages in thread by default
|
2019-10-26 13:38:06 -04:00
|
|
|
(add-hook 'notmuch-show-hook #'+notmuch-show-expand-only-unread-h)
|
2019-10-23 22:58:51 -04:00
|
|
|
|
2019-07-26 19:57:13 +02:00
|
|
|
(add-hook 'doom-real-buffer-functions #'notmuch-interesting-buffer)
|
2018-07-31 19:33:27 +02:00
|
|
|
|
2019-07-26 19:57:13 +02:00
|
|
|
(advice-add #'notmuch-start-notmuch-sentinel :around #'+notmuch-dont-confirm-on-kill-process-a)
|
2018-07-31 19:33:27 +02:00
|
|
|
|
|
|
|
;; modeline doesn't have much use in these modes
|
2019-07-26 19:57:13 +02:00
|
|
|
(add-hook! '(notmuch-show-mode-hook
|
|
|
|
notmuch-tree-mode-hook
|
|
|
|
notmuch-search-mode-hook)
|
2019-10-26 14:05:40 -04:00
|
|
|
#'hide-mode-line-mode)
|
|
|
|
|
2019-12-16 03:54:15 -05:00
|
|
|
(map! :localleader
|
2021-04-03 22:17:08 -07:00
|
|
|
:map (notmuch-hello-mode-map notmuch-search-mode-map notmuch-tree-mode-map notmuch-show-mode-map)
|
2019-12-16 03:54:15 -05:00
|
|
|
:desc "Compose email" "c" #'+notmuch/compose
|
2021-04-14 08:15:23 -07:00
|
|
|
:desc "Sync email" "u" #'+notmuch/update
|
2019-12-16 03:54:15 -05:00
|
|
|
:desc "Quit notmuch" "q" #'+notmuch/quit
|
|
|
|
:map notmuch-search-mode-map
|
|
|
|
:desc "Mark as deleted" "d" #'+notmuch/search-delete
|
|
|
|
:desc "Mark as spam" "s" #'+notmuch/search-spam
|
|
|
|
:map notmuch-tree-mode-map
|
|
|
|
:desc "Mark as deleted" "d" #'+notmuch/tree-delete
|
|
|
|
:desc "Mark as spam" "s" #'+notmuch/tree-spam))
|
2018-07-31 19:33:27 +02:00
|
|
|
|
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-package! org-mime
|
2018-07-31 19:33:27 +02:00
|
|
|
:after (org notmuch)
|
|
|
|
:config (setq org-mime-library 'mml))
|
|
|
|
|
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-package! counsel-notmuch
|
2018-07-31 19:33:27 +02:00
|
|
|
:when (featurep! :completion ivy)
|
|
|
|
:commands counsel-notmuch
|
|
|
|
:after notmuch)
|
|
|
|
|
2019-12-16 03:54:15 -05:00
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-package! helm-notmuch
|
2018-07-31 19:33:27 +02:00
|
|
|
:when (featurep! :completion helm)
|
|
|
|
:commands helm-notmuch
|
|
|
|
:after notmuch)
|