Refactored config into topics

This commit is contained in:
James Patrick 2020-06-01 20:15:08 -04:00
parent 503e393270
commit 39e12f2409
3 changed files with 97 additions and 85 deletions

74
emacs/+mail.el Normal file
View File

@ -0,0 +1,74 @@
;;; init.el -*- lexical-binding: t; -*-
; I use ProtonMail with my domainname via ProtonBridge synced via mbsync to mu.
; This may look weird because of that.
; Add proton bridge cert to trust store when it's present.
; See dotfiles for more info.
(let ((bridgecert (expand-file-name "~/.config/mbsync/transient/bridge.crt")))
(when (file-exists-p bridgecert)
(require 'gnutls)
(add-to-list 'gnutls-trustfiles bridgecert)
)
)
; Setup mail sending and mu4e structure.
(set-email-account! "ProtonMail"
'((mu4e-sent-folder . "/Sent")
(mu4e-drafts-folder . "/Drafts")
(mu4e-trash-folder . "/Trash")
(mu4e-refile-folder . "/All Mail")
(mu4e-update-interval . 300)
(mu4e-change-filenames-when-moving . t)
(user-mail-address . "james@jpatrick.io")
(message-send-mail-function . 'smtpmail-send-it)
(smtpmail-auth-credentials . "~/.authinfo.gpg")
(smtpmail-smtp-service . 1025)
(smtpmail-smtp-server . "127.0.0.1")
(smtpmail-smtp-user . "james@jpatrick.io")
)
t)
; Helper for adding to bookmarks. Probably overkill....
(defcustom mu4e-bookmarks
'(( :name "Unread messages"
:query "flag:unread AND NOT flag:trashed"
:key ?u)
( :name "Today's messages"
:query "date:today..now"
:key ?t)
( :name "Last 7 days"
:query "date:7d..now"
:hide-unread t
:key ?w)
( :name "Messages with images"
:query "mime:image/*"
:key ?p))
"List of pre-defined queries that are shown on the main screen.
Each of the list elements is a plist with at least:
:name - the name of the query
:query - the query expression
:key - the shortcut key.
Optionally, you add the following:
:hide - if t, bookmark is hdden from the main-view and speedbar.
:hide-unread - do not show the counts of unread/total number
of matches for the query. This can be useful if a bookmark uses
a very slow query. :hide-unread is implied from :hide.
"
:type '(repeat (plist))
:group 'mu4e)
(add-to-list 'mu4e-bookmarks
'( :name "Recent Account Msgs"
:query "maildir:/Folders/subscriptions date 7d..now AND flag:unread"
:key ?s)
)
(add-to-list 'mu4e-bookmarks
'( :name "Unread Personal"
:query "maildir:/INBOX date 7d..now AND flag:unread"
:key ?i)
)

19
emacs/+org.el Normal file
View File

@ -0,0 +1,19 @@
;;; init.el -*- lexical-binding: t; -*-
; Org goes in org
(custom-set-variables '(org-directory "~/org/"))
(setq deft-directory org-directory)
;(setq deft-directory "~/org/")
(setq org-download-image-dir "~/org/resources/")
; Enable word wrap
(add-hook 'org-mode-hook #'visual-line-mode)
;Custom bullets
(setq org-superstar-headline-bullets-list '("" "" "" "" "" "" "" "" ""))
;; allow md export
(eval-after-load "org" '(require 'ox-md nil t))
;; org-journal-file-format
(customize-set-variable 'org-journal-date-format "%A, %d %B %Y")

View File

@ -8,93 +8,12 @@
;; Increasing the font size is a working stopgap.
(font-put doom-font :size 15))
)
;; Orgmode
(custom-set-variables '(org-directory "~/org"))
(setq-default org-download-image-dir "~/org/resources/")
;; Enable word wrap
(add-hook 'org-mode-hook #'visual-line-mode)
(setq org-superstar-headline-bullets-list '("" "" "" "" "" "" "" "" ""))
;; allow md export
(eval-after-load "org" '(require 'ox-md nil t))
(setq deft-directory "~/org/")
;; org-journal-file-format
(customize-set-variable 'org-journal-date-format "%A, %d %B %Y")
(setq doom-localleader-key ",")
;; Have projectile automatically check code.
(setq projectile-project-search-path '("~/src/" "~/Code/"))
;(setq projectile-project-search-path '("~/src/" "~/Code/"))
(add-to-list 'projectile-project-search-path "~/src/")
(set-email-account! "ProtonMail"
'((mu4e-sent-folder . "/Sent")
(mu4e-drafts-folder . "/Drafts")
(mu4e-trash-folder . "/Trash")
(mu4e-refile-folder . "/All Mail")
(mu4e-update-interval . 300)
(mu4e-change-filenames-when-moving . t)
(user-mail-address . "james@jpatrick.io")
(message-send-mail-function . 'smtpmail-send-it)
(smtpmail-auth-credentials . "~/.authinfo.gpg")
(smtpmail-smtp-service . 1025)
(smtpmail-smtp-server . "127.0.0.1")
(smtpmail-smtp-user . "james@jpatrick.io")
)
t)
(setq
message-send-mail-function 'smtpmail-send-it
smtpmail-auth-credentials "~/.authinfo.gpg"
smtpmail-smtp-server "127.0.0.1"
smtpmail-smtp-service 1025)
(let ((bridgecert (expand-file-name "~/.config/mbsync/transient/bridge.crt")))
(when (file-exists-p bridgecert)
(add-to-list 'gnutls-trustfiles bridgecert)
)
)
(defcustom mu4e-bookmarks
'(( :name "Unread messages"
:query "flag:unread AND NOT flag:trashed"
:key ?u)
( :name "Today's messages"
:query "date:today..now"
:key ?t)
( :name "Last 7 days"
:query "date:7d..now"
:hide-unread t
:key ?w)
( :name "Messages with images"
:query "mime:image/*"
:key ?p))
"List of pre-defined queries that are shown on the main screen.
Each of the list elements is a plist with at least:
:name - the name of the query
:query - the query expression
:key - the shortcut key.
Optionally, you add the following:
:hide - if t, bookmark is hdden from the main-view and speedbar.
:hide-unread - do not show the counts of unread/total number
of matches for the query. This can be useful if a bookmark uses
a very slow query. :hide-unread is implied from :hide.
"
:type '(repeat (plist))
:group 'mu4e)
(add-to-list 'mu4e-bookmarks
'( :name "Recent Account Msgs"
:query "maildir:/Folders/subscriptions date 7d..now AND flag:unread"
:key ?s)
)
(add-to-list 'mu4e-bookmarks
'( :name "Unread Personal"
:query "maildir:/INBOX date 7d..now AND flag:unread"
:key ?i)
)
(load! "+mail")
(load! "+org")