more mu4e config

This commit is contained in:
Matt Nish-Lapidus 2024-06-29 15:37:50 -04:00
parent 100428d695
commit 8776cb585d
3 changed files with 69 additions and 29 deletions

View file

@ -261,6 +261,19 @@
(smtpmail-local-domain . "fastmail.com")) (smtpmail-local-domain . "fastmail.com"))
t) t)
(set-email-account! "admin@studyoftime.org"
'((mu4e-sent-folder . "/admin@studyoftime.org/Sent")
(mu4e-drafts-folder . "/admin@studyoftime.org/Drafts")
(mu4e-trash-folder . "/admin@studyoftime.org/Trash")
(mu4e-refile-folder . "/admin@studyoftime.org/Archive")
(mu4e-spam-folder . "/admin@studyoftime.org/Spam")
(smtpmail-smtp-user . "admin@studyoftime.org")
(user-mail-address . "admin@studyoftime.org") ;; only needed for mu < 1.4
(smtpmail-default-smtp-server . "smtp.dreamhost.com")
(smtpmail-smtp-server . "smtp.dreamhost.com")
(smtpmail-local-domain . "dreamhost.com"))
t)
(defun message-insert-signature-at-point () (defun message-insert-signature-at-point ()
"Insert signature at point." "Insert signature at point."
(interactive) (interactive)
@ -272,23 +285,20 @@
(setq message-signature nil)) (setq message-signature nil))
(use-package! consult-mu (use-package! consult-mu
:defer-incrementally mu4e
:custom :custom
;;maximum number of results shown in minibuffer
(consult-mu-maxnum 200) (consult-mu-maxnum 200)
;;show preview when pressing any keys ;;show preview when pressing any keys
(consult-mu-preview-key 'any) (consult-mu-preview-key 'any)
;;do not mark email as read when previewed. If you turn this to t, be aware that the auto-loaded preview if the preview-key above is 'any would also get marked as read!
(consult-mu-mark-previewed-as-read nil) (consult-mu-mark-previewed-as-read nil)
;;mark email as read when selected. ;;mark email as read when selected.
;; (consult-mu-mark-viewed-as-read t) ;; (consult-mu-mark-viewed-as-read t)
;;use reply to all when composing reply emails
(consult-mu-use-wide-reply t) (consult-mu-use-wide-reply t)
;; define a template for headers view in minibuffer. The example below adjusts the width based on the width of the screen.
(consult-mu-headers-template (lambda () (concat "%f" (number-to-string (floor (* (frame-width) 0.15))) "%s" (number-to-string (floor (* (frame-width) 0.5))) "%d13" "%g" "%x"))) (consult-mu-headers-template (lambda () (concat "%f" (number-to-string (floor (* (frame-width) 0.15))) "%s" (number-to-string (floor (* (frame-width) 0.5))) "%d13" "%g" "%x")))
(consult-mu-action #'consult-mu--view-action) (consult-mu-action #'consult-mu--view-action)
:config :config
;;create a list of saved searches for quick access using `histroy-next-element' with `M-n' in minibuffer. Note the "#" character at the beginning of each query! Change these according to
(setq consult-mu-saved-searches-dynamics '("#flag:unread")) (setq consult-mu-saved-searches-dynamics '("#flag:unread"))
(setq consult-mu-saved-searches-async '("#flag:unread")) (setq consult-mu-saved-searches-async '("#flag:unread"))
;; require embark actions for marking, replying, forwarding, etc. directly from minibuffer ;; require embark actions for marking, replying, forwarding, etc. directly from minibuffer
@ -309,8 +319,19 @@
;; choose if you want to use dired for attaching files (choice of 'always, 'in-dired, or nil) ;; choose if you want to use dired for attaching files (choice of 'always, 'in-dired, or nil)
(setq consult-mu-compose-use-dired-attachment 'in-dired)) (setq consult-mu-compose-use-dired-attachment 'in-dired))
(use-package! mu4e
:defer-incrementally t
:config
;; Run mu4e in the background to sync mail periodically
;; (mu4e t)
;; tell meow to start mu4e in motion state
(pushnew! meow-mode-state-list '(mu4e-main-mode . motion))
(setq mu4e-update-interval 300
mu4e-headers-auto-update t)
(after! mu4e
(setq (setq
mu4e-index-cleanup t mu4e-index-cleanup t
mu4e-index-lazy-check nil mu4e-index-lazy-check nil
@ -334,38 +355,56 @@
(setq mu4e-compose-format-flowed t) (setq mu4e-compose-format-flowed t)
(setq message-signature nil) (setq message-signature nil)
(add-hook! 'mu4e-compose-mode-hook (add-hook! 'mu4e-compose-mode-hook
(use-hard-newlines -1) (use-hard-newlines -1)
;; (message-add-header "CC:")
(message-goto-body) (message-goto-body)
(message-insert-signature-at-point) (message-insert-signature-at-point)
(message-goto-body)) (message-goto-body))
;; spam ;; (setq mu4e-bookmarks
(mu4e-bookmark-define ;; '((:name "Unread messages" :query "flag:unread AND NOT flag:trashed" :key ?i)
"maildir:/matt@emenel.ca/Spam" ;; (:name "Today's messages" :query "date:today..now" :key ?t)
"Spam mail" ;; (:name "The Boss" :query "from:stallman" :key ?s)
?S) ;; (:name "Last 7 days" :query "date:7d..now" :hide-unread t :key ?w)
;; (:name "Messages with images" :query "mime:image/*" :key ?p)))
;; sent
(mu4e-bookmark-define
"maildir:/matt@emenel.ca/Sent"
"Sent mail"
?s)
;; unread
(mu4e-bookmark-define (mu4e-bookmark-define
(concat "flag:unread" (concat "flag:unread"
" and not maildir:/matt@emenel.ca/Spam" " and not maildir:/matt@emenel.ca/Spam"
" and not maildir:/matt@emenel.ca/Trash") " and not maildir:/matt@emenel.ca/Trash"
" and not maildir:/admin@studyoftime.org/Spam"
" and not maildir:/admin@studyoftime.org/Trash")
"All Unread" "All Unread"
?U)
(mu4e-bookmark-define
(concat "flag:unread"
" and not maildir:/matt@emenel.ca/Spam"
" and not maildir:/matt@emenel.ca/Trash"
" and not maildir:/matt@emenel.ca/Archive"
" and not maildir:/admin@studyoftime.org/Spam"
" and not maildir:/admin@studyoftime.org/Trash"
" and not maildir:/admin@studyoftime.org/Archive")
"Inboxes Unread"
?u) ?u)
;; inboxes ;; inboxes
(mu4e-bookmark-define (mu4e-bookmark-define
"maildir:/matt@emenel.ca/Inbox" (concat "maildir:/matt@emenel.ca/Inbox"
" or maildir:/admin@studyoftime.org/Inbox")
"All Inboxes" "All Inboxes"
?i) ?i)
(setq mu4e-maildir-shortcuts
'((:maildir "/matt@emenel.ca/Inbox" :key ?1 :name "Inbox/matt@emenel.ca")
(:maildir "/matt@emenel.ca/Sent" :key ?2 :name "Sent/matt@emenel.ca")
(:maildir "/matt@emenel.ca/Spam" :key ?3 :name "Spam/matt@emenel.ca")
(:maildir "/admin@studyoftime.org/Inbox" :key ?4 :name "Inbox/admin@studyoftime.org")
(:maildir "/admin@studyoftime.org/Sent" :key ?5 :name "Sent/admin@studyoftime.org")
(:maildir "/admin@studyoftime.org/Spam" :key ?6 :name "Spam/admin@studyoftime.org")))
(add-hook! mu4e-compose-mode (add-hook! mu4e-compose-mode
(ws-butler-mode -1))) (ws-butler-mode -1)))

View file

@ -9,14 +9,10 @@
"?" #'meow-cheatsheet)) "?" #'meow-cheatsheet))
(defun meow/setup-qwerty () (defun meow/setup-qwerty ()
(setq meow-cheatsheet-layout meow-cheatsheet-layout-qwerty) (setq meow-cheatsheet-layout meow-cheatsheet-layout-qwerty))
(meow-motion-overwrite-define-key ;; (meow-motion-overwrite-define-key
'("j" . meow-next) ;; '("j" . meow-next)
'("k" . meow-prev)) ;; '("k" . meow-prev)))
(meow-leader-define-key
;; SPC j/k will run the original command in MOTION state.
'("j" . "H-j")
'("k" . "H-k")))
(defun meow--eval-sexp () (defun meow--eval-sexp ()
(interactive) (interactive)

View file

@ -38,6 +38,11 @@
(package! consult-mu (package! consult-mu
:recipe (:host nil :type git :repo "https://gt.emenel.ca/emenel/consult-mu.git" :files (:defaults "extras/*.el"))) :recipe (:host nil :type git :repo "https://gt.emenel.ca/emenel/consult-mu.git" :files (:defaults "extras/*.el")))
(package! mu4e-alert)
(package! mu4e-overview
:recipe (:type git
:host github
:repo "mkcms/mu4e-overview"))
(package! just-mode) (package! just-mode)
(package! justl) (package! justl)