There's freedesktop.org spec for config placement.
Most of the software adheres to it placing config files into ~/.config
, cache files into ~/.cache
etc. This greatly simplifies backups, config management etc. One of the few unfortunate exceptions is Emacs. Is there a way to force it to behave properly?
Asked
Active
Viewed 70 times
2

Gilles 'SO- stop being evil'
- 21,702
- 4
- 53
- 89

god
- 266
- 1
- 8
-
Probably symlinks. See also [Emacs bug #583](https://debbugs.gnu.org/cgi/bugreport.cgi?bug=583 "Use XDG basedir spec for configuration files?") (reception was not especially favourable). – npostavs Jun 20 '16 at 00:11
-
1Thanks for the link. I find it rather weird that there's no command-line switch to manually point to init file - unless I've somehow missed it. – god Jun 20 '16 at 00:14
-
[Emacs bug #12791](https://debbugs.gnu.org/cgi/bugreport.cgi?bug=12791 "An option to load user init file with -batch") sort of requests that, but no movement towards implementing it, as far as I know. – npostavs Jun 20 '16 at 01:49
-
2https://github.com/tarsius/no-littering is working on this. – xuchunyang Jun 21 '16 at 04:08
-
1I wouldn't so much say “One of the few unfortunate exceptions is Emacs” as “Only programs designed in the past few years tend to follow this recent specification”. Emacs is a few decades older and like a large majority of applications still today follows the standard of its age: each application has its own file or directory directly in the home directory. – Gilles 'SO- stop being evil' Jul 25 '16 at 07:38
-
"Most of the software adheres to it placing config files into ~/.config". I don't think that's true at all. Maybe it's approximately 60% true if you restrict to GUI applications, closer to 10% true overall. (I have no statistics, this is just a quick guess.) – Omar Nov 03 '16 at 22:19
-
@npostavs #12791 is for something else afaicu: it's about loading the (default) init file while starting emacs with `--batch`. `--no-init-file --load FILE` (or `-q -l FILE`) does allow you to manually point to the init file (again afaicu). – T. Verron Nov 04 '16 at 10:33
1 Answers
1
The workaround is the patch from https://debbugs.gnu.org/cgi/bugreport.cgi?bug=15539 which allows you to specify .emacs.d location via EMACS_USER_DIRECTORY environment variable. Unfortunately it's not yet in upstream because some people think that 30 lines (half of which are comments) is too much of added complexity for emacs.
So either take this patch and rebuild emacs yourself or go to the link above and explain how this patch would solves your issues. Please be polite and constructive in your feedback.

god
- 266
- 1
- 8