.emacs.d/ag-org.el
author Adam Gomaa <adam@gomaa.us>
Sun Dec 18 13:13:02 2011 -0500
changeset 521 67f37d330ad0
parent 365 24da8b656d69
permissions -rw-r--r--
Remove project & _list_projects, I don't use them anymore.
     1 ;; Based on http://doc.norang.ca/org-mode.html
     2 
     3 (require 'org-install)
     4 
     5 (add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\)$" . org-mode))
     6 
     7 ;; Make TAB the yas trigger key in the org-mode-hook and turn on flyspell mode
     8 (add-hook 'org-mode-hook
     9           (lambda ()
    10             ;; yasnippet
    11             (make-variable-buffer-local 'yas/trigger-key)
    12             (setq yas/trigger-key [tab])
    13             (define-key yas/keymap [tab] 'yas/next-field-group)
    14             ;; flyspell mode to spell check everywhere
    15             (flyspell-mode 1)))
    16 
    17 (global-set-key "\C-cl" 'org-store-link)
    18 (global-set-key "\C-ca" 'org-agenda)
    19 (global-set-key "\C-cb" 'org-iswitchb)
    20 
    21 (setq org-agenda-files (quote ("~/var/org/refile.org" "~/var/org/todo.org"
    22                                "~/var/org/courtside.org")))
    23 
    24 
    25 (setq org-todo-keywords (quote ((sequence "TODO(t)" "STARTED(s!)" "DELEGATED(D!)"  "|" "DONE(d!/!)")
    26  (sequence "SOMEDAY(S!)" "OPEN(O@)" "|" "CANCELLED(c@/!)" )
    27  )))
    28 
    29 (setq org-todo-keyword-faces (quote (("TODO" :foreground "red" :weight bold)
    30  ("STARTED" :foreground "blue" :weight bold)
    31  ("DONE" :foreground "forest green" :weight bold)
    32  ("WAITING" :foreground "orange" :weight bold)
    33  ("SOMEDAY" :foreground "magenta" :weight bold)
    34  ("CANCELLED" :foreground "forest green" :weight bold)
    35  ("QUOTE" :foreground "red" :weight bold)
    36  ("QUOTED" :foreground "magenta" :weight bold)
    37  ("APPROVED" :foreground "forest green" :weight bold)
    38  ("EXPIRED" :foreground "forest green" :weight bold)
    39  ("REJECTED" :foreground "forest green" :weight bold)
    40  ("DELEGATED" :foreground "orange" :weight bold)
    41  ("OPEN" :foreground "blue" :weight bold))))
    42 
    43 (setq org-use-fast-todo-selection t)
    44 
    45 (setq org-todo-state-tags-triggers
    46       (quote (("CANCELLED" ("CANCELLED" . t))
    47               ("WAITING" ("WAITING" . t) ("NEXT"))
    48               ("SOMEDAY" ("WAITING" . t))
    49               (done ("NEXT") ("WAITING"))
    50               ("TODO" ("WAITING") ("CANCELLED") ("NEXT"))
    51               ("DONE" ("WAITING") ("CANCELLED") ("NEXT")))))
    52 
    53 
    54 (setq org-clock-in-switch-to-state "STARTED")
    55 
    56 (setq org-default-notes-file "~/var/org/refile.org")
    57 
    58 ;;;  Load Org Remember Stuff
    59 (require 'remember)
    60 (org-remember-insinuate)
    61 
    62 ;; Start clock if a remember buffer includes :CLOCK-IN:
    63 (add-hook 'remember-mode-hook 'bh/start-clock-if-needed 'append)
    64 
    65 (defun bh/start-clock-if-needed ()
    66   (save-excursion
    67     (goto-char (point-min))
    68     (when (re-search-forward " *:CLOCK-IN: *" nil t)
    69       (replace-match "")
    70       (org-clock-in))))
    71 
    72 ;; I use C-M-r to start org-remember
    73 (global-set-key (kbd "C-M-r") 'org-remember)
    74 
    75 ;; Keep clocks running
    76 (setq org-remember-clock-out-on-exit nil)
    77 
    78 ;; C-c C-c stores the note immediately
    79 (setq org-remember-store-without-prompt t)
    80 (setq org-log-done t)
    81 
    82 ;; I don't use this -- but set it in case I forget to specify a location in a future template
    83 (setq org-remember-default-headline "Tasks")
    84 
    85 ;; 3 remember templates for TODO tasks, Notes, and Phone calls
    86 (setq org-remember-templates (quote (("todo" ?t "* TODO %?\n  %u\n  %a" nil bottom nil)
    87                                      ("note" ?n "* %?                                        :NOTE:\n  %u\n  %a" nil bottom nil)
    88                                      ("phone" ?p "* PHONE %:name - %:company -                :PHONE:\n  Contact Info: %a\n  %u\n  :CLOCK-IN:\n  %?" nil bottom nil)
    89                                      ("appointment" ?a "* %?\n  %U" "~/var/org/todo.org" "Appointments" nil)
    90                                      ("org-protocol" ?w "* TODO Review %c%!  :NEXT:\n  %U\n  :PROPERTIES:\n  :Effort: 0:10\n  :END:" nil bottom nil))))
    91 
    92 
    93 (provide 'ag-org)