Update mu4e stuff

This commit is contained in:
Alexander Rosenberg 2025-04-29 22:54:18 +09:00
parent b036ee2a32
commit 5bb3c77e3c
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730
2 changed files with 35 additions and 32 deletions

Binary file not shown.

67
init.el
View File

@ -3057,13 +3057,7 @@ The name is compared with the field name using TESTFN (defaults to `equal')."
(mu4e-compose-mode . my/-mu4e-setup-compose-mode))
:bind (("C-x C-m" . mu4e)
:map message-mode-map
("C-c k" . khard-insert-email-contact)
:map mu4e-headers-mode-map
([remap mu4e-headers-mark-for-trash] .
my/mu4e-headers-mark-for-trash)
:map mu4e-view-mode-map
([remap mu4e-view-mark-for-trash] .
my/mu4e-view-mark-for-trash))
("C-c k" . khard-insert-email-contact))
:init
(require 'mu4e)
(evil-define-key '(normal motion) mu4e-main-mode-map "q" #'bury-buffer)
@ -3078,20 +3072,6 @@ The name is compared with the field name using TESTFN (defaults to `equal')."
"Run `mu4e-update-mail-and-index' without any messages in the background."
(setq mu4e-hide-index-messages t)
(mu4e-update-mail-and-index t))
(defun my/mu4e-headers-mark-for-trash ()
"Move the message a point to the trash without marking it was deleted
(trashed)."
(interactive)
(when (mu4e-thread-message-folded-p)
(mu4e-warn "Cannot mark folded messages"))
(mu4e-mark-at-point 'move mu4e-trash-folder)
(when mu4e-headers-advance-after-mark
(mu4e-headers-next)))
(defun my/mu4e-view-mark-for-trash ()
"Like `my/mu4e-headers-mark-for-trash', but for `mu4e-view-mode'."
(interactive)
(mu4e--view-in-headers-context
(my/mu4e-headers-mark-for-trash)))
(defun my/-mu4e-enable-autocomplete-in-header ()
;; corfu auto must be t (not the integer returned by
;; `my/message-in-header-p'
@ -3108,21 +3088,35 @@ The name is compared with the field name using TESTFN (defaults to `equal')."
(setq-local completion-cycle-threshold nil))
(advice-add 'mu4e--compose-setup-completion :after
'my/-mu4e-fix-cycle-threshold)
(defvar my/mu4e-inbox-query
(concat "maildir:/protonmail/Inbox or maildir:/ucsc-gmail/Inbox"))
(defvar my/mu4e-interesting-mail-query
(concat "flag:unread AND NOT flag:trashed AND NOT "
"maildir:/protonmail/Trash AND NOT maildir:/protonmail/Spam")
"maildir:/protonmail/Trash AND NOT maildir:/protonmail/Spam AND NOT "
"maildir:/ucsc-gmail/[Gmail]/Trash AND NOT "
"maildir:/ucsc-gmail/[Gmail]/Spam")
"Flag for mail which will appear as \"unread\" and will be notified.")
(setq message-kill-buffer-on-exit t
message-confirm-send t
message-send-mail-function 'sendmail-send-it
sendmail-program "/usr/bin/msmtp"
message-sendmail-f-is-evil t
send-mail-function 'smtpmail-send-it
message-send-mail-function 'message-send-mail-with-sendmail
mu4e-trash-without-flag t
mu4e-change-filenames-when-moving t
mu4e-context-policy 'pick-first
mu4e-attachment-dir "~/downloads/"
mu4e-last-update-buffer " *mu4e-last-update*"
mu4e-index-update-error-warning nil
mu4e-get-mail-command "mbsync protonmail"
mu4e-get-mail-command "mbsync -a"
mu4e-completing-read-function #'completing-read-default
mu4e-compose-context-policy 'ask-if-none
mu4e-bookmarks `((:name "Inbox"
:query ,my/mu4e-inbox-query
:key ?i)
(:name "Unread"
:query ,my/mu4e-interesting-mail-query
:key ?u))
mu4e-contexts
(list (make-mu4e-context
:name "Personal"
@ -3133,18 +3127,27 @@ The name is compared with the field name using TESTFN (defaults to `equal')."
:maildir))))
:vars `((user-mail-address . ,(my/get-private 'mu4e-email))
(user-full-name . ,(my/get-private 'mu4e-name))
(message-sendmail-extra-arguments . ("-a" "protonmail"))
(message-signature . nil)
(mu4e-refile-folder . "/protonmail/Archive")
(mu4e-sent-folder . "/protonmail/Sent")
(mu4e-drafts-folder . "/protonmail/Drafts")
(mu4e-trash-folder . "/protonmail/Trash")
(mu4e-bookmarks
. ((:name "Inbox"
:query "maildir:/protonmail/Inbox"
:key ?i)
(:name "Unread"
:query ,my/mu4e-interesting-mail-query
:key ?u))))))))
(mu4e-trash-folder . "/protonmail/Trash")))
(make-mu4e-context
:name "School"
:match-func (lambda (msg)
(when msg
(string-match-p "^/ucsc-gmail/"
(mu4e-message-field msg
:maildir))))
:vars `((user-mail-address . ,(my/get-private 'mu4e-email-school))
(user-full-name . ,(my/get-private 'mu4e-name))
(message-sendmail-extra-arguments . ("-a" "ucsc-gmail"))
(message-signature . nil)
(mu4e-refile-folder . "/protonmail/[Gmail]/All Mail")
(mu4e-sent-folder . "/ucsc-gmail/[Gmail]/Sent Mail")
(mu4e-drafts-folder . "/ucsc-gmail/[Gmail]/Drafts")
(mu4e-trash-folder . "/ucsc-gmail/[Gmail]/Trash"))))))
(use-package mu4e-alert
:after mu4e
:hook (after-init . mu4e-alert-enable-notifications)