mu4e version up + mu4e config improvements

This commit is contained in:
Emmet 2023-11-19 09:42:51 -06:00
parent c7a5d4c144
commit d2fa34df57
2 changed files with 114 additions and 104 deletions

View file

@ -1202,62 +1202,63 @@ https://github.com/magit/magit/issues/460 (@cpitclaudel)."
"q" 'helpful-kill-buffers) "q" 'helpful-kill-buffers)
;;;------ helpful configuration ------;;; ;;;------ helpful configuration ------;;;
(add-load-path! "~/.nix-profile/share/emacs/site-lisp/elpa/mu4e-1.10.7") (add-load-path! "~/.nix-profile/share/emacs/site-lisp/elpa/mu4e-1.10.8")
(require 'mu4e)
(require 'mu4e-contrib) (require 'mu4e-contrib)
(require 'mu4e-actions) (require 'mu4e-actions)
(setq mu4e-sent-folder (lambda (msg) (concat "/" (nth 1 (split-string (mu4e-message-field msg :maildir) "/" )) "/Sent")))
(setq mu4e-drafts-folder (lambda (msg) (concat "/" (nth 1 (split-string (mu4e-message-field msg :maildir) "/" )) "/Drafts")))
(setq mu4e-trash-folder (lambda (msg) (concat "/" (nth 1 (split-string (mu4e-message-field msg :maildir) "/" )) "/Trash")))
(setq mu4e-refile-folder (lambda (msg) (concat "/" (nth 1 (split-string (mu4e-message-field msg :maildir) "/" )) "/Archive")))
(setq mu4e-index-lazy-check t)
(setq mu4e-index-cleanup t)
(define-key mu4e-main-mode-map (kbd "<SPC>") #'doom/leader)
(define-key mu4e-headers-mode-map (kbd "<SPC>") #'doom/leader)
(define-key mu4e-view-mode-map (kbd "<SPC>") #'doom/leader)
(define-key mu4e-main-mode-map (kbd "g g") #'evil-goto-first-line)
(define-key mu4e-main-mode-map (kbd "G") #'evil-goto-line)
(define-key mu4e-main-mode-map (kbd "h") #'evil-backward-char)
(define-key mu4e-main-mode-map (kbd "l") #'evil-forward-char)
(define-key mu4e-main-mode-map (kbd "w") #'evil-forward-word-begin)
(unbind-key "g" mu4e-headers-mode-map)
(define-key mu4e-headers-mode-map (kbd "g g") #'evil-goto-first-line)
(define-key mu4e-headers-mode-map (kbd "G") #'evil-goto-line)
(define-key mu4e-headers-mode-map (kbd "h") #'evil-backward-char)
(define-key mu4e-headers-mode-map (kbd "l") #'evil-forward-char)
(define-key mu4e-headers-mode-map (kbd "w") #'evil-forward-word-begin)
(unbind-key "g" mu4e-view-mode-map)
(define-key mu4e-view-mode-map (kbd "g g") #'evil-goto-first-line)
(define-key mu4e-view-mode-map (kbd "G") #'evil-goto-line)
(define-key mu4e-view-mode-map (kbd "h") #'evil-backward-char)
(define-key mu4e-view-mode-map (kbd "l") #'evil-forward-char)
(define-key mu4e-view-mode-map (kbd "w") #'evil-forward-word-begin)
(map! :map 'mu4e-main-mode-map :desc "Jump to maildir" :ge "J" #'mu4e-search-maildir)
(map! :map 'mu4e-main-mode-map :desc "Next line" :ge "j" #'evil-next-visual-line)
(map! :map 'mu4e-main-mode-map :desc "Prev line" :ge "k" #'evil-previous-visual-line)
(map! :map 'mu4e-headers-mode-map :desc "Jump to maildir" :ge "J" #'mu4e-search-maildir)
(map! :map 'mu4e-headers-mode-map :desc "Next line" :ge "j" #'evil-next-visual-line)
(map! :map 'mu4e-headers-mode-map :desc "Prev line" :ge "k" #'evil-previous-visual-line)
(map! :map 'mu4e-headers-mode-map :desc "Next char" :ge "l" #'evil-forward-char)
(map! :map 'mu4e-headers-mode-map :desc "Update mail and index" :ge "U" #'mu4e-update-mail-and-index)
(map! :map 'mu4e-headers-mode-map :desc "Compose reply" :ge "r" #'mu4e-compose-reply)
(map! :map 'mu4e-headers-mode-map :desc "Archive message" :ge "e" #'mu4e-headers-mark-for-refile)
(map! :map 'mu4e-view-mode-map :desc "Jump to maildir" :ge "J" #'mu4e-search-maildir)
(map! :map 'mu4e-view-mode-map :desc "Next line" :ge "j" #'evil-next-visual-line)
(map! :map 'mu4e-view-mode-map :desc "Prev line" :ge "k" #'evil-previous-visual-line)
(map! :map 'mu4e-view-mode-map :desc "Update mail and index" :ge "U" #'mu4e-update-mail-and-index)
(map! :map 'mu4e-view-mode-map :desc "Compose reply" :ge "r" #'mu4e-compose-reply)
(map! :map 'mu4e-view-mode-map :desc "Archive message" :ge "e" #'mu4e-view-mark-for-refile)
(after! mu4e (after! mu4e
(setq mu4e-sent-folder (lambda (msg) (concat "/" (nth 1 (split-string (mu4e-message-field msg :maildir) "/" )) "/Sent")))
(setq mu4e-drafts-folder (lambda (msg) (concat "/" (nth 1 (split-string (mu4e-message-field msg :maildir) "/" )) "/Drafts")))
(setq mu4e-trash-folder (lambda (msg) (concat "/" (nth 1 (split-string (mu4e-message-field msg :maildir) "/" )) "/Trash")))
(setq mu4e-refile-folder (lambda (msg) (concat "/" (nth 1 (split-string (mu4e-message-field msg :maildir) "/" )) "/Archive")))
(setq mu4e-index-lazy-check t)
(setq mu4e-index-cleanup t)
(define-key mu4e-main-mode-map (kbd "<SPC>") #'doom/leader)
(define-key mu4e-headers-mode-map (kbd "<SPC>") #'doom/leader)
(define-key mu4e-view-mode-map (kbd "<SPC>") #'doom/leader)
(define-key mu4e-main-mode-map (kbd "g g") #'evil-goto-first-line)
(define-key mu4e-main-mode-map (kbd "G") #'evil-goto-line)
(define-key mu4e-main-mode-map (kbd "h") #'evil-backward-char)
(define-key mu4e-main-mode-map (kbd "l") #'evil-forward-char)
(define-key mu4e-main-mode-map (kbd "w") #'evil-forward-word-begin)
(unbind-key "g" mu4e-headers-mode-map)
(define-key mu4e-headers-mode-map (kbd "g g") #'evil-goto-first-line)
(define-key mu4e-headers-mode-map (kbd "G") #'evil-goto-line)
(define-key mu4e-headers-mode-map (kbd "h") #'evil-backward-char)
(define-key mu4e-headers-mode-map (kbd "l") #'evil-forward-char)
(define-key mu4e-headers-mode-map (kbd "w") #'evil-forward-word-begin)
(unbind-key "g" mu4e-view-mode-map)
(define-key mu4e-view-mode-map (kbd "g g") #'evil-goto-first-line)
(define-key mu4e-view-mode-map (kbd "G") #'evil-goto-line)
(define-key mu4e-view-mode-map (kbd "h") #'evil-backward-char)
(define-key mu4e-view-mode-map (kbd "l") #'evil-forward-char)
(define-key mu4e-view-mode-map (kbd "w") #'evil-forward-word-begin)
(map! :map 'mu4e-main-mode-map :desc "Jump to maildir" :ge "J" #'mu4e-search-maildir)
(map! :map 'mu4e-main-mode-map :desc "Next line" :ge "j" #'evil-next-visual-line)
(map! :map 'mu4e-main-mode-map :desc "Prev line" :ge "k" #'evil-previous-visual-line)
(map! :map 'mu4e-headers-mode-map :desc "Jump to maildir" :ge "J" #'mu4e-search-maildir)
(map! :map 'mu4e-headers-mode-map :desc "Next line" :ge "j" #'evil-next-visual-line)
(map! :map 'mu4e-headers-mode-map :desc "Prev line" :ge "k" #'evil-previous-visual-line)
(map! :map 'mu4e-headers-mode-map :desc "Next char" :ge "l" #'evil-forward-char)
(map! :map 'mu4e-headers-mode-map :desc "Update mail and index" :ge "U" #'mu4e-update-mail-and-index)
(map! :map 'mu4e-headers-mode-map :desc "Compose reply" :ge "r" #'mu4e-compose-reply)
(map! :map 'mu4e-headers-mode-map :desc "Archive message" :ge "e" #'mu4e-headers-mark-for-refile)
(map! :map 'mu4e-view-mode-map :desc "Jump to maildir" :ge "J" #'mu4e-search-maildir)
(map! :map 'mu4e-view-mode-map :desc "Next line" :ge "j" #'evil-next-visual-line)
(map! :map 'mu4e-view-mode-map :desc "Prev line" :ge "k" #'evil-previous-visual-line)
(map! :map 'mu4e-view-mode-map :desc "Update mail and index" :ge "U" #'mu4e-update-mail-and-index)
(map! :map 'mu4e-view-mode-map :desc "Compose reply" :ge "r" #'mu4e-compose-reply)
(map! :map 'mu4e-view-mode-map :desc "Archive message" :ge "e" #'mu4e-view-mark-for-refile)
(add-to-list 'mu4e-header-info-custom (add-to-list 'mu4e-header-info-custom
'(:maildir-folder-no-account . '(:maildir-folder-no-account .
( :name "Maildir folder without account" ;; long name, as seen in the message-view ( :name "Maildir folder without account" ;; long name, as seen in the message-view
@ -1276,6 +1277,10 @@ https://github.com/magit/magit/issues/460 (@cpitclaudel)."
(:from-or-to . 20) (:from-or-to . 20)
(:maildir-folder-no-account . 30) (:maildir-folder-no-account . 30)
(:subject))) (:subject)))
(add-hook 'mu4e-compose-mode-hook #'(lambda () (auto-save-mode -1)))
(setq mu4e-sent-messages-behavior 'delete)
(setq sendmail-program "~/.nix-profile/bin/msmtp") (setq sendmail-program "~/.nix-profile/bin/msmtp")
(setq send-mail-function 'smtpmail-send-it) (setq send-mail-function 'smtpmail-send-it)
(setq message-sendmail-f-is-evil t) (setq message-sendmail-f-is-evil t)

View file

@ -1423,62 +1423,63 @@ I don't have this active right now since it's kinda weird with pgtk...
** mu4e Configuration ** mu4e Configuration
#+BEGIN_SRC emacs-lisp :tangle config.el #+BEGIN_SRC emacs-lisp :tangle config.el
;;;------ helpful configuration ------;;; ;;;------ helpful configuration ------;;;
(add-load-path! "~/.nix-profile/share/emacs/site-lisp/elpa/mu4e-1.10.7") (add-load-path! "~/.nix-profile/share/emacs/site-lisp/elpa/mu4e-1.10.8")
(require 'mu4e)
(require 'mu4e-contrib) (require 'mu4e-contrib)
(require 'mu4e-actions) (require 'mu4e-actions)
(setq mu4e-sent-folder (lambda (msg) (concat "/" (nth 1 (split-string (mu4e-message-field msg :maildir) "/" )) "/Sent")))
(setq mu4e-drafts-folder (lambda (msg) (concat "/" (nth 1 (split-string (mu4e-message-field msg :maildir) "/" )) "/Drafts")))
(setq mu4e-trash-folder (lambda (msg) (concat "/" (nth 1 (split-string (mu4e-message-field msg :maildir) "/" )) "/Trash")))
(setq mu4e-refile-folder (lambda (msg) (concat "/" (nth 1 (split-string (mu4e-message-field msg :maildir) "/" )) "/Archive")))
(setq mu4e-index-lazy-check t)
(setq mu4e-index-cleanup t)
(define-key mu4e-main-mode-map (kbd "<SPC>") #'doom/leader)
(define-key mu4e-headers-mode-map (kbd "<SPC>") #'doom/leader)
(define-key mu4e-view-mode-map (kbd "<SPC>") #'doom/leader)
(define-key mu4e-main-mode-map (kbd "g g") #'evil-goto-first-line)
(define-key mu4e-main-mode-map (kbd "G") #'evil-goto-line)
(define-key mu4e-main-mode-map (kbd "h") #'evil-backward-char)
(define-key mu4e-main-mode-map (kbd "l") #'evil-forward-char)
(define-key mu4e-main-mode-map (kbd "w") #'evil-forward-word-begin)
(unbind-key "g" mu4e-headers-mode-map)
(define-key mu4e-headers-mode-map (kbd "g g") #'evil-goto-first-line)
(define-key mu4e-headers-mode-map (kbd "G") #'evil-goto-line)
(define-key mu4e-headers-mode-map (kbd "h") #'evil-backward-char)
(define-key mu4e-headers-mode-map (kbd "l") #'evil-forward-char)
(define-key mu4e-headers-mode-map (kbd "w") #'evil-forward-word-begin)
(unbind-key "g" mu4e-view-mode-map)
(define-key mu4e-view-mode-map (kbd "g g") #'evil-goto-first-line)
(define-key mu4e-view-mode-map (kbd "G") #'evil-goto-line)
(define-key mu4e-view-mode-map (kbd "h") #'evil-backward-char)
(define-key mu4e-view-mode-map (kbd "l") #'evil-forward-char)
(define-key mu4e-view-mode-map (kbd "w") #'evil-forward-word-begin)
(map! :map 'mu4e-main-mode-map :desc "Jump to maildir" :ge "J" #'mu4e-search-maildir)
(map! :map 'mu4e-main-mode-map :desc "Next line" :ge "j" #'evil-next-visual-line)
(map! :map 'mu4e-main-mode-map :desc "Prev line" :ge "k" #'evil-previous-visual-line)
(map! :map 'mu4e-headers-mode-map :desc "Jump to maildir" :ge "J" #'mu4e-search-maildir)
(map! :map 'mu4e-headers-mode-map :desc "Next line" :ge "j" #'evil-next-visual-line)
(map! :map 'mu4e-headers-mode-map :desc "Prev line" :ge "k" #'evil-previous-visual-line)
(map! :map 'mu4e-headers-mode-map :desc "Next char" :ge "l" #'evil-forward-char)
(map! :map 'mu4e-headers-mode-map :desc "Update mail and index" :ge "U" #'mu4e-update-mail-and-index)
(map! :map 'mu4e-headers-mode-map :desc "Compose reply" :ge "r" #'mu4e-compose-reply)
(map! :map 'mu4e-headers-mode-map :desc "Archive message" :ge "e" #'mu4e-headers-mark-for-refile)
(map! :map 'mu4e-view-mode-map :desc "Jump to maildir" :ge "J" #'mu4e-search-maildir)
(map! :map 'mu4e-view-mode-map :desc "Next line" :ge "j" #'evil-next-visual-line)
(map! :map 'mu4e-view-mode-map :desc "Prev line" :ge "k" #'evil-previous-visual-line)
(map! :map 'mu4e-view-mode-map :desc "Update mail and index" :ge "U" #'mu4e-update-mail-and-index)
(map! :map 'mu4e-view-mode-map :desc "Compose reply" :ge "r" #'mu4e-compose-reply)
(map! :map 'mu4e-view-mode-map :desc "Archive message" :ge "e" #'mu4e-view-mark-for-refile)
(after! mu4e (after! mu4e
(setq mu4e-sent-folder (lambda (msg) (concat "/" (nth 1 (split-string (mu4e-message-field msg :maildir) "/" )) "/Sent")))
(setq mu4e-drafts-folder (lambda (msg) (concat "/" (nth 1 (split-string (mu4e-message-field msg :maildir) "/" )) "/Drafts")))
(setq mu4e-trash-folder (lambda (msg) (concat "/" (nth 1 (split-string (mu4e-message-field msg :maildir) "/" )) "/Trash")))
(setq mu4e-refile-folder (lambda (msg) (concat "/" (nth 1 (split-string (mu4e-message-field msg :maildir) "/" )) "/Archive")))
(setq mu4e-index-lazy-check t)
(setq mu4e-index-cleanup t)
(define-key mu4e-main-mode-map (kbd "<SPC>") #'doom/leader)
(define-key mu4e-headers-mode-map (kbd "<SPC>") #'doom/leader)
(define-key mu4e-view-mode-map (kbd "<SPC>") #'doom/leader)
(define-key mu4e-main-mode-map (kbd "g g") #'evil-goto-first-line)
(define-key mu4e-main-mode-map (kbd "G") #'evil-goto-line)
(define-key mu4e-main-mode-map (kbd "h") #'evil-backward-char)
(define-key mu4e-main-mode-map (kbd "l") #'evil-forward-char)
(define-key mu4e-main-mode-map (kbd "w") #'evil-forward-word-begin)
(unbind-key "g" mu4e-headers-mode-map)
(define-key mu4e-headers-mode-map (kbd "g g") #'evil-goto-first-line)
(define-key mu4e-headers-mode-map (kbd "G") #'evil-goto-line)
(define-key mu4e-headers-mode-map (kbd "h") #'evil-backward-char)
(define-key mu4e-headers-mode-map (kbd "l") #'evil-forward-char)
(define-key mu4e-headers-mode-map (kbd "w") #'evil-forward-word-begin)
(unbind-key "g" mu4e-view-mode-map)
(define-key mu4e-view-mode-map (kbd "g g") #'evil-goto-first-line)
(define-key mu4e-view-mode-map (kbd "G") #'evil-goto-line)
(define-key mu4e-view-mode-map (kbd "h") #'evil-backward-char)
(define-key mu4e-view-mode-map (kbd "l") #'evil-forward-char)
(define-key mu4e-view-mode-map (kbd "w") #'evil-forward-word-begin)
(map! :map 'mu4e-main-mode-map :desc "Jump to maildir" :ge "J" #'mu4e-search-maildir)
(map! :map 'mu4e-main-mode-map :desc "Next line" :ge "j" #'evil-next-visual-line)
(map! :map 'mu4e-main-mode-map :desc "Prev line" :ge "k" #'evil-previous-visual-line)
(map! :map 'mu4e-headers-mode-map :desc "Jump to maildir" :ge "J" #'mu4e-search-maildir)
(map! :map 'mu4e-headers-mode-map :desc "Next line" :ge "j" #'evil-next-visual-line)
(map! :map 'mu4e-headers-mode-map :desc "Prev line" :ge "k" #'evil-previous-visual-line)
(map! :map 'mu4e-headers-mode-map :desc "Next char" :ge "l" #'evil-forward-char)
(map! :map 'mu4e-headers-mode-map :desc "Update mail and index" :ge "U" #'mu4e-update-mail-and-index)
(map! :map 'mu4e-headers-mode-map :desc "Compose reply" :ge "r" #'mu4e-compose-reply)
(map! :map 'mu4e-headers-mode-map :desc "Archive message" :ge "e" #'mu4e-headers-mark-for-refile)
(map! :map 'mu4e-view-mode-map :desc "Jump to maildir" :ge "J" #'mu4e-search-maildir)
(map! :map 'mu4e-view-mode-map :desc "Next line" :ge "j" #'evil-next-visual-line)
(map! :map 'mu4e-view-mode-map :desc "Prev line" :ge "k" #'evil-previous-visual-line)
(map! :map 'mu4e-view-mode-map :desc "Update mail and index" :ge "U" #'mu4e-update-mail-and-index)
(map! :map 'mu4e-view-mode-map :desc "Compose reply" :ge "r" #'mu4e-compose-reply)
(map! :map 'mu4e-view-mode-map :desc "Archive message" :ge "e" #'mu4e-view-mark-for-refile)
(add-to-list 'mu4e-header-info-custom (add-to-list 'mu4e-header-info-custom
'(:maildir-folder-no-account . '(:maildir-folder-no-account .
( :name "Maildir folder without account" ;; long name, as seen in the message-view ( :name "Maildir folder without account" ;; long name, as seen in the message-view
@ -1497,6 +1498,10 @@ I don't have this active right now since it's kinda weird with pgtk...
(:from-or-to . 20) (:from-or-to . 20)
(:maildir-folder-no-account . 30) (:maildir-folder-no-account . 30)
(:subject))) (:subject)))
(add-hook 'mu4e-compose-mode-hook #'(lambda () (auto-save-mode -1)))
(setq mu4e-sent-messages-behavior 'delete)
(setq sendmail-program "~/.nix-profile/bin/msmtp") (setq sendmail-program "~/.nix-profile/bin/msmtp")
(setq send-mail-function 'smtpmail-send-it) (setq send-mail-function 'smtpmail-send-it)
(setq message-sendmail-f-is-evil t) (setq message-sendmail-f-is-evil t)