EDIT: Also, C-h v user-emacs-directory RET says programs in Emacs store information in this directory.
EDIT: Also, C-h v user-emacs-directory RET says programs in Emacs store information in this directory.
*
!.gitignore
!init.el
2. The reason I prefer ~/.emacs.d/ is that I have it in a git repo and on every system, I'll just clone the repo and soft link it in the home directory. This way, I have only one directory inside home about emacs within which my files are explicitly separated and tracked.P.S. I've recently tried to move from Spacemacs to Emacs and by no means a pro, so the process I've described may not be optimal.
- .emacs - which defines my config dir and loads everything in there
- my own config dir (called .emacs.conf), in which I have lots of .el files with specific configurations
Emacs packages still write by default to .emacs.d, and this way I don't have to care about any of that when moving between machines, because my configuration and Emacs's ongoing state are separate.
To be honest, though, I'll probably be migrating into a single-file literate solution soon, which will render my own config directory unnecessary.
There is also GNU Stow [4] that does something similar, and probably better.
0: https://github.com/andreis/cfg
1: https://github.com/andreis/cfg/blob/master/init.sh#L64-L69
2: brew and brew cask, dotfiles ofc, and a _lot_ of system settings on mac os can be changed via the CLI, see
3: https://github.com/iCHAIT/awesome-macOS#setup
4: http://brandon.invergo.net/news/2012-05-26-using-gnu-stow-to...
2. A similar scheme would be to maintain a directory called ~/elisp in git and make ~/.emacs a symlink to ~/elisp/emacs. And pretend that ~/.emacs.d/ does not exist.
2. You could!
user-emacs-directory is a variable defined in ‘subr.el’.
Its value is "~/.emacs.d/"
This variable may be risky if used as a file-local variable.
Documentation:
Directory beneath which additional per-user Emacs-specific files are placed.
Various programs in Emacs store information in this directory.
Note that this should end with a directory separator.
See also ‘locate-user-emacs-file’. commit a04d59830e46664faa4d534366a6b07e3b7c12f2
Author: Richard M. Stallman <rms@gnu.org>
Date: Sat Oct 26 22:41:33 2002 +0000
(command-line): Look for .emacs under ~/.emacs.d after looking in ~.
Interestingly it was changed to look for ~/.emacs.d/init.el in 2005, six months after git got started.See also chapter 51.4 of the Emacs manual (which is often preferred over the documentation of variables simply because it can be more explanatory):
51.4 The Emacs Initialization File
==================================
When Emacs is started, it normally tries to load a Lisp program from an
“initialization file”, or “init file” for short. This file, if it
exists, specifies how to initialize Emacs for you. Emacs looks for your
init file using the filenames ‘~/.emacs’, ‘~/.emacs.el’, or
‘~/.emacs.d/init.el’; you can choose to use any one of these three names
(*note Find Init::). Here, ‘~/’ stands for your home directory.
So yes, it's long been used for things like the list of recently opened files, and configuration changes you made with Custom, and the UIDVALIDITY of your IMAP folders and so on, but it's also been a place to put your init file for quite a long time as well. Once you get a longish init.el file, it's a pretty short step to making several .el files that you load from init.el, and from there you can get as fancy as you like.