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