Customizations based heavily on jwiegley/dot-emacs