doomemacs/modules/email/notmuch/config.el
Henrik Lissner a3e262c7ac
💥 Refactor add-hook! macro & change arg order
This update may potentially break your usage of add-hook! if you pass
the :local or :append properties to it. This is how they used to work:

  (add-hook! :append 'some-mode-hook #'do-something)

Thsoe properties must now follow the hooks, e.g.

  (add-hook! 'some-mode-hook :append #'do-something)

Other changes:
- Various add-hook calls have been renamed to add-hook! because I
  incorrectly assumed `defun` always returned its definition's symbol,
  when in fact, its return value is "undefined" (so sayeth the
  documentation). This should fix #1597.
- This update adds the ability to add multiple functions to hooks
  without a list:

    (add-hook! 'some-mode-hook
               #'do-something
               #'do-something-else)

- The indentation logic has been changed so that consecutive function
  symbols at indented at the same level as the first argument, but forms
  are indent like a defun.

    (add-hook! 'some-mode-hook
               #'do-something
               #'do-something-else)

    (add-hook! 'some-mode-hook
      (message "Hello"))
2019-07-26 20:17:29 +02:00

71 lines
2.3 KiB
EmacsLisp

;;; email/notmuch/config.el -*- lexical-binding: t; -*-
;; FIXME This module is a WIP!
(defvar +notmuch-sync-backend 'gmi
"Which backend to use. Can be either gmi, mbsync, offlineimap or nil (manual).")
(defvar +notmuch-mail-folder "~/.mail/account.gmail"
"Where your email folder is located (for use with gmailieer).")
(after! notmuch
(set-company-backend! 'notmuch-message-mode
'(notmuch-company :with company-ispell company-yasnippet))
(set-popup-rule! "^\\*notmuch-hello" :side 'left :size 30 :ttl 0)
(setq notmuch-fcc-dirs nil
notmuch-show-logo nil
notmuch-message-headers-visible 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-hello-sections
'(notmuch-hello-insert-saved-searches
notmuch-hello-insert-alltags)
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"))
;; (setq-hook! 'notmuch-show-mode-hook line-spacing 0)
(add-hook 'doom-real-buffer-functions #'notmuch-interesting-buffer)
(advice-add #'notmuch-start-notmuch-sentinel :around #'+notmuch-dont-confirm-on-kill-process-a)
;; modeline doesn't have much use in these modes
(add-hook! '(notmuch-show-mode-hook
notmuch-tree-mode-hook
notmuch-search-mode-hook)
#'hide-mode-line-mode))
(use-package! org-mime
:after (org notmuch)
:config (setq org-mime-library 'mml))
(use-package! counsel-notmuch
:when (featurep! :completion ivy)
:commands counsel-notmuch
:after notmuch)
(use-package! helm-notmuch
:when (featurep! :completion helm)
:commands helm-notmuch
:after notmuch)