#+TITLE: Emacs Org-mode Configuration
#+property: header-args :tangle ~/.emacs.d/modules/org.el

* Core Org Setup
#+begin_src elisp
  (use-package org
    :config
    (defvar org-outline-path-complete-in-steps nil)
    :bind (("C-c l" . org-store-link)
  	 ("C-c a" . org-agenda)
  	 ("C-c c" . org-capture)
  	 :map org-mode-map)
    )
  (defvar org-directory (concat (getenv "HOME") "/org/"))
#+end_src

* Agenda
#+begin_src elisp
   (setq org-deadline-warning-days 7)
   (setq org-agenda-skip-additional-timestamps-same-entry t)
   (setq org-agenda-span 'fortnight)
   (setq org-agenda-tags-column 'auto)
   (setq org-agenda-skip-scheduled-if-deadline-is-shown t)
   (setq org-agenda-files (list
  			(concat org-directory "/0_inbox/inbox.org")
  			(concat org-directory "/0_inbox/org-gtd-tasks.org")
  			)
        )
#+end_src

* Capture and Protocol
#+begin_src elisp
  (require 'org-protocol)
  (setq org-protocol-default-buffer-for-file-links "*scratch*")
  (defvar org-default-notes-file (concat org-directory "/0_inbox/inbox.org"))
  (setq org-protocol-default-template-key "L")
#+end_src

#+begin_src elisp :tangle ~/.emacs.d/custom.el
  (defvar org-capture-templates '(
                                ("p" "Protocol"
                                 entry
                                 (file "0_inbox/inbox.org")
                                 "* %^{Title}\nSource: %u, %c\n #+BEGIN_QUOTE\n%i\n#+END_QUOTE\n\n\n%?"
                                 )
                                ("L" "Protocol Link"
                                 entry
                                 (file "0_inbox/inbox.org")
                                 "* %? [[%:link][%:description]]\n:PROPERTIES:\n:TITLE: %:description\n:URI: %:link\n:CREATED: %U\n:END:"
                                 :prepend nil
                                 :empty-lines 1
                                 :created t
                                 :kill-buffer t
                                 )
                                )
        )
#+end_src

* TODO Settings
#+begin_src elisp
  (setq org-todo-keywords
          '(
            (sequence "TODO(t)" "NEXT(n)" "|" "DONE(d!)")
            (sequence "WAIT(w@/!)" "|" "CNCL(c@)")
            )
          )
  (setq org-enforce-todo-dependencies t)
  (setq org-log-into-drawer "LOGBOOK")
#+end_src
