mu4e config continues

This commit is contained in:
Matt Nish-Lapidus 2024-06-24 17:26:31 -04:00
parent cab192d15a
commit 9f140d48d6
4 changed files with 78 additions and 20 deletions

View file

@ -211,12 +211,8 @@
(:when (modulep! :lang org +present) (:when (modulep! :lang org +present)
:desc "org-tree-slide mode" "p" #'org-tree-slide-mode) :desc "org-tree-slide mode" "p" #'org-tree-slide-mode)
:desc "Read-only mode" "r" #'read-only-mode :desc "Read-only mode" "r" #'read-only-mode
(:when (and (modulep! :checkers spell) (not (modulep! :checkers spell +flyspell)))
:desc "Spell checker" "s" #'spell-fu-mode)
(:when (modulep! :checkers spell +flyspell) (:when (modulep! :checkers spell +flyspell)
:desc "Spell checker" "s" #'flyspell-mode) :desc "Spell checker" "s" #'flyspell-mode)
(:when (modulep! :lang org +pomodoro)
:desc "Pomodoro timer" "t" #'org-pomodoro)
:desc "Visible mode" "v" #'visible-mode :desc "Visible mode" "v" #'visible-mode
:desc "Soft line wrapping" "w" #'visual-line-mode :desc "Soft line wrapping" "w" #'visual-line-mode
(:when (modulep! :editor word-wrap) (:when (modulep! :editor word-wrap)
@ -243,8 +239,6 @@
:desc "Reveal project in Finder" "O" #'+macos/reveal-project-in-finder :desc "Reveal project in Finder" "O" #'+macos/reveal-project-in-finder
:desc "Open in Kitty" "k" #'terminal-here :desc "Open in Kitty" "k" #'terminal-here
:desc "Open project root in Kitty" "K" #'terminal-here-project-launch) :desc "Open project root in Kitty" "K" #'terminal-here-project-launch)
(:when (modulep! :tools docker)
:desc "Docker" "D" #'docker)
(:when (modulep! :email mu4e) (:when (modulep! :email mu4e)
:desc "mu4e" "m" #'=mu4e)) :desc "mu4e" "m" #'=mu4e))
@ -471,12 +465,14 @@
(map! (map!
:map mu4e-main-mode-map :map mu4e-main-mode-map
:localleader :localleader
:desc "Compose" "c" #'compose-mail) :desc "Compose" "c" #'compose-mail
:desc "Search (consult)" "s" #'consult-mu)
(map! (map!
:map mu4e-compose-mode-map :map mu4e-compose-mode-map
:localleader :localleader
:desc "Send message and exit" "s" #'message-send-and-exit) :desc "Send message and exit" "s" #'message-send-and-exit
:desc "Update All" "s" #'mu4e-update-mail-and-index)
(map! (map!
:map dired-mode-map :map dired-mode-map

View file

@ -258,10 +258,56 @@
(user-mail-address . "matt@emenel.ca") ;; only needed for mu < 1.4 (user-mail-address . "matt@emenel.ca") ;; only needed for mu < 1.4
(smtpmail-default-smtp-server . "smtp.fastmail.com") (smtpmail-default-smtp-server . "smtp.fastmail.com")
(smtpmail-smtp-server . "smtp.fastmail.com") (smtpmail-smtp-server . "smtp.fastmail.com")
(smtpmail-local-domain . "fastmail.com") (smtpmail-local-domain . "fastmail.com"))
(mu4e-compose-signature . "---")) t)
t)
(defun message-insert-signature-at-point ()
"Insert signature at point."
(interactive)
(setq message-signature "Matt Nish-Lapidus\nhttps://emenel.ca")
(save-restriction
(narrow-to-region (point) (point))
(message-insert-signature)
(newline))
(setq message-signature nil))
(use-package! consult-mu
:custom
;;maximum number of results shown in minibuffer
(consult-mu-maxnum 200)
;;show preview when pressing any keys
(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)
;;mark email as read when selected.
;; (consult-mu-mark-viewed-as-read t)
;;use reply to all when composing reply emails
(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-action #'consult-mu--view-action)
: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-async '("#flag:unread"))
;; require embark actions for marking, replying, forwarding, etc. directly from minibuffer
(require 'consult-mu-embark)
;; require extra module for composing (e.g. for interactive attachment) as well as embark actions
(require 'consult-mu-compose)
(require 'consult-mu-compose-embark)
;; require extra module for searching contacts and runing embark actions on contacts
(require 'consult-mu-contacts)
(require 'consult-mu-contacts-embark)
;; change the prefiew key for compose so you don't open a preview of every file when selecting files to attach
(setq consult-mu-compose-preview-key "M-o")
;; pick a key to bind to consult-mu-compose-attach in embark-file-map
(setq consult-mu-embark-attach-file-key "C-a")
(setq consult-mu-contacts-ignore-list '("^.*no.*reply.*"))
(setq consult-mu-contacts-ignore-case-fold-search t)
(consult-mu-compose-embark-bind-attach-file-key)
;; 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))
(after! mu4e (after! mu4e
@ -269,7 +315,14 @@
mu4e-index-cleanup t mu4e-index-cleanup t
mu4e-index-lazy-check nil mu4e-index-lazy-check nil
mu4e-show-images t mu4e-show-images t
message-kill-buffer-on-exit t) message-kill-buffer-on-exit t
mu4e-enable-async-operations t)
(setq message-citation-line-format "On %e %B %Y at %R %Z, %f wrote:\n")
(setq message-citation-line-function 'message-insert-formatted-citation-line)
(setq message-signature nil)
(setq mu4e-bookmarks nil) (setq mu4e-bookmarks nil)
(setq sendmail-program "/opt/homebrew/bin/msmtp" (setq sendmail-program "/opt/homebrew/bin/msmtp"
@ -278,19 +331,27 @@
message-sendmail-extra-arguments '("--read-envelope-from") message-sendmail-extra-arguments '("--read-envelope-from")
message-send-mail-function 'message-send-mail-with-sendmail) message-send-mail-function 'message-send-mail-with-sendmail)
;; spam (setq mu4e-compose-format-flowed t)
(add-hook! 'mu4e-compose-mode-hook
(use-hard-newlines -1)
(message-goto-body)
(message-insert-signature-at-point)
(message-goto-body))
;; spam
(mu4e-bookmark-define (mu4e-bookmark-define
"maildir:/matt@emenel.ca/Spam" "maildir:/matt@emenel.ca/Spam"
"Spam mail" "Spam mail"
?S) ?S)
;; sent ;; sent
(mu4e-bookmark-define (mu4e-bookmark-define
"maildir:/matt@emenel.ca/Sent" "maildir:/matt@emenel.ca/Sent"
"Sent mail" "Sent mail"
?s) ?s)
;; unread ;; 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"
@ -298,7 +359,7 @@
"All Unread" "All Unread"
?u) ?u)
;; inboxes ;; inboxes
(mu4e-bookmark-define (mu4e-bookmark-define
"maildir:/matt@emenel.ca/Inbox" "maildir:/matt@emenel.ca/Inbox"
"All Inboxes" "All Inboxes"

View file

@ -49,7 +49,7 @@
unicode ; extended unicode support for various languages unicode ; extended unicode support for various languages
(vc-gutter +pretty) ; vcs diff in the fringe (vc-gutter +pretty) ; vcs diff in the fringe
vi-tilde-fringe ; fringe tildes to mark beyond EOB vi-tilde-fringe ; fringe tildes to mark beyond EOB
;;window-select ; visually switch windows window-select ; visually switch windows
workspaces ; tab emulation, persistence & separate workspaces workspaces ; tab emulation, persistence & separate workspaces
;;zen ; distraction-free coding or writing ;;zen ; distraction-free coding or writing
@ -112,7 +112,7 @@
:os :os
(:if IS-MAC macos) ; improve compatibility with macOS (:if IS-MAC macos) ; improve compatibility with macOS
;;tty ; improve the terminal Emacs experience ;; tty ; improve the terminal Emacs experience
:lang :lang
;;agda ; types of types of types of types... ;;agda ; types of types of types of types...

View file

@ -36,12 +36,13 @@
:host github :host github
:repo "kmonad/kbd-mode")) :repo "kmonad/kbd-mode"))
(package! consult-mu
:recipe (:host nil :type git :repo "https://gt.emenel.ca/emenel/consult-mu.git" :files (:defaults "extras/*.el")))
(package! just-mode) (package! just-mode)
(package! justl) (package! justl)
(package! fennel-mode) (package! fennel-mode)
(package! systemd) (package! systemd)
(package! nerd-icons-completion) (package! nerd-icons-completion)
(package! nerd-icons-dired) (package! nerd-icons-dired)
(package! treemacs-nerd-icons) (package! treemacs-nerd-icons)