diff --git a/global.org b/global.org index b853a40..bb8827c 100644 --- a/global.org +++ b/global.org @@ -958,61 +958,82 @@ :key ?i)) #+end_src - Customize ~mu4e~ context - #+begin_src emacs-lisp - - (setq mu4e-contexts - `( ,(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 - :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 . 587 ) - ( mu4e-compose-signature . (concat - "Jacopo De Simoi (he · him)\n" - "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 'pick-first) - - - (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))) - (add-hook 'mu4e-compose-mode-hook - #'(lambda () - (auto-fill-mode -1) - (visual-line-mode) - ;; flyspell does not want to work with buffers that - ;; start with a "*", but this includes compose buffers - ;; (that are called *draft*) - (let ((flyspell-lazy-disallow-buffers nil)) - (flyspell-mode)))) - - (define-key-alist message-mode-map - '(("M-\"" . (lambda (r-begin r-end) - (interactive "r") - (add-delimiter "“" "”" r-begin r-end))))) + Customize ~mu4e~ contexts + #+begin_src emacs-lisp + (setq mu4e-contexts + `( ,(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 + :match-func (lambda (msg) + (when msg + (string-match-p "^/math/INBOX" (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 . 587 ) + ( mu4e-compose-signature . (concat + "Jacopo De Simoi (he · him)\n" + "Professor · U Toronto\n")))) + + ,(make-mu4e-context + :name "CMP Editor" + :enter-func (lambda () (mu4e-message "Switch to the CMP Editor context")) + :leave-func (lambda () (mu4e-message "Leave the CMP Editor context")) + ;; we match based on the maildir of the message + :match-func (lambda (msg) + (when msg + (string-match-p "^/math/editorial.CMP" (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/editorial.CMP.Archive") + ( smtpmail-stream-type . starttls ) + ( smtpmail-smtp-service . 587 ) + ( mu4e-compose-signature . (concat + "Jacopo De Simoi (he · him)\n" + "Associate Editor for CMP\n" + "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 'pick-first) + + + (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))) + (add-hook 'mu4e-compose-mode-hook + #'(lambda () + (auto-fill-mode -1) + (visual-line-mode) + ;; flyspell does not want to work with buffers that + ;; start with a "*", but this includes compose buffers + ;; (that are called *draft*) + (let ((flyspell-lazy-disallow-buffers nil)) + (flyspell-mode)))) + + (define-key-alist message-mode-map + '(("M-\"" . (lambda (r-begin r-end) + (interactive "r") + (add-delimiter "“" "”" r-begin r-end))))) #+end_src