summary refs log tree commit diff
diff options
context:
space:
mode:
authorFranck Cuny <franck.cuny@gmail.com>2017-06-16 08:46:03 -0700
committerFranck Cuny <franck.cuny@gmail.com>2017-06-16 08:46:03 -0700
commitb0ea22bc9aeb7ce5fda6a9316f1081ba20c344fa (patch)
tree531a3b2cb3fdd7db713b1ede915ac8028b8617b2
parent[git] stop using aliases (diff)
downloademacs.d-b0ea22bc9aeb7ce5fda6a9316f1081ba20c344fa.tar.gz
[emacs] Add org-mode configuration once again.
Only load some packages if we are using a recent version of Emacs.
-rw-r--r--emacs.d/init.el7
-rw-r--r--emacs.d/lib/org.el48
2 files changed, 53 insertions, 2 deletions
diff --git a/emacs.d/init.el b/emacs.d/init.el
index 440a879..aa020ac 100644
--- a/emacs.d/init.el
+++ b/emacs.d/init.el
@@ -8,7 +8,10 @@
 (load (emacs-lib "settings.el"))
 (load (emacs-lib "funcs.el"))
 (load (emacs-lib "bindings.el"))
-(load (emacs-lib "packages.el"))
-(load (emacs-lib "twitter.el") 'missing-ok)
+
+(when (>= emacs-major-version 24)
+  (load (emacs-lib "packages.el"))
+  (load (emacs-lib "org.el"))
+  (load (emacs-lib "twitter.el") 'missing-ok))
 
 (add-hook 'emacs-startup-hook #'fc/load-time)
diff --git a/emacs.d/lib/org.el b/emacs.d/lib/org.el
new file mode 100644
index 0000000..2c75e7d
--- /dev/null
+++ b/emacs.d/lib/org.el
@@ -0,0 +1,48 @@
+(use-package org
+  :ensure t
+  :mode ("\\.org\\'" . org-mode)
+  :init
+  (org-babel-do-load-languages
+   'org-babel-load-languages
+   (append org-babel-load-languages '((sh . t)
+                                      (python . t))))
+  :config
+  (setq-default org-startup-indent t
+                org-startup-truncated t
+                org-src-tabs-acts-natively t
+                org-src-preserve-indentation t
+                org-todo-keyword-faces '(("TODO" . org-warning)
+                                         ("DOING" . "yellow")
+                                         ("BLOCKED" . "red")
+                                         ("REVIEW" . "orange")
+                                         ("DONE" . "green")
+                                         ("ARCHIVED" . "blue"))
+                org-todo-keywords
+                '((sequence "NEXT(n)" "PLANNING(P)" "INPROGRESS(i)" "WAITING(w)" "|" "DONE(d)")
+                  (sequence "MEETING(m)" "|" "CANCELLED(c)")
+                  (sequence "IDLE(a)"))
+                org-link-abbrev-alist
+                '(("src" . "~/src/%s")
+                  ("jira" . "https://jira.twitter.biz/browse/%s")
+                  ("rb" . "https://reviewboard.twitter.biz/r/%s")
+                  ("d" . "https://phabricator.twitter.biz/d%s")
+                  ("go" . "http://go/%s"))))
+
+(use-package org-agenda
+  :bind (("\C-cA" . org-agenda))
+  :config
+  (progn
+    (setq-default org-agenda-files (file-expand-wildcards "~/Documents/org/*.org")
+                  org-default-notes-file "~/Documents/org/refile.org"
+                  org-directory "~/Documents/org/")))
+
+(use-package org-capture
+  :bind (("\C-cc" . org-capture))
+  :config
+  (progn
+    (setq-default org-refile-targets '(("twitter.org" :maxlevel . 4)
+                                       ("personal.org" :maxlevel . 4))
+                  org-capture-templates '(("t"  "task" entry
+                                           (file "~/Documents/org/refile.org")
+                                           "* TODO %?
+%U")))))