Skip to content
My Org Mode based "literate programming" emacs setup
Branch: master
Clone or download
Pull request Compare This branch is 24 commits ahead, 152 commits behind zmalltalker:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

My .emacs.d

I’m using org-mode to write and maintain my Emacs(24) configuration. This is based on (and initially forked off) a fantastic idea by my friend Marius. The actual elisp is extracted from these files on startup by init.el, and the surrounding org-file structure of headers and text makes it really easy to comment and structure the setup well.

Note: See Marius’ original take at for a more lengthy descripton of the why and how of this setup.

Where are the .el files?

You’ll notice that this git repository doesn’t include any .el files, except init.el. In fact, you’ll find that .gitignore instructs Git to ignore several .el files.

How does it work?

The .emacs.d/extras directory contains libraries/functionality in org-mode files, which are compiled to elisp like this:

(setq org-custom-library-dir (expand-file-name "extras" dotfiles-dir))
(mapc #'org-babel-load-file (directory-files org-custom-library-dir t "\\.org$"))

This code will compile all .org files in the extras/ directory and load them into Emacs. After these files have been loaded, the same trick is applied to any .org files directly under ~/.emacs.d:

(mapc #'org-babel-load-file (directory-files dotfiles-dir t "\\.org$"))

This happens, step by step

  • I start emacs, and it will by convention load ~/.emacs.d/init.el
  • init.el will load org-mode
  • init.el will call org-babel-load-file for any .org files in extras/
  • init.el will call org-babel-load-file for any .org files in ~/.emacs.d. In fact, the file you’re reading right now will have a corresponding .el file.
  • I treat as my main configuration file.
You can’t perform that action at this time.