From 7feb4926486a1fa3137d07a36c1875126c8b143b Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Fri, 14 Jul 2023 09:50:55 -0500 Subject: [PATCH] better mu4e --- README.org | 58 ++++++++++++++++++-------------------------------- init.el | 62 +++++++++++++++++------------------------------------- 2 files changed, 39 insertions(+), 81 deletions(-) diff --git a/README.org b/README.org index 3f8a81e0..420b6049 100644 --- a/README.org +++ b/README.org @@ -294,7 +294,7 @@ Probably the prettiest and best modeline I've found. (setq doom-modeline-icon t)))))) #+end_src -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle no (use-package nano-modeline :config (setq nano-modeline-space-top 0.25 @@ -618,6 +618,7 @@ Let's start by creating a self contained function of what I'd like started on ev (interactive) ;; (org-indent-mode +1) (toc-org-mode +1) + (smartparens-mode +1) (visual-fill-column-mode +1) (display-line-numbers-mode -1) (variable-pitch-mode +1) @@ -3352,12 +3353,6 @@ Ledger mode ;; :load-path "~/.guix-home/profile/share/emacs/site-lisp/mu4e/" :init - (defun mu4e--main-action-str (name func) - "This seems to be needed until evil-collection supports the latest - version of mu4e." - "mu4e--main-action") - (remove-hook 'mu4e-main-mode-hook 'evil-collection-mu4e-update-main-view) - (setq mu4e-maildir "~/mail" user-full-name "Chris Cochrun" mu4e-change-filenames-when-moving t @@ -3382,6 +3377,12 @@ Ledger mode :config (setq mail-user-agent 'mu4e-user-agent) + (defun mu4e--main-action-str (name func) + "This seems to be needed until evil-collection supports the latest + version of mu4e." + "mu4e--main-action") + (remove-hook 'mu4e-main-mode-hook 'evil-collection-mu4e-update-main-view) + (setq mu4e-contexts (list (make-mu4e-context @@ -3400,19 +3401,6 @@ Ledger mode (smtpmail-auth-credentials . '(("smtp.office365.com" 587 "chris@tfcconnection.org" nil))) (smtpmail-smtp-server . "smtp.office365.com") (mu4e-compose-signature . "Praising God in all things,\nChris Cochrun"))) - (make-mu4e-context - :name "outlook" - :match-func - (lambda (msg) - (when msg - (string-prefix-p "/outlook" (mu4e-message-field msg :maildir)))) - :vars '((user-mail-address . "chris.cochrun@outlook.com") - (mu4e-sent-folder . "/outlook/Sent/") - (mu4e-drafts-folder . "/outlook/Drafts") - (mu4e-trash-folder . "/outlook/Deleted") - (mu4e-refile-folder . "/outlook/Archive") - (smtpmail-smtp-user . "chris.cochrun@outlook.com") - (mu4e-compose-signature . "Praising God in all things,\nChris Cochrun"))) (make-mu4e-context :name "personal" :match-func @@ -3428,17 +3416,7 @@ Ledger mode (smtpmail-starttls-credentials . '(("mail.cochrun.xyz" 587 nil nil))) (smtpmail-auth-credentials . '(("mail.cochrun.xyz" 587 "chris@cochrun.xyz" nil))) (smtpmail-smtp-server . "mail.cochrun.xyz") - (mu4e-compose-signature . "Praising God in all things,\nChris Cochrun\nchris@tfcconnection.org\nchris@cochrun.xyz"))) - (make-mu4e-context - :name "gmail" - :match-func - (lambda (msg) - (when msg - (string-prefix-p "/gmail" (mu4e-message-field msg :maildir)))) - :vars '((user-mail-address . "ccochrun21@gmail.com") - (mu4e-sent-folder . "/gmail/[Gmail].Sent Mail/") - (smtpmail-smtp-user . "ccochrun21@gmail.com") - (mu4e-compose-signature . "Praising God in all things,\nChris Cochrun"))))) + (mu4e-compose-signature . "Praising God in all things,\nChris Cochrun\nchris@tfcconnection.org\nchris@cochrun.xyz"))))) ;; Add the ability to send email (setq message-send-mail-function 'smtpmail-send-it @@ -3459,7 +3437,7 @@ Ledger mode (setq mu4e-bookmarks '((:name "Unread messages" - :query "flag:unread AND NOT flag:trashed AND NOT maildir:\"/outlook/Junk\" AND NOT maildir:\"/office/Junk Email\" AND NOT maildir:\"/outlook/Deleted\" AND NOT maildir:\"/office/Deleted Items\" AND NOT maildir:\"/office/Archive\" AND NOT maildir:\"/outlook/Archive\" AND NOT maildir:\"/cochrun/Archive\" AND NOT maildir:\"/cochrun/Junk\"" + :query "flag:unread AND NOT flag:trashed AND NOT maildir:\"/outlook/Junk\" AND NOT maildir:\"/office/Junk Email\" AND NOT maildir:\"/outlook/Deleted\" AND NOT maildir:\"/office/Deleted Items\" AND NOT maildir:\"/office/Archive\" AND NOT maildir:\"/outlook/Archive\" AND NOT maildir:\"/cochrun/Archive\" AND NOT maildir:\"/cochrun/Junk\" AND NOT flag:list" :key 117) (:name "Today's messages" :query "date:today..now" @@ -3470,10 +3448,14 @@ Ledger mode :key 119) (:name "Messages with images" :query "mime:image/*" - :key 112))) + :key 112) + (:name "Lists" + :query "flag:list" + :key 108))) - (setq mu4e-view-prefer-html nil - shr-color-visible-luminance-min 80) + (setq + mu4e-view-prefer-html nil + shr-color-visible-luminance-min 80) (setq mu4e-use-fancy-chars t mu4e-headers-draft-mark '("D" . "") @@ -3512,9 +3494,9 @@ Ledger mode (visual-line-mode -1) (toggle-truncate-lines +1)) - (remove-hook 'mu4e-main-mode-hook '(display-line-numbers-mode -1)) - (add-hook 'mu4e-headers-mode-hook #'chris/setup-mu4e-headers) - (add-hook 'mu4e-view-mode-hook #'chris/setup-mu4e-view) + ;; (remove-hook 'mu4e-main-mode-hook '(display-line-numbers-mode -1)) + ;; (add-hook 'mu4e-headers-mode-hook #'chris/setup-mu4e-headers) + ;; (add-hook 'mu4e-view-mode-hook #'chris/setup-mu4e-view) (mu4e t) diff --git a/init.el b/init.el index b0fb35a5..51114ca8 100644 --- a/init.el +++ b/init.el @@ -129,12 +129,6 @@ (with-selected-frame frame (setq doom-modeline-icon t)))))) -(use-package nano-modeline - :config - (setq nano-modeline-space-top 0.25 - nano-modeline-space-bottom -0.25 - nano-modeline-prefix 'icon)) - (use-package doom-themes :ensure t :init (load-theme 'doom-snazzy t)) @@ -360,6 +354,7 @@ (interactive) ;; (org-indent-mode +1) (toc-org-mode +1) + (smartparens-mode +1) (visual-fill-column-mode +1) (display-line-numbers-mode -1) (variable-pitch-mode +1) @@ -2386,12 +2381,6 @@ targets." ;; :load-path "~/.guix-home/profile/share/emacs/site-lisp/mu4e/" :init - (defun mu4e--main-action-str (name func) - "This seems to be needed until evil-collection supports the latest - version of mu4e." - "mu4e--main-action") - (remove-hook 'mu4e-main-mode-hook 'evil-collection-mu4e-update-main-view) - (setq mu4e-maildir "~/mail" user-full-name "Chris Cochrun" mu4e-change-filenames-when-moving t @@ -2416,6 +2405,12 @@ targets." :config (setq mail-user-agent 'mu4e-user-agent) + (defun mu4e--main-action-str (name func) + "This seems to be needed until evil-collection supports the latest + version of mu4e." + "mu4e--main-action") + (remove-hook 'mu4e-main-mode-hook 'evil-collection-mu4e-update-main-view) + (setq mu4e-contexts (list (make-mu4e-context @@ -2434,19 +2429,6 @@ targets." (smtpmail-auth-credentials . '(("smtp.office365.com" 587 "chris@tfcconnection.org" nil))) (smtpmail-smtp-server . "smtp.office365.com") (mu4e-compose-signature . "Praising God in all things,\nChris Cochrun"))) - (make-mu4e-context - :name "outlook" - :match-func - (lambda (msg) - (when msg - (string-prefix-p "/outlook" (mu4e-message-field msg :maildir)))) - :vars '((user-mail-address . "chris.cochrun@outlook.com") - (mu4e-sent-folder . "/outlook/Sent/") - (mu4e-drafts-folder . "/outlook/Drafts") - (mu4e-trash-folder . "/outlook/Deleted") - (mu4e-refile-folder . "/outlook/Archive") - (smtpmail-smtp-user . "chris.cochrun@outlook.com") - (mu4e-compose-signature . "Praising God in all things,\nChris Cochrun"))) (make-mu4e-context :name "personal" :match-func @@ -2462,17 +2444,7 @@ targets." (smtpmail-starttls-credentials . '(("mail.cochrun.xyz" 587 nil nil))) (smtpmail-auth-credentials . '(("mail.cochrun.xyz" 587 "chris@cochrun.xyz" nil))) (smtpmail-smtp-server . "mail.cochrun.xyz") - (mu4e-compose-signature . "Praising God in all things,\nChris Cochrun\nchris@tfcconnection.org\nchris@cochrun.xyz"))) - (make-mu4e-context - :name "gmail" - :match-func - (lambda (msg) - (when msg - (string-prefix-p "/gmail" (mu4e-message-field msg :maildir)))) - :vars '((user-mail-address . "ccochrun21@gmail.com") - (mu4e-sent-folder . "/gmail/[Gmail].Sent Mail/") - (smtpmail-smtp-user . "ccochrun21@gmail.com") - (mu4e-compose-signature . "Praising God in all things,\nChris Cochrun"))))) + (mu4e-compose-signature . "Praising God in all things,\nChris Cochrun\nchris@tfcconnection.org\nchris@cochrun.xyz"))))) ;; Add the ability to send email (setq message-send-mail-function 'smtpmail-send-it @@ -2493,7 +2465,7 @@ targets." (setq mu4e-bookmarks '((:name "Unread messages" - :query "flag:unread AND NOT flag:trashed AND NOT maildir:\"/outlook/Junk\" AND NOT maildir:\"/office/Junk Email\" AND NOT maildir:\"/outlook/Deleted\" AND NOT maildir:\"/office/Deleted Items\" AND NOT maildir:\"/office/Archive\" AND NOT maildir:\"/outlook/Archive\" AND NOT maildir:\"/cochrun/Archive\" AND NOT maildir:\"/cochrun/Junk\"" + :query "flag:unread AND NOT flag:trashed AND NOT maildir:\"/outlook/Junk\" AND NOT maildir:\"/office/Junk Email\" AND NOT maildir:\"/outlook/Deleted\" AND NOT maildir:\"/office/Deleted Items\" AND NOT maildir:\"/office/Archive\" AND NOT maildir:\"/outlook/Archive\" AND NOT maildir:\"/cochrun/Archive\" AND NOT maildir:\"/cochrun/Junk\" AND NOT flag:list" :key 117) (:name "Today's messages" :query "date:today..now" @@ -2504,10 +2476,14 @@ targets." :key 119) (:name "Messages with images" :query "mime:image/*" - :key 112))) + :key 112) + (:name "Lists" + :query "flag:list" + :key 108))) - (setq mu4e-view-prefer-html nil - shr-color-visible-luminance-min 80) + (setq + mu4e-view-prefer-html nil + shr-color-visible-luminance-min 80) (setq mu4e-use-fancy-chars t mu4e-headers-draft-mark '("D" . "") @@ -2546,9 +2522,9 @@ targets." (visual-line-mode -1) (toggle-truncate-lines +1)) - (remove-hook 'mu4e-main-mode-hook '(display-line-numbers-mode -1)) - (add-hook 'mu4e-headers-mode-hook #'chris/setup-mu4e-headers) - (add-hook 'mu4e-view-mode-hook #'chris/setup-mu4e-view) + ;; (remove-hook 'mu4e-main-mode-hook '(display-line-numbers-mode -1)) + ;; (add-hook 'mu4e-headers-mode-hook #'chris/setup-mu4e-headers) + ;; (add-hook 'mu4e-view-mode-hook #'chris/setup-mu4e-view) (mu4e t)