-(require 'google-weather)
-(require 'org-google-weather)
-(setq-default org-google-weather-format "%i %c, [%l,%h] %s %C")
-
-; org mode agenda files
-(setq org-agenda-files
- (quote ("~/projects/debbugs/debbugs.org"
- "~/projects/notes/notes.org"
- "~/projects/origins_of_life/ool.org"
- "~/projects/sysadmin/sndservers/sndservers.org"
- "~/projects/chaim/chaim.org"
- "~/projects/fh/fh.org")))
-
-(setq org-global-properties '(("Effort_ALL 0 0:10 0:30 1:00 2:00 3:00 4:00 5:00 6:00 7:00")))
-(setq org-columns-default-format "%40ITEM(Task) %TAGS %PRIORITY %TODO %17Effort(Estimated Effort){:} %CLOCKSUM")
-
-(setq org-default-notes-file "~/projects/notes/notes.org")
-(setq org-capture-templates ;; mail-specific note template, identified by "m"
- '(("m" "Mail" entry (file+headline "~/projects/notes/refile.org" "Mail")
- "* %?\n\n Source: %u, %c\n %i")
- ("t" "todo" entry (file "~/projects/notes/refile.org")
- "* TODO %?\n%U\n%a\n" :clock-in t :clock-resume t)
- ("r" "respond" entry (file "~/projects/notes/refile.org")
- "* NEXT Respond to %:from on %:subject\nSCHEDULED: %t\n%U\n%a\n" :clock-in t :clock-resume t :immediate-finish t)
- ("n" "note" entry (file "~/projects/notes/refile.org")
- "* %? :NOTE:\n%U\n%a\n" :clock-in t :clock-resume t)
- ("j" "Journal" entry (file+datetree "~/projects/notes/diary.org")
- "* %?\n%U\n" :clock-in t :clock-resume t)
- ("w" "org-protocol" entry (file "~/projects/notes/refile.org")
- "* TODO Review %c\n%U\n" :immediate-finish t)
- ("p" "Phone call" entry (file "~/projects/notes/refile.org")
- "* PHONE %? :PHONE:\n%U" :clock-in t :clock-resume t)
- ("h" "Habit" entry (file "~/projects/notes/refile.org")
- "* NEXT %?\n%U\n%a\nSCHEDULED: %(format-time-string \"<%Y-%m-%d %a .+1d/3d>\")\n:PROPERTIES:\n:STYLE: habit\n:REPEAT_TO_STATE: NEXT\n:END:\n")
- )
- )
-
-;; Remove empty LOGBOOK drawers on clock out
-(defun bh/remove-empty-drawer-on-clock-out ()
- (interactive)
- (save-excursion
- (beginning-of-line 0)
- (org-remove-empty-drawer-at "LOGBOOK" (point))))
-
-(add-hook 'org-clock-out-hook 'bh/remove-empty-drawer-on-clock-out 'append)
-
-
-; this is from http://doc.norang.ca/org-mode.html#Capture
-; use C-M-r for org mode capture
-(global-set-key (kbd "C-M-r") 'org-capture)
-
-; Targets include this file and any file contributing to the agenda - up to 9 levels deep
-(setq org-refile-targets (quote ((nil :maxlevel . 9)
- (org-agenda-files :maxlevel . 9))))
-
-; Use full outline paths for refile targets - we file directly with IDO
-(setq org-refile-use-outline-path t)
-
-; Targets complete directly with IDO
-(setq org-outline-path-complete-in-steps nil)
-
-; Allow refile to create parent tasks with confirmation
-(setq org-refile-allow-creating-parent-nodes (quote confirm))
-
-; Use IDO for both buffer and file completion and ido-everywhere to t
-(setq org-completion-use-ido t)
-(setq ido-everywhere t)
-(setq ido-max-directory-size 100000)
-(ido-mode (quote both))
-
-;;;; Refile settings
-; Exclude DONE state tasks from refile targets
-(defun bh/verify-refile-target ()
- "Exclude todo keywords with a done state from refile targets"
- (not (member (nth 2 (org-heading-components)) org-done-keywords)))
-
-(setq org-refile-target-verify-function 'bh/verify-refile-target)
-
-;; ensure that emacsclient will show just the note to be edited when invoked
-;; from Mutt, and that it will shut down emacsclient once finished;
-;; fallback to legacy behavior when not invoked via org-protocol.
-(require 'org-protocol)
-(add-hook 'org-capture-mode-hook 'delete-other-windows)
-(setq my-org-protocol-flag nil)
-(defadvice org-capture-finalize (after delete-frame-at-end activate)
- "Delete frame at remember finalization"
- (progn (if my-org-protocol-flag (delete-frame))
- (setq my-org-protocol-flag nil)))
-(defadvice org-capture-kill (after delete-frame-at-end activate)
- "Delete frame at remember abort"
- (progn (if my-org-protocol-flag (delete-frame))
- (setq my-org-protocol-flag nil)))
-(defadvice org-protocol-capture (before set-org-protocol-flag activate)
- (setq my-org-protocol-flag t))
-
-
-; this comes from http://upsilon.cc/~zack/blog/posts/2010/02/integrating_Mutt_with_Org-mode/
-(defun open-mail-in-mutt (message)
- "Open a mail message in Mutt, using an external terminal.
-
-Message can be specified either by a path pointing inside a
-Maildir, or by Message-ID."
- (interactive "MPath or Message-ID: ")
- (shell-command
- (format "xterm -e \"%s %s\""
- (substitute-in-file-name "$HOME/bin/mutt_open") message)))
-
-;; add support for "mutt:ID" links
-(org-add-link-type "mutt" 'open-mail-in-mutt)