;; The following lines are always needed.  Choose your own keys.
;; Org mode keys
(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)
(global-set-key "\C-cc" 'org-capture)
(global-set-key "\C-cb" 'org-iswitchb)

;; org publish
(require 'ox-publish)
(setq org-publish-project-alist
      '(("org-notes"
	 :base-directory "~/repos/csphy/website/org/"
	 :base-extension "org"
	 :publishing-directory "~/repos/csphy/website/jekyll/"
	 :recursive t
	 :publishing-function org-html-publish-to-html
	 :headline-leves 4 ;Just the default for this project.
	 :html-extension "html"
	 :body-only f ;; Only export section between <body> </body>
	 )

	("org-static"
	 :base-directory "~/repos/csphy/website/org/"
	 :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf\\|php"
	 :publishing-directory "~/repos/csphy/website/"
	 :recursive t
	 :publishing-function org-publish-attachment
	 )

	("org" :components ("org-notes" "org-static"))))

;; some config for org-babel
(setq org-confirm-babel-evaluate nil
      org-src-fontify-natively t
      org-src-tab-acts-natively t)

;;load languages babel
(org-babel-do-load-languages
 'org-babel-load-languages
 '((clojure    . t)
   (emacs-lisp . t)
   (haskell    . t)
   (scheme     . t)
   (shell      . t)))

;;bullets in org-mode
(require 'org-bullets)
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))

;; default apps to open files with org-mode
(setq org-file-apps
   (quote
    ((auto-mode . emacs)
     ("\\.mm\\'" . default)
     ("\\.x?html?\\'" . "seamonkey")
     ("\\.pdf\\'" . "mupdf %s")
     ("\\.djvu\\'" . "djview %s"))))
