aboutsummaryrefslogtreecommitdiffstats
path: root/emacs
diff options
context:
space:
mode:
authorGravatar Tom Willemse2018-08-14 11:35:41 -0700
committerGravatar Tom Willemse2018-08-14 11:40:24 -0700
commit539e0766d66017ebf04926849187fd0d13177a64 (patch)
treeb063c62c66388251b7408e9d035bd02c49f671da /emacs
parent51b7d8e47f7dfae10994d190682899b5f59061a0 (diff)
downloadnew-dotfiles-539e0766d66017ebf04926849187fd0d13177a64.tar.gz
new-dotfiles-539e0766d66017ebf04926849187fd0d13177a64.zip
Fix gtd file locations for Windows
Diffstat (limited to 'emacs')
-rw-r--r--emacs/.emacs.d/init/oni-org-init.el34
1 files changed, 24 insertions, 10 deletions
diff --git a/emacs/.emacs.d/init/oni-org-init.el b/emacs/.emacs.d/init/oni-org-init.el
index 1ad25ca..7b94881 100644
--- a/emacs/.emacs.d/init/oni-org-init.el
+++ b/emacs/.emacs.d/init/oni-org-init.el
@@ -29,6 +29,13 @@
(require 'org-capture)
(require 'org-habit)
+(defun oni-org-init-expand-to-home (file-name)
+ "Expand FILE-NAME to the base directory for that system.
+The base for all org files on Windows is u:/, but on my linux
+installs it will always be ~."
+ (let ((base-dir (if (eq system-type 'windows-nt) "u:/" "~")))
+ (expand-file-name file-name base-dir)))
+
(defun oni-org-init-setup-prettify-symbols-mode ()
"Set up prettify symbols mode for org mode."
(when (member "Ionicons" (font-family-list))
@@ -73,7 +80,8 @@ ones that have a predecessor."
(oni-org-init-heading-has-predecessor-p))
(oni-org-init-next-heading-position))))
-(setq org-default-notes-file "~/documents/gtd/inbox.org")
+(setq org-default-notes-file
+ (oni-org-init-expand-to-home "documents/gtd/inbox.org"))
(setq org-src-fontify-natively t)
(setq org-return-follows-link t)
(setq org-fontify-whole-heading-line t)
@@ -85,20 +93,26 @@ ones that have a predecessor."
(setq org-agenda-skip-function-global #'oni-org-init-skip-tasks)
(setq org-agenda-files
- '("~/documents/gtd/todo.org"
- "~/documents/gtd/projects.org"
- "~/documents/gtd/appointments.org"))
+ (mapcar #'oni-org-init-expand-to-home
+ '("documents/gtd/todo.org"
+ "documents/gtd/projects.org"
+ "documents/gtd/appointments.org")))
(setq org-refile-targets
- '(("~/documents/gtd/todo.org" :maxlevel . 1)
- ("~/documents/gtd/projects.org" :level . 2)
- ("~/documents/gtd/someday.org" :maxlevel . 2)
- ("~/documents/gtd/appointments.org" :maxlevel . 1)))
+ (mapcar (lambda (pair)
+ (cons (oni-org-init-expand-to-home (car pair))
+ (cdr pair)))
+ '(("documents/gtd/todo.org" :maxlevel . 1)
+ ("documents/gtd/projects.org" :level . 2)
+ ("documents/gtd/someday.org" :maxlevel . 2)
+ ("documents/gtd/appointments.org" :maxlevel . 1))))
(setq org-capture-templates
- '(("t" "Note" entry (file "~/documents/gtd/inbox.org")
+ `(("t" "Note" entry
+ (file ,(oni-org-init-expand-to-home "documents/gtd/inbox.org"))
"* TODO %i%?")
- ("a" "Appointment" entry (file "~/documents/gtd/appointments.org")
+ ("a" "Appointment" entry
+ (file ,(oni-org-init-expand-to-home "documents/gtd/appointments.org"))
"* %i%?\n %U")))
(setq org-todo-keywords