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?

  • Probably symlinks. See also Emacs bug #583 (reception was not especially favourable).
    – npostavs
    Jun 20, 2016 at 0:11
  • 1
    Thanks 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, 2016 at 0:14
  • Emacs bug #12791 sort of requests that, but no movement towards implementing it, as far as I know.
    – npostavs
    Jun 20, 2016 at 1:49
  • 2
    github.com/tarsius/no-littering is working on this.
    – xuchunyang
    Jun 21, 2016 at 4:08
  • 1
    I 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. Jul 25, 2016 at 7:38

1 Answer 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.