summary refs log tree commit diff
diff options
context:
space:
mode:
authorFranck Cuny <fcuny@twitter.com>2019-04-19 16:37:02 -0700
committerFranck Cuny <fcuny@twitter.com>2019-04-19 16:37:02 -0700
commit7dc7a8557d1274ec5e794df0d20280721cb6b584 (patch)
tree952857a06b8dc5b3e0d9ded140b2e2824059191b
parent[emacs] add a few more packages to work with go. (diff)
downloademacs.d-7dc7a8557d1274ec5e794df0d20280721cb6b584.tar.gz
[emacs] more work on org-mode.
I'm adding a custom view for the agenda, in order to see tasks in
order of priorities (what's urgent, important, etc). This should help
me to focus and prioritize work correctly.

I've also added some comments, and used the `org-directory` variable
to build all the paths.
-rw-r--r--emacs.d/custom/fcuny-org.el126
1 files changed, 101 insertions, 25 deletions
diff --git a/emacs.d/custom/fcuny-org.el b/emacs.d/custom/fcuny-org.el
index fd7dc0c..1ca1880 100644
--- a/emacs.d/custom/fcuny-org.el
+++ b/emacs.d/custom/fcuny-org.el
@@ -1,45 +1,121 @@
 (use-package org
   :ensure t
+
   :hook ((org-mode . visual-line-mode)
          (org-mode . org-indent-mode))
+
   :bind (("C-c c" . org-capture)
          ("C-c a" . org-agenda))
+
   :custom
+  ;; priorities. I use:
+  ;; -1 important + urgent
+  ;; -2 important + non-urgent
+  ;; -3 non-important + urgent
+  ;; -4 non-important + non-urgent
+  (org-highest-priority ?1)
+  (org-default-priority ?4)
+  (org-lowest-priority ?4)
+
   (org-startup-indented t)
-  (org-directory "~/Documents/notebooks")
+  (org-directory (expand-file-name "~/Documents/notebooks"))
   (org-default-notes-file (concat org-directory "/inbox.org"))
   (org-agenda-start-on-weekday 1)
   (org-tags-column -120)
+
+  ;; I want to follow links on RET
+  (org-return-follows-link t)
+  (org-blank-before-new-entry (quote ((heading . t)
+				      (plain-list-item . nil))))
+
+  ;; A few abbreviations I use regularly
   (org-link-abbrev-alist
    '(("src"  . "~/workspace/%s")
      ("jira" . "https://jira.twitter.biz/browse/%s")
      ("ph"   . "https://phabricator.twitter.biz/%s")
      ("go"   . "http://go/%s")))
+
+  ;; The sequence I want to use to navigate tasks
   (org-todo-keywoards
-   '((sequence "TODO(t)" "WAIT(w@/!)" "|" "Done(d!)" "Cancelled(c@)" "Someday(s)")))
+   '((sequence "TODO(t)" "NEXT(n)" "STARTED(s)" "|" "DONE(d!)" "CANCELED(c@/!)")
+     (sequence "WAITING(w@/!)" "SOMEDAY(s)" "|" "CANCELED(c@/!)")
+     (sequence "IDEA(i)" "|" "CANCELED(c@/!)")))
+  (org-todo-state-tags-triggers '(("CANCELLED" ("CANCELED" . t))
+                                  ("WAITING" ("WAITING" . t))
+                                  (done ("WAITING"))
+                                  ("TODO" ("WAITING") ("CANCELED"))
+                                  ("NEXT" ("WAITING") ("CANCELED"))
+                                  ("DONE" ("WAITING") ("CANCELED"))))
+
+  (org-enforce-todo-dependencies t)
+
+  ;; list of files to use for the agenda
+  (org-agenda-files (list (expand-file-name "personal/tasks.org" org-directory)
+                          (expand-file-name "personal/projects.org" org-directory)
+                          (expand-file-name "twitter/tasks.org" org-directory)
+                          (expand-file-name "twitter/projects.org" org-directory)
+                          (expand-file-name "twitter/people.org" org-directory)
+                          (expand-file-name "twitter/meetings.org" org-directory)))
+
+  ;; for the agenda, I want to see tasks in order of priorities.
+  (org-agenda-custom-commands
+   '(("c" "Agenda by priorities"
+      ((tags-todo "PRIORITY=\"1\""
+                  ((org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done))
+                   (org-agenda-overriding-header "important and urgent:")))
+       (tags-todo "PRIORITY=\"2\""
+                  ((org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done))
+                   (org-agenda-overriding-header "important and non-urgent:")))
+       (tags-todo "PRIORITY=\"3\""
+                  ((org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done))
+                   (org-agenda-overriding-header "non-important and urgent:")))
+       (agenda "" ((org-agenda-ndays 1)))
+       (alltodo "" ((org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done)))))
+      ((org-agenda-compact-blocks t)))))
+
   (org-capture-templates
-   (quote (("b" "Bookmark" entry
-            (file+headline "~/Documents/notebooks/notes.org" "Bookmark")
-            "* TODO %?\n%i\n:PROPERTIES:\n:CREATED: %U\n:END:\n")
-           ("r" "Reference" entry
-            (file+headline "~/Documents/notebooks/notes.org" "Reference")
-            "* %?\n%i\n:PROPERTIES:\n:CREATED: %U\n:END:\n")
-           ("e" "Event" entry
-            (file+headline "~/Documents/notebooks/notes.org" "Event")
-            "* %?\n:PROPERTIES:\n:CREATED: %U\n:END:\n")
-           ("t" "Todo" entry
-            (file+headline "~/Documents/notebooks/personal/todo.org" "New")
-            "* TODO %?\n")
-           ("T" "Work Todo" entry
-            (file+headline "~/Documents/notebooks/twitter/todo.org" "New")
-            "* TODO %?\n")
-           ("d" "Diary" entry
-            (file+olp+datetree "~/Documents/notebooks/personal/diary.org")
-            "* %U %?\n" :tree-type week)
-           ("D" "Work Diary" entry
-            (file+olp+datetree "~/Documents/notebooks/twitter/diary.org")
-            "* %U %?\n" :tree-type week)
-           ("I" "inbox, refile later" entry (file "~/Documents/notebooks/inbox.org")
-	   "\n* %?\n:PROPERTIES:\n:CREATED: %U\n:END:\n")))))
+   `(;; templates for general references, links, etc. They can be relevant for both work and personal learning.
+     ("b" "Bookmark" entry
+      (file+headline ,(concat org-directory "/notes.org") "Bookmark")
+      "* TODO %^{LINK}\n%?\n:PROPERTIES:\n:CREATED: %U\n:END:\n"
+      :empty-lines 1)
+     ("r" "Reference" entry
+      (file+headline ,(concat org-directory "/notes.org") "Reference")
+      "* %^{TITLE}\n%?\n:PROPERTIES:\n:CREATED: %U\n:END:\n"
+      :empty-lines 1)
+     ("e" "Event" entry
+      (file+headline ,(concat org-directory "/notes.org") "Event")
+      "* %^{EVENT}\n%?\n:PROPERTIES:\n:CREATED: %U\n:END:\n"
+      :empty-lines 1)
+
+     ;; templates for personal things only.
+     ("t" "Personal Todo" entry
+      (file+headline ,(concat org-directory "/personal/tasks.org") "New")
+      "* TODO %?\n"
+      :empty-lines 1)
+     ("d" "Personal Journal" entry
+      (file+olp+datetree ,(concat org-directory "/personal/journal.org"))
+      "* %U %?\n"
+      :empty-lines 1)
+
+     ;; templates for work related things only.
+     ("T" "Work Todo" entry
+      (file+headline ,(concat org-directory "/twitter/tasks.org") "New")
+      "* TODO %?\n"
+      :empty-lines 1)
+     ("D" "Work Journal" entry
+      (file+olp+datetree ,(concat org-directory "/twitter/journal.org"))
+      "* %U %?\n"
+      :empty-lines 1)
+     ("M" "Meeting" entry
+      (file+olp+datetree ,(concat org-directory "/twitter/meetings.org"))
+      "* %U %^{TITLE}\n%?\n"
+      :empty-lines 1)
+
+     ;; refile!
+     ("I" "Inbox, refile later" entry
+      (file ,(concat org-directory "/inbox.org"))
+      "\n* %?\n:PROPERTIES:\n:CREATED: %U\n:END:\n"
+      :empty-lines 1))))
 
 (provide 'fcuny-org)