From 21794a4dfa857a770155b9e0c59af885e0d5756c Mon Sep 17 00:00:00 2001 From: BardofSprites <89086143+BardofSprites@users.noreply.github.com> Date: Fri, 26 Dec 2025 19:40:49 -0500 Subject: literate configuration --- bard-emacs-modules/bard-emacs-email.el | 99 ++++++++++++++++++---------------- 1 file changed, 52 insertions(+), 47 deletions(-) (limited to 'bard-emacs-modules/bard-emacs-email.el') diff --git a/bard-emacs-modules/bard-emacs-email.el b/bard-emacs-modules/bard-emacs-email.el index 68605a7..797f01b 100644 --- a/bard-emacs-modules/bard-emacs-email.el +++ b/bard-emacs-modules/bard-emacs-email.el @@ -1,57 +1,26 @@ (require 'bard-email) -;; General `notmuch' ui configuration - (use-package notmuch :ensure t :config - (define-key global-map (kbd "C-c m") #'notmuch)) - -(use-package notmuch-indicator - :ensure t - :after notmuch - :config - (setq notmuch-indicator-args - '(( :terms "tag:unread and tag:inbox" - :label "[U] " - :label-face prot-modeline-indicator-green - :counter-face prot-modeline-indicator-green) - ( :terms "tag:unread and tag:linux" - :label "[L] " - :label-face prot-modeline-indicator-cyan - :counter-face prot-modeline-indicator-cyan) - ( :terms "tag:unread and tag:emacs" - :label "[E] " - :label-face prot-modeline-indicator-blue - :counter-face prot-modeline-indicator-blue)) - - notmuch-indicator-refresh-count (* 60 3) - notmuch-indicator-hide-empty-counters t - notmuch-indicator-force-refresh-commands '(notmuch-refresh-this-buffer)) - (setq notmuch-indicator-add-to-mode-line-misc-info nil) - (notmuch-indicator-mode t)) - -;; use msmtp -(setq message-send-mail-function 'message-send-mail-with-sendmail) -(setq sendmail-program "/usr/bin/msmtp") - -(setq notmuch-show-logo t - notmuch-column-control 1.0 - notmuch-hello-auto-refresh t - notmuch-hello-recent-searches-max 20 - notmuch-hello-thousands-separator "" - notmuch-hello-sections '(notmuch-hello-insert-header notmuch-hello-insert-saved-searches notmuch-hello-insert-search notmuch-hello-insert-alltags) - notmuch-show-all-tags-list t) + (define-key global-map (kbd "C-c m") #'notmuch) + (setq notmuch-show-logo t + notmuch-column-control 1.0 + notmuch-hello-auto-refresh t + notmuch-hello-recent-searches-max 20 + notmuch-hello-thousands-separator "" + notmuch-hello-sections '(notmuch-hello-insert-header notmuch-hello-insert-saved-searches notmuch-hello-insert-search notmuch-hello-insert-alltags) + notmuch-show-all-tags-list t) -(setq notmuch-search-oldest-first nil) -(setq notmuch-show-seen-current-message t) + (setq notmuch-search-oldest-first nil) + (setq notmuch-show-seen-current-message t) -(defun bard/notmuch-mua-empty-subject-check () - "Request confirmation before sending a message with empty subject." - (when (and (null (message-field-value "Subject")) - (not (y-or-n-p "Subject is empty, send anyway? "))) - (error "Sending message cancelled: empty subject"))) -(add-hook 'message-send-hook 'bard/notmuch-mua-empty-subject-check) + (defun bard/notmuch-mua-empty-subject-check () + "Request confirmation before sending a message with empty subject." + (when (and (null (message-field-value "Subject")) + (not (y-or-n-p "Subject is empty, send anyway? "))) + (error "Sending message cancelled: empty subject"))) + (add-hook 'message-send-hook 'bard/notmuch-mua-empty-subject-check)) (setq notmuch-show-empty-saved-searches t) (setq notmuch-saved-searches @@ -107,4 +76,40 @@ notmuch-draft-folder "drafts" notmuch-draft-save-plaintext 'ask) +(use-package notmuch-indicator + :ensure t + :after notmuch + :config + (setq notmuch-indicator-args + '(( :terms "tag:unread and tag:inbox" + :label "[U] " + :label-face prot-modeline-indicator-green + :counter-face prot-modeline-indicator-green) + ( :terms "tag:unread and tag:linux" + :label "[L] " + :label-face prot-modeline-indicator-cyan + :counter-face prot-modeline-indicator-cyan) + ( :terms "tag:unread and tag:emacs" + :label "[E] " + :label-face prot-modeline-indicator-blue + :counter-face prot-modeline-indicator-blue)) + + notmuch-indicator-refresh-count (* 60 3) + notmuch-indicator-hide-empty-counters t + notmuch-indicator-force-refresh-commands '(notmuch-refresh-this-buffer)) + (setq notmuch-indicator-add-to-mode-line-misc-info nil) + (notmuch-indicator-mode t)) + +(use-package ol-notmuch + :ensure t + :after notmuch) + +;; use msmtp +(setq sendmail-program "/usr/bin/msmtp" + message-send-mail-function 'message-send-mail-with-sendmail + message-sendmail-f-is-evil nil + mail-specify-envelope-from t + message-sendmail-envelope-from 'header + mail-envelope-from t) + (provide 'bard-emacs-email) -- cgit v1.2.3