Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

migrating to mu4e instead of mutt for daily use

  • Loading branch information...
commit 62ea259de52d367873a1ed6a88bc6b80361823ac 1 parent ebd5dae
@dlobraico authored
View
5 emacs.d/config/my-evil.el
@@ -82,8 +82,9 @@
(define-key evil-normal-state-map ",k" 'kill-this-buffer)
(define-key evil-normal-state-map ",K" 'kill-buffer-and-window)
-(define-key evil-normal-state-map ",n" 'split-window-horizontally)
-(define-key evil-normal-state-map ",m" 'split-window-vertically)
+;;(define-key evil-normal-state-map ",n" 'split-window-horizontally)
+;;(define-key evil-normal-state-map ",m" 'split-window-vertically)
+(define-key evil-normal-state-map ",m" 'mu4e)
(define-key evil-normal-state-map ",d" 'delete-window)
(define-key evil-normal-state-map ",N" 'make-frame-command)
View
60 emacs.d/config/my-mu4e.el
@@ -36,7 +36,7 @@
"RET" 'mu4e-view-message)
))
-(setq user-full-name "Dominick LoBraico"
+(setq user-full-name "D. LoBraico"
user-mail-address "d@lobraico.com"
mail-reply-to user-mail-address
mu4e-user-mail-address-list '("d@lobraico.com"
@@ -54,9 +54,10 @@
mu4e-view-image-max-width 800
mu4e-html2text-command "pandoc -f html -t markdown"
- mu4e-maildir-shortcuts '(("/personal/archive" . ?a)
- ("/personal/INBOX" . ?i)
- ("/personal/sent" . ?s))
+ mu4e-maildir-shortcuts '(("/personal/INBOX" . ?p)
+ ("/school/INBOX" . ?s)
+ ("/csd/INBOX" . ?c)
+ ("/tds/INBOX" . ?d))
mu4e-get-mail-command "offlineimap"
mu4e-headers-fields '((:date . 25)
@@ -68,6 +69,37 @@
sendmail-program "/usr/local/bin/msmtp"
user-full-name "Dominick LoBraico")
+(defvar my-mu4e-account-alist
+ '(("personal"
+ (user-full-name "D. LoBraico")
+ (user-mail-address "d@lobraico.com")
+ (mu4e-sent-folder "/personal/sent")
+ (mu4e-drafts-folder "/personal/drafts")
+ (mu4e-trash-folder "/personal/trash")
+ (mu4e-refile-folder "/personal/archive"))
+ ("school"
+ (user-full-name "Dominick LoBraico")
+ (user-mail-address "dlobraico@uchicago.edu")
+ (mu4e-sent-folder "/school/sent")
+ (mu4e-drafts-folder "/school/drafts")
+ (mu4e-trash-folder "/school/trash")
+ (mu4e-refile-folder "/school/archive"))
+ ("csd"
+ (user-full-name "Chicago Shady Dealer")
+ (user-mail-address "editor@chicagoshadydealer.com")
+ (mu4e-sent-folder "/csd/sent")
+ (mu4e-drafts-folder "/csd/drafts")
+ (mu4e-trash-folder "/csd/trash")
+ (mu4e-refile-folder "/csd/archive"))
+ ("tds"
+ (user-full-name "DJ LoBraico")
+ (user-mail-address "dj@dailysophist.com")
+ (mu4e-sent-folder "/tds/sent")
+ (mu4e-drafts-folder "/tds/drafts")
+ (mu4e-trash-folder "/tds/trash")
+ (mu4e-refile-folder "/tds/archive"))
+ ))
+
;; Borrowed from http://ionrock.org/emacs-email-and-mu.html Choose
;; account label to feed msmtp -a option based on From header in
;; Message buffer; This function must be added to
@@ -93,6 +125,26 @@
(setq message-sendmail-envelope-from 'header)
(add-hook 'message-send-mail-hook 'choose-msmtp-account)
+(defun my-mu4e-set-account ()
+ "Set the account for composing a new message."
+ (let* ((account
+ (if mu4e-compose-parent-message
+ (let ((maildir (mu4e-message-field mu4e-compose-parent-message :maildir)))
+ (string-match "/\\(.*?\\)/" maildir)
+ (match-string 1 maildir))
+ (completing-read (format "Compose with account: (%s) "
+ (mapconcat #'(lambda (var) (car var)) my-mu4e-account-alist "/"))
+ (mapcar #'(lambda (var) (car var)) my-mu4e-account-alist)
+ nil t nil nil (caar my-mu4e-account-alist))))
+ (account-vars (cdr (assoc account my-mu4e-account-alist))))
+ (if account-vars
+ (mapc #'(lambda (var)
+ (set (car var) (cadr var)))
+ account-vars)
+ (error "No email account found"))))
+
+(add-hook 'mu4e-compose-pre-hook 'my-mu4e-set-account)
+
;; Gmail takes care of this for us.
(setq mu4e-sent-messages-behavior 'delete)
View
34 emacs.d/config/my-org.el
@@ -70,6 +70,30 @@
(kbd "M-K") 'org-shiftmetaup
(kbd "M-J") 'org-shiftmetadown)
+
+;; display the diary in org-agenda and make importing from Apple Calendar easy
+(setq diary-file "~/Documents/notes/diary")
+(setq org-agenda-include-diary t)
+(setq org-agenda-custom-commands
+ '(("I" "Import diary from iCal" agenda ""
+ ((org-agenda-mode-hook
+ (lambda ()
+ (org-mac-iCal)))))))
+
+(add-hook 'org-agenda-cleanup-fancy-diary-hook
+ (lambda ()
+ (goto-char (point-min))
+ (save-excursion
+ (while (re-search-forward "^[a-z]" nil t)
+ (goto-char (match-beginning 0))
+ (insert "0:00-24:00 ")))
+ (while (re-search-forward "^ [a-z]" nil t)
+ (goto-char (match-beginning 0))
+ (save-excursion
+ (re-search-backward "^[0-9]+:[0-9]+-[0-9]+:[0-9]+ " nil t))
+ (insert (match-string 0)))))
+
+
(add-hook 'org-agenda-mode-hook
(lambda ()
(define-key org-agenda-mode-map "j" 'evil-next-line)
@@ -77,11 +101,21 @@
(define-key evil-normal-state-map (kbd ",c") 'org-capture)
+(require 'org-mac-link-grabber)
+(add-hook 'org-mode-hook (lambda ()
+ (define-key org-mode-map (kbd "C-c g") 'omlg-grab-link)))
+
+
(require 'org)
+
(org-add-link-type "wiki" 'org-wiki-open)
(add-hook 'org-store-link-functions 'org-wiki-store-link)
(defun org-wiki-open (title)
"Visit the Wikipedia article at TITLE."
(browse-url (concat "http://en.wikipedia.org/wiki/Special:Search/" title)))
+(when *is-a-mac*
+ (add-to-list 'org-modules 'org-mac-iCal))
+
+
(provide 'my-org)
View
8 emacs.d/config/my-osx.el
@@ -12,8 +12,16 @@
(setq mac-option-modifier 'alt)
(setq mac-right-option-modifier 'super)
+(setq default-input-method "MacOSX")
+
;; Set the rbenv path (this might need to be moved out of the osx specific elisp at some point)
(setenv "PATH" (concat (getenv "HOME") "/.rbenv/shims:" (getenv "HOME") "/.rbenv/bin:" (getenv "PATH")))
(setq exec-path (cons (concat (getenv "HOME") "/.rbenv/shims") (cons (concat (getenv "HOME") "/.rbenv/bin") exec-path)))
+(when *is-cocoa-emacs*
+ (global-set-key (kbd "M-`") 'ns-next-frame)
+ (global-set-key (kbd "M-h") 'ns-do-hide-emacs)
+ (global-set-key (kbd "M-c") 'ns-copy-including-secondary)
+ (global-set-key (kbd "M-v") 'ns-paste-secondary))
+
(provide 'my-osx)
View
3  emacs.d/config/my-packages.el
@@ -53,6 +53,9 @@
multiple-cursors
nrepl
nxml-mode
+ org-mac-link-grabber
+ org-mac-iCal
+ osx-location
paredit
php-mode
powerline
View
4 emacs.d/config/my-ui.el
@@ -69,7 +69,9 @@
;;(setq pop-up-frames 'graphic-only)
(require 'powerline)
-(load-theme 'solarized-light t)
+
+;; (load-theme 'solarized-light t)
+(load-theme 'sanityinc-tomorrow-eighties t)
;; fix powerline colors for solarized
(setq powerline-color1 "#657b83")
View
5 emacs.d/init.el
@@ -4,6 +4,9 @@
;; Move these somewhere else
(server-start)
+(defconst *is-a-mac* (eq system-type 'darwin))
+(defconst *is-cocoa-emacs* (and *is-a-mac* (eq window-system 'ns)))
+
(defvar my-dir (file-name-directory load-file-name)
"The root dir of my Emacs configuration.")
(defvar my-modules-dir (concat my-dir "config/")
@@ -45,7 +48,7 @@ ELPA (or MELPA).")
(require 'my-mode-hooks)
(require 'my-global-keybindings)
-(when (eq system-type 'darwin)
+(when *is-a-mac*
(require 'my-osx))
(setq custom-file (concat my-modules-dir "custom.el"))
View
4 muttrc
@@ -136,8 +136,8 @@ macro pager s "<pipe-message>cat > ~/" "save message as"
# Compose view options
set envelope_from # which from?
set sig_dashes # dashes before sig
-set edit_headers # show headers when composing
-#unset edit_headers # DON'T show headers when composing
+#set edit_headers # show headers when composing
+unset edit_headers # DON'T show headers when composing
set fast_reply # skip to compose when replying
set askbcc # ask for BCC:
set askcc # ask for CC:
View
148 offlineimaprc
@@ -2,158 +2,132 @@
metadata = ~/.offlineimap
accounts = personal, school, csd, tds
maxsyncaccounts = 4
-status_backend = sqlite
ui = ttyui
pythonfile=~/.mutt/bin/offlineimap.py
fsync = False
-#[mbnames]
-#enabled = yes
-#filename = ~/Mail/muttrc.mailboxes
-#header = "mailboxes "
-#peritem = "+%(accountname)s/%(foldername)s"
-#sep = " "
-#footer = "\n"
-
-#### Personal Google Apps - d@lobraico.com
[Account personal]
localrepository = local_personal
remoterepository = remote_personal
+synclabels = yes
+labelsheader = X-Keywords
+filterheaders = X-Keywords
+ignorelabels = \Important, \Draft
+status_backend = sqlite
+
[Repository local_personal]
-type = Maildir
+type = GmailMaildir
localfolders = ~/Mail/personal
+nametrans = lambda folder: {'drafts': '[Gmail]/Drafts', 'archive': '[Gmail]/All Mail'}.get(folder, folder)
+folderfilter = lambda folder: folder in ['drafts', 'archive']
restoreatime = no
-nametrans = lambda folder: {'drafts': '[Gmail]/Drafts',
- 'sent': '[Gmail]/Sent Mail',
- 'flagged': '[Gmail]/Starred',
- 'trash': '[Gmail]/Trash',
- 'archive': '[Gmail]/All Mail',
- }.get(folder, folder)
-folderfilter = lambda folder: folder not in ['trash']
[Repository remote_personal]
type = Gmail
remotehost = imap.gmail.com
remoteuser = d@lobraico.com
remotepasseval = get_keychain_pass(account="d@lobraico.com", server="imap.gmail.com")
-realdelete = no
+
ssl = yes
-# FIXME use sslcacertfile instead
cert_fingerprint = 6d1b5b5ee0180ab493b71d3b94534b5ab937d042
maxconnections = 3
-nametrans = lambda folder: {'[Gmail]/Drafts': 'drafts',
- '[Gmail]/Sent Mail': 'sent',
- '[Gmail]/Starred': 'flagged',
- '[Gmail]/Trash': 'trash',
- '[Gmail]/All Mail': 'archive',
- }.get(folder, folder)
-folderfilter = lambda folder: folder not in ['[Gmail]/Trash']
-#### End - d@lobraico.com
-
-#### School - dlobraico@uchicago.edu
+realdelete = no
+
+nametrans = lambda folder: {'[Gmail]/Drafts': 'drafts', '[Gmail]/All Mail': 'archive'}.get(folder, folder)
+folderfilter = lambda folder: folder in ['[Gmail]/Drafts', '[Gmail]/All Mail']
+
[Account school]
localrepository = local_school
remoterepository = remote_school
+synclabels = yes
+labelsheader = X-Keywords
+filterheaders = X-Keywords
+ignorelabels = \Important, \Draft
+status_backend = sqlite
+
[Repository local_school]
-type = Maildir
+type = GmailMaildir
localfolders = ~/Mail/school
+nametrans = lambda folder: {'drafts': '[Gmail]/Drafts', 'archive': '[Gmail]/All Mail'}.get(folder, folder)
+folderfilter = lambda folder: folder in ['drafts', 'archive']
restoreatime = no
-nametrans = lambda folder: {'drafts': '[Gmail]/Drafts',
- 'sent': '[Gmail]/Sent Mail',
- 'flagged': '[Gmail]/Starred',
- 'trash': '[Gmail]/Trash',
- 'archive': '[Gmail]/All Mail',
- }.get(folder, folder)
-folderfilter = lambda folder: folder not in ['trash']
[Repository remote_school]
type = Gmail
remotehost = imap.gmail.com
remoteuser = dlobraico@uchicago.edu
remotepasseval = get_keychain_pass(account="dlobraico@uchicago.edu", server="imap.gmail.com")
-realdelete = no
+
ssl = yes
cert_fingerprint = 6d1b5b5ee0180ab493b71d3b94534b5ab937d042
maxconnections = 3
-nametrans = lambda folder: {'[Gmail]/Drafts': 'drafts',
- '[Gmail]/Sent Mail': 'sent',
- '[Gmail]/Starred': 'flagged',
- '[Gmail]/Trash': 'trash',
- '[Gmail]/All Mail': 'archive',
- }.get(folder, folder)
-folderfilter = lambda folder: folder not in ['[Gmail]/Trash']
-#### End - dlobraico@uchicago.edu
-
-#### Chicago Shady Dealer Google Apps - editor@chicagoshadydealer.com
+realdelete = no
+
+nametrans = lambda folder: {'[Gmail]/Drafts': 'drafts', '[Gmail]/All Mail': 'archive'}.get(folder, folder)
+folderfilter = lambda folder: folder in ['[Gmail]/Drafts', '[Gmail]/All Mail']
+
[Account csd]
localrepository = local_csd
remoterepository = remote_csd
+synclabels = yes
+labelsheader = X-Keywords
+filterheaders = X-Keywords
+ignorelabels = \Important, \Draft
+status_backend = sqlite
+
[Repository local_csd]
-type = Maildir
+type = GmailMaildir
localfolders = ~/Mail/csd
+nametrans = lambda folder: {'drafts': '[Gmail]/Drafts', 'archive': '[Gmail]/All Mail'}.get(folder, folder)
+folderfilter = lambda folder: folder in ['drafts', 'archive']
restoreatime = no
-nametrans = lambda folder: {'drafts': '[Gmail]/Drafts',
- 'sent': '[Gmail]/Sent Mail',
- 'flagged': '[Gmail]/Starred',
- 'trash': '[Gmail]/Trash',
- 'archive': '[Gmail]/All Mail',
- }.get(folder, folder)
-folderfilter = lambda folder: folder not in ['trash']
[Repository remote_csd]
type = Gmail
remotehost = imap.gmail.com
remoteuser = editor@chicagoshadydealer.com
remotepasseval = get_keychain_pass(account="editor@chicagoshadydealer.com", server="imap.gmail.com")
-realdelete = no
+
ssl = yes
-# FIXME use sslcacertfile instead
cert_fingerprint = 6d1b5b5ee0180ab493b71d3b94534b5ab937d042
maxconnections = 3
-nametrans = lambda folder: {'[Gmail]/Drafts': 'drafts',
- '[Gmail]/Sent Mail': 'sent',
- '[Gmail]/Starred': 'flagged',
- '[Gmail]/Trash': 'trash',
- '[Gmail]/All Mail': 'archive',
- }.get(folder, folder)
-folderfilter = lambda folder: folder not in ['[Gmail]/Trash']
-#### End - editor@chicagoshadydealer.com
-
-#### Daily Sophist Google Apps - editor@chicagoshadydealer.com
+realdelete = no
+maxconnections = 3
+realdelete = no
+
+nametrans = lambda folder: {'[Gmail]/Drafts': 'drafts', '[Gmail]/All Mail': 'archive'}.get(folder, folder)
+folderfilter = lambda folder: folder in ['[Gmail]/Drafts', '[Gmail]/All Mail']
+
[Account tds]
localrepository = local_tds
remoterepository = remote_tds
+synclabels = yes
+labelsheader = X-Keywords
+filterheaders = X-Keywords
+ignorelabels = \Important, \Draft
+status_backend = sqlite
+
[Repository local_tds]
-type = Maildir
+type = GmailMaildir
localfolders = ~/Mail/tds
+nametrans = lambda folder: {'drafts': '[Gmail]/Drafts', 'archive': '[Gmail]/All Mail'}.get(folder, folder)
+folderfilter = lambda folder: folder in ['drafts', 'archive']
restoreatime = no
-nametrans = lambda folder: {'drafts': '[Gmail]/Drafts',
- 'sent': '[Gmail]/Sent Mail',
- 'flagged': '[Gmail]/Starred',
- 'trash': '[Gmail]/Trash',
- 'archive': '[Gmail]/All Mail',
- }.get(folder, folder)
-folderfilter = lambda folder: folder not in ['trash']
[Repository remote_tds]
type = Gmail
remotehost = imap.gmail.com
remoteuser = dj@dailysophist.com
remotepasseval = get_keychain_pass(account="dj@dailysophist.com", server="imap.gmail.com")
-realdelete = no
+
ssl = yes
-# FIXME use sslcacertfile instead
cert_fingerprint = 6d1b5b5ee0180ab493b71d3b94534b5ab937d042
maxconnections = 3
-nametrans = lambda folder: {'[Gmail]/Drafts': 'drafts',
- '[Gmail]/Sent Mail': 'sent',
- '[Gmail]/Starred': 'flagged',
- '[Gmail]/Trash': 'trash',
- '[Gmail]/All Mail': 'archive',
- }.get(folder, folder)
-folderfilter = lambda folder: folder not in ['[Gmail]/Trash']
-#### End - dj@dailysophist.com
+realdelete = no
+
+nametrans = lambda folder: {'[Gmail]/Drafts': 'drafts', '[Gmail]/All Mail': 'archive'}.get(folder, folder)
+folderfilter = lambda folder: folder in ['[Gmail]/Drafts', '[Gmail]/All Mail']
Please sign in to comment.
Something went wrong with that request. Please try again.