Created
September 17, 2014 16:41
-
-
Save ober/f71faccaeffef9ff7340 to your computer and use it in GitHub Desktop.
main
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; init.el --- Where all the magic begins | |
;; | |
;; This file loads Org-mode and then loads the rest of our Emacs | |
;; initialization from Emacs lisp embedded in literate Org-mode files. | |
;; Load up Org Mode and (now included) Org Babel for elisp embedded in | |
;; Org Mode files | |
(setq dotfiles-dir (file-name-directory (or (buffer-file-name) load-file-name))) | |
(let* ((org-dir (expand-file-name | |
"lisp" (expand-file-name | |
"org" (expand-file-name | |
"src" dotfiles-dir)))) | |
(org-contrib-dir (expand-file-name | |
"lisp" (expand-file-name | |
"contrib" (expand-file-name | |
".." org-dir)))) | |
(load-path (append (list org-dir org-contrib-dir) | |
(or load-path nil)))) | |
;; load up Org-mode and Org-babel | |
(require 'org-install) | |
(require 'ob-tangle)) | |
;; Load any libraries (anything in extras/*.org) first, so | |
;; we can use it in our own files | |
(setq ober-extras-dir (expand-file-name "extras" dotfiles-dir)) | |
(setq ober-extras-files (directory-files ober-extras-dir t "\\.org$")) | |
(defun ober-literal-load-file (file) | |
"Load an org file from ~/.emacs.d/extras - assuming it contains | |
code blocks which can be tangled" | |
(org-babel-load-file (expand-file-name file | |
ober-extras-dir))) | |
(mapc #'ober-literal-load-file ober-extras-files) | |
(add-to-list 'load-path ober-extras-dir) | |
;; load up all literate org-mode files in this directory | |
(mapc #'org-babel-load-file (directory-files dotfiles-dir t "\\.org$")) | |
(put 'upcase-region 'disabled nil) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment