Skip to content

Instantly share code, notes, and snippets.

@ober
Created September 17, 2014 16:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ober/f71faccaeffef9ff7340 to your computer and use it in GitHub Desktop.
Save ober/f71faccaeffef9ff7340 to your computer and use it in GitHub Desktop.
main
;;; 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