using org-mode to config emacs initialization file
[dotfiles.git] / emacs.d_2 / init.el
1 ;;; init.el --- Where all the magic begins
2 ;;
3 ;; This file loads Org-mode and then loads the rest of our Emacs initialization from Emacs lisp
4 ;; embedded in literate Org-mode files.
5
6 ;; Load up Org Mode and (now included) Org Babel for elisp embedded in Org Mode files
7
8 ;; Added by Package.el.  This must come before configurations of
9 ;; installed packages.  Don't delete this line.  If you don't want it,
10 ;; just comment it out by adding a semicolon to the start of the line.
11 ;; You may delete these explanatory comments.
12 (package-initialize)
13
14 (setq dotfiles-dir (file-name-directory (or (buffer-file-name) load-file-name)))
15
16 (let* ((org-dir (expand-file-name
17                  "lisp" (expand-file-name
18                          "org" (expand-file-name
19                                 "src" dotfiles-dir))))
20        (org-contrib-dir (expand-file-name
21                          "lisp" (expand-file-name
22                                  "contrib" (expand-file-name
23                                             ".." org-dir))))
24        (load-path (append (list org-dir org-contrib-dir)
25                           (or load-path nil))))
26   ;; load up Org-mode and Org-babel
27   (require 'org-install)
28   (require 'ob-tangle))
29
30 ;; load up all literate org-mode files in this directory
31 (mapc #'org-babel-load-file (directory-files dotfiles-dir t "\\.org$"))
32
33 ;;; init.el ends here
34 (custom-set-variables
35  ;; custom-set-variables was added by Custom.
36  ;; If you edit it by hand, you could mess it up, so be careful.
37  ;; Your init file should contain only one such instance.
38  ;; If there is more than one, they won't work right.
39  '(package-selected-packages (quote (use-package))))
40 (custom-set-faces
41  ;; custom-set-faces was added by Custom.
42  ;; If you edit it by hand, you could mess it up, so be careful.
43  ;; Your init file should contain only one such instance.
44  ;; If there is more than one, they won't work right.
45  )