Add mu4e stuff

master
Jacopo De Simoi 5 years ago
parent e20f763dfd
commit 2700ddbf5e
  1. 6
      .gitmodules
  2. 97
      global.org
  3. 1
      helm-mu
  4. 1
      org-vcard

6
.gitmodules vendored

@ -118,3 +118,9 @@
[submodule "transmission"]
path = transmission
url = https://github.com/holomorph/transmission
[submodule "org-vcard"]
path = org-vcard
url = https://github.com/flexibeast/org-vcard.git
[submodule "helm-mu"]
path = helm-mu
url = https://github.com/emacs-helm/helm-mu.git

@ -596,6 +596,103 @@
#+end_src
* Main major modes
** mu4e
#+begin_src emacs-lisp
(require 'smtpmail)
(require 'mu4e)
(global-set-key (kbd "C-c μ") 'mu4e)
(setq mu4e-maildir "~/.mail"
mu4e-attachment-dir "~/attachments"
mu4e-html2text-command "w3m -dump -T text/html -cols 72 -o display_link_number=true -o auto_image=false -o display_image=false -o ignore_null_img_alt=true"
mu4e-headers-show-threads nil)
(setq mu4e-contexts
`( ,(make-mu4e-context
:name "Private"
:enter-func (lambda () (mu4e-message "Entering Private context"))
:leave-func (lambda () (mu4e-message "Leaving Private context"))
;; we match based on the contact-fields of the message
:match-func (lambda (msg)
(when msg
(mu4e-message-contact-field-matches msg
:to "aliced@home.example.com")))
:vars '( ( user-mail-address . "jacopods@protonmail.com" )
( user-full-name . "Jacopo De Simoi" )
( mu4e-sent-folder . "/proton/Sent")
( mu4e-drafts-folder . "/proton/Drafts")
( mu4e-trash-folder . "/proton/Trash")
( mu4e-refile-folder . "/proton/Archive")
( smtpmail-stream-type . plain)
( smtpmail-smtp-service . 1025 )
( mu4e-compose-signature . nil)))
,(make-mu4e-context
:name "Work"
:enter-func (lambda () (mu4e-message "Switch to the Work context"))
;; no leave-func
;; we match based on the maildir of the message
;; this matches maildir /Arkham and its sub-directories
:match-func (lambda (msg)
(when msg
(string-match-p "^/math" (mu4e-message-field
msg :maildir))))
:vars '( ( user-mail-address . "jacopods@math.utoronto.ca" )
( user-full-name . "Jacopo De Simoi" )
( mu4e-sent-folder . "/math/Sent")
( mu4e-drafts-folder . "/math/Drafts")
(mu4e-trash-folder . "/math/Trash")
(mu4e-refile-folder . "/math/Archive")
(smtpmail-stream-type . starttls )
(smtpmail-smtp-service . 9587 )
( mu4e-compose-signature .
(concat
"Jacopo De Simoi \n"
"Assistant Professor — U Toronto\n"))))))
;; set `mu4e-context-policy` and `mu4e-compose-policy` to tweak when mu4e should
;; guess or ask the correct context, e.g.
;; start with the first (default) context;
;; default is to ask-if-none (ask when there's no context yet, and none match)
;; (setq mu4e-context-policy 'pick-first)
;; compose with the current context is no context matches;
;; default is to ask
;; (setq mu4e-compose-context-policy nil)
(add-hook 'mu4e-headers-mode-hook
#'(lambda () (setq-local show-trailing-whitespace nil)))
(add-hook 'mu4e-view-mode-hook
#'(lambda () (setq-local show-trailing-whitespace nil)))
;; Get mail
(setq mu4e-get-mail-command "mbsync -a"
mu4e-change-filenames-when-moving t ; needed for mbsync
mu4e-headers-include-related nil ;do not include threaded
;sent messages in inbox queries
)
(define-key mu4e-headers-mode-map (kbd "h") 'mu4e-headers-mark-for-refile)
(define-key mu4e-headers-mode-map (kbd "h") 'mu4e-headers-mark-for-refile)
(define-key mu4e-headers-mode-map (kbd "h") 'mu4e-headers-mark-for-refile)
(define-key mu4e-view-mode-map (kbd "h") 'mu4e-view-mark-for-refile)
(define-key mu4e-headers-mode-map (kbd "r") 'mu4e-compose-reply)
(define-key mu4e-view-mode-map (kbd "r") 'mu4e-compose-reply)
(define-key mu4e-headers-mode-map (kbd "f") 'mu4e-compose-forward)
(define-key mu4e-headers-mode-map (kbd "C-k") 'mu4e-headers-mark-for-trash)
;; Send mail
(setq message-send-mail-function 'smtpmail-send-it
smtpmail-servers-requiring-authorization ".*"
smtpmail-smtp-server "127.0.0.1")
#+end_src
** org-mode
*** Require
Require the ~org~ package; I also occasionally use org-pomodoro

@ -0,0 +1 @@
Subproject commit 392a8c11ab27b625d9f863cdde14e09893401b15

@ -0,0 +1 @@
Subproject commit 1ae97371b207dabfecaf6b4f7118abafe6cc5e2b
Loading…
Cancel
Save