diff options
Diffstat (limited to '.config/emacs/org/config.org')
-rw-r--r-- | .config/emacs/org/config.org | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/.config/emacs/org/config.org b/.config/emacs/org/config.org index 0ada552..6722a16 100644 --- a/.config/emacs/org/config.org +++ b/.config/emacs/org/config.org @@ -232,6 +232,7 @@ (evil-collection-init 'magit) (evil-collection-init 'flymake) (evil-collection-init 'neotree) + (evil-collection-init 'mu4e) (setq evil-emacs-state-cursor '("#b16286" box)) @@ -765,6 +766,105 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer." (setq neo-window-width 35) #+END_SRC +*** mu4e +#+BEGIN_SRC emacs-lisp + (require 'mu4e) + (require 'org-mu4e) + (require 'mu4e-contrib) + (require 'smtpmail) + + (auth-source-pass-enable) + (setq auth-source-debug t) + (setq auth-source-do-cache nil) + (setq auth-sources '(password-store)) + (setq message-kill-buffer-on-exit t) + (setq message-send-mail-function 'smtpmail-send-it) + (setq mu4e-attachment-dir "~/dl") + (setq mu4e-change-filenames-when-moving t) + (setq mu4e-completing-read-function 'completing-read) + (setq mu4e-compose-complete-addresses t) + (setq mu4e-compose-context-policy nil) + (setq mu4e-compose-dont-reply-to-self t) + (setq mu4e-compose-keep-self-cc nil) + (setq mu4e-context-policy 'pick-first) + (setq mu4e-get-mail-command "mbsync -a -c ~/.config/mbsync/mbsyncrc") + (setq mu4e-headers-date-format "%d-%m-%Y %H:%M") + (setq mu4e-headers-fields '((:human-date . 20) + (:flags . 6) + (:mailing-list . 10) + (:from . 22) + (:subject))) + (setq mu4e-headers-include-related t) + (setq mu4e-sent-messages-behavior 'delete) + (setq mu4e-view-show-addresses t) + (setq mu4e-view-show-images t) + (setq smtpmail-debug-info t) + (setq smtpmail-stream-type 'starttls) + (setq mm-sign-option 'guided) + + (when (fboundp 'imagemagick-register-types) + (imagemagick-register-types)) + + (defun sign-or-encrypt-message () + (let ((answer (read-from-minibuffer "Sign or encrypt?\nEmpty to do nothing.\n[s/e]: "))) + (cond + ((string-equal answer "s") (progn + (message "Signing message.") + (mml-secure-message-sign-pgpmime))) + ((string-equal answer "e") (progn + (message "Encrypt and signing message.") + (mml-secure-message-encrypt-pgpmime))) + (t (progn + (message "Dont signing or encrypting message.") + nil))))) + + (add-hook 'message-send-hook 'sign-or-encrypt-message) + + (setq mu4e-contexts + `( ,(make-mu4e-context + :name "gmail" + :enter-func (lambda () + (mu4e-message "Entering gmail context") + (when (string-match-p (buffer-name (current-buffer)) "mu4e-main") + (revert-buffer))) + :leave-func (lambda () + (mu4e-message "Leaving gmail context") + (when (string-match-p (buffer-name (current-buffer)) "mu4e-main") + (revert-buffer))) + :match-func (lambda (msg) + (when msg + (or (mu4e-message-contact-field-matches msg :to "Rudy Bousset <bousset.rudy@gmail.com>") + (mu4e-message-contact-field-matches msg :from "Rudy Bousset <bousset.rudy@gmail.com>") + (mu4e-message-contact-field-matches msg :cc "Rudy Bousset <bousset.rudy@gmail.com>") + (mu4e-message-contact-field-matches msg :bcc "Rudy Bousset <bousset.rudy@gmail.com>") + (string-match-p "^/bousset.rudy@gmail.com/INBOX" (mu4e-message-field msg :maildir))))) + :vars '( ( user-mail-address . "bousset.rudy@gmail.com" ) + ( smtpmail-smtp-user . "bousset.rudy@gmail.com" ) + ( mu4e-compose-signature . "Rudy Bousset" ) + ( smtpmail-smtp-server . "smtp.gmail.com" ) + ( smtpmail-smtp-service . 587 ) + ( mu4e-maildir-shortcuts . ((:maildir "/bousset.rudy@gmail.com/INBOX" :key ?i))) + ( mu4e-bookmarks + . + (( :name "Unread messages" + :query "maildir:/bousset.rudy@gmail.com/INBOX AND flag:unread AND NOT flag:trashed AND NOT outdoorexperten" + :key ?u) + ( :name "Today's messages" + :query "maildir:/bousset.rudy@gmail.com/INBOX AND date:today..now" + :key ?t) + ( :name "Last 7 days" + :query "maildir:/bousset.rudy@gmail.com/INBOX AND date:7d..now" + :hide-unread t + :key ?w) + ( :name "Deleted" + :query "flag:trashed" + :key ?d) + ( :name "Possibly garbage" + :query "bokio OR outdoorexperten" + :key ?g))))) + )) +#+END_SRC + ** Custom funcs #+BEGIN_SRC emacs-lisp (defadvice text-scale-increase (around all-buffers (arg) activate) |