You can symlink ~/.emacs.d, this is what I do
Try to keep my emacs configuration ~/.emacs.d oriented i.e. all emacs related config files should live in that folder
Then I have an ~/.emacs_configs folder where all config folders (basically a folder with a init.el and rest of the configuration) live, so my personal config folder will be ~/emacs_configs/iqbal, a prelude distribution will be in ~/emacs_configs/prelude
Very early in my personal emacs config I set the
user-emacs-directory
to the full path to my config using the following(setq user-emacs-directory (file-truename "~/.emacs.d/"))
Then finally I symlink ~/.emacs.d to the configuration I actually want to use, eg. to use my configuration I will do ln -s ~/emacs_configs/iqbal .emacs.d. If you want to tryout some configuration just copy the configuration folder to ~/emacs_configs/whatever_name and change the symlink
The advantage of the 3rd step is that emacs started with my personal configuration can run unaffected even if I change the .emacs.d
symlink while emacs it is running.
Another advantage is since the HOME
is not changed external programs emacs might need to interact with are unaffected