From 88ada4f1b937cf4aac26ce29f6742f328973bfa1 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 16 Feb 2022 23:16:31 -0600 Subject: Change notmuch whatever --- init.el | 52 +++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 41 insertions(+), 11 deletions(-) diff --git a/init.el b/init.el index d8570c4..38df4a1 100644 --- a/init.el +++ b/init.el @@ -432,7 +432,7 @@ (setup kmacro (:also-load +kmacro) (with-eval-after-load '+kmacro - (+kmacro-recording-indicator-mode +1) + ;; (+kmacro-recording-indicator-mode +1) (+kmacro-block-undo-mode +1))) (setup minibuffer @@ -462,23 +462,53 @@ )) (setup notmuch - (:load-from "/usr/share/emacs/site-lisp/elpa-src/notmuch-0.31.4/") - (:require notmuch) - (:option notmuch-address-save-filename (.etc "notmuch/addresses" t) + (add-to-list 'load-path + (car (file-expand-wildcards "/usr/share/emacs/site-lisp/elpa-src/notmuch*"))) + (require 'notmuch) + (require '+notmuch) + (+define-dir notmuch/ (private/ "notmuch") + "Notmuch configuration and data.") + (:option notmuch-init-file (notmuch/ "init.el" t) + notmuch-address-save-filename (notmuch/ "addresses" t) notmuch-address-use-company (featurep 'company) - ;; notmuch-fcc-dirs - ;; (list (cons chd/email (concat "\"" chd/sent-dir "\"" - ;; " +sent +work -inbox")) - ;; (cons ".*" "\"fastmail/Sent\" +sent +personal -inbox")) - notmuch-search-oldest-first nil) + notmuch-search-oldest-first nil + notmuch-saved-searches (list + (list :name "next" + :query (+notmuch-query-concat "tag:inbox" + "NOT tag:/List/") + :key "n") + (list :name "lists" + :query (+notmuch-query-concat "tag:/List/") + :key "l") + ;; original + (list :name "inbox" + :query (+notmuch-query-concat "tag:inbox" + "NOT tag:Spam") + :key "i") + (list :name "unread" + :query (+notmuch-query-concat "tag:unread" + "NOT tag:Spam") + :key "u") + (list :name "flagged" :query "tag:flagged" :key "f") + (list :name "sent" :query "tag:sent" :key "t") + (list :name "drafts" :query "tag:draft" :key "d") + (list :name "all mail" :query "*" :key "a"))) + ;; I don't know why or how this isn't properly loaded, but here we are. + (with-eval-after-load 'notmuch (load notmuch-init-file :noerror)) ;; Composing mail (:option message-kill-buffer-on-exit t) ;; Sending mail (:option send-mail-function #'sendmail-send-it - sendmail-program (executable-find "msmtp") mail-specify-envelope-from t message-sendmail-envelope-from 'header - mail-envelope-from 'header)) + mail-envelope-from 'header) + ;; Extras and fixes + ;; +send-mail-dispatch is defined in notmuch/init.el + (add-hook 'notmuch-show-mode-hook #'visual-fill-column-mode) + (add-hook 'message-send-hook #'+send-mail-dispatch) + (advice-add 'notmuch-tag :filter-args #'+notmuch-correct-tags) + (:+leader "m" #'+notmuch-goto + "C-m" #'+notmuch-goto)) (setup org ;; Plain org with the `setup' form for sorting, but I install with straight. -- cgit 1.4.1-21-gabe81