purcell / emacs.d

An Emacs configuration bundle with batteries included
BSD 2-Clause "Simplified" License
6.87k stars 2.05k forks source link

Load extra configuration from optional annex directory. #718

Closed tesujimath closed 5 years ago

tesujimath commented 5 years ago

This is an approach I have come to after some frustration in trying to maintain my own customisations within the ~/.emacs.d repo. Since pretty much all of my customisations are additions (e.g. programming language modes that are unsupported in the base config), I was after an easy way to add significant amounts of config, but enable easy tracking of upstream changes. After ongoing games with git rebase, I had a rethink about a simpler approach.

The approach here is to support a separate ~/.emacs.d.annex directory, and load it via init-annex. It is harmless if these don't exist.

This provides a similar but more powerful hook than the existing init-local mechanism.

As an example, my own annex is at https://github.com/tesujimath/emacs.d.annex

If this PR is accepted, I will obviously change the comment there. Until then, use of an annex requires a customised init-local, and I am trying to move away from any in-repo changes at all.

purcell commented 5 years ago

I'm not super keen to support this for the long term, because I wouldn't want to implicitly recommend this approach.

To achieve this effect, you might just as easily write (push "~/.emacs.d.annex" load-path) in their init-preload-local.el (or edited init.el) and then put init-local.el in your ~/.emacs.d.annex directory, effectively replacing your init-annex.el. Seems like this would be a bit simpler.

tesujimath commented 5 years ago

Ah, that's a good idea, thanks. I'll do that then!