aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorRobert Pluim2020-01-15 12:24:43 +0100
committerRobert Pluim2020-01-16 16:05:45 +0100
commit13995f31a219bfcb24da5887136583cbf2deff4c (patch)
treeb8abcb0057271c7ed2d6d90144c6925beaaea128 /doc
parent91cac24952806c6c4addc3c045854c2c314c2e31 (diff)
downloademacs-13995f31a219bfcb24da5887136583cbf2deff4c.tar.gz
emacs-13995f31a219bfcb24da5887136583cbf2deff4c.zip
Make emacs prefer an existing ~/.emacs.d to an existing XDG location
* doc/emacs/custom.texi (Find Init): Update description of how Emacs finds its init file directory and the interaction with $XDG_CONFIG_HOME (Early Init File): Correct XDG location of early-init.el * etc/NEWS: Update description to make it clear the ~/.emacs.d is preferred, even if the XDG location exists. * lisp/startup.el: Prefer ~/.emacs.d even if the XDG location exists. * lib-src/emacsclient.c (open_config): Prefer home directory the XDG location.
Diffstat (limited to 'doc')
-rw-r--r--doc/emacs/custom.texi45
1 files changed, 28 insertions, 17 deletions
diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi
index 1958a86b92d..2e04a6b22d3 100644
--- a/doc/emacs/custom.texi
+++ b/doc/emacs/custom.texi
@@ -2655,26 +2655,37 @@ library. @xref{Hooks}.
2655 2655
2656 Emacs normally finds your init file in a location under your home 2656 Emacs normally finds your init file in a location under your home
2657directory. @xref{Init File}. By default this location is 2657directory. @xref{Init File}. By default this location is
2658@file{~/.config/emacs/init.el} where @file{~/} stands for your home directory. 2658@file{~/.emacs.d/init.el} where @file{~/} stands for your home directory.
2659This default can be overridden as described below. 2659This default can be overridden as described below.
2660 2660
2661 If @env{XDG_CONFIG_HOME} is set in your environment, its 2661Emacs looks for your init file
2662value replaces @file{~/.config} in the name of the default
2663init file.
2664
2665 If the default init file's parent directory does not exist but the
2666directory @file{~/.emacs.d} does exist, Emacs looks for your init file
2667using the filenames @file{~/.emacs.el}, @file{~/.emacs}, or 2662using the filenames @file{~/.emacs.el}, @file{~/.emacs}, or
2668@file{~/.emacs.d/init.el}; you can choose to use any one of these 2663@file{~/.emacs.d/init.el}; you can choose to use any one of these
2669names. (Note that only the locations directly in your home directory 2664names. (Note that only the locations directly in your home directory
2670have a leading dot in the location's basename.) Although this is 2665have a leading dot in the location's basename.)
2671backward-compatible with older Emacs versions, modern POSIX platforms 2666
2672prefer putting your initialization files under @file{~/.config} so 2667Emacs can also look in an XDG-compatible location for @file{init.el},
2673that troubleshooting a problem that might be due to a bad init file, 2668the default is the directory @file{~/.config/emacs}. This can be
2674or archiving a collection of init files, can be done by renaming that 2669overriden by setting @env{XDG_CONFIG_HOME} in your environment, its
2675directory. To help older Emacs versions find configuration files in 2670value replaces @file{~/.config} in the name of the default XDG init
2676their current default locations, you can execute the following 2671file. However @file{~/.emacs.d} and @file{~/.emacs} are always
2677Emacs Lisp code: 2672preferred if they exist, which means that you must delete or rename
2673them in order to use the XDG location.
2674
2675Note also that if neither the XDG location nor @file{~/.emacs.d}
2676exist, then Emacs will create @file{~/.emacs.d} (and therefore use it
2677during subsequent invocations).
2678
2679Emacs will set @var{user-emacs-directory} to the directory it decides
2680to use.
2681
2682Although this is backward-compatible with older Emacs versions, modern
2683POSIX platforms prefer putting your initialization files under
2684@file{~/.config} so that troubleshooting a problem that might be due
2685to a bad init file, or archiving a collection of init files, can be
2686done by renaming that directory. To help older Emacs versions find
2687configuration files in their current default locations, you can
2688execute the following Emacs Lisp code:
2678 2689
2679@example 2690@example
2680(make-symbolic-link ".config/emacs" "~/.emacs.d") 2691(make-symbolic-link ".config/emacs" "~/.emacs.d")
@@ -2694,7 +2705,7 @@ otherwise, it looks up the home directory corresponding to that user
2694name in the system's data base of users. 2705name in the system's data base of users.
2695 2706
2696 For brevity the rest of the Emacs documentation generally uses just 2707 For brevity the rest of the Emacs documentation generally uses just
2697the current default location @file{~/.config/emacs/init.el} for the 2708the current default location @file{~/.emacs.d/init.el} for the
2698init file. 2709init file.
2699@c LocalWords: backtab 2710@c LocalWords: backtab
2700 2711
@@ -2740,7 +2751,7 @@ Type @kbd{C-q}, followed by the key you want to bind, to insert @var{char}.
2740@xref{Init File}. However, it is sometimes desirable 2751@xref{Init File}. However, it is sometimes desirable
2741to have customizations that take effect during Emacs startup earlier than the 2752to have customizations that take effect during Emacs startup earlier than the
2742normal init file is processed. Such customizations can be put in the early 2753normal init file is processed. Such customizations can be put in the early
2743init file, @file{~/.config/emacs.d/early-init.el} or @file{~/.emacs.d/early-init.el}. This file is loaded before the 2754init file, @file{~/.config/emacs/early-init.el} or @file{~/.emacs.d/early-init.el}. This file is loaded before the
2744package system and GUI is initialized, so in it you can customize variables 2755package system and GUI is initialized, so in it you can customize variables
2745that affect frame appearance as well as the package initialization process, 2756that affect frame appearance as well as the package initialization process,
2746such as @code{package-enable-at-startup}, @code{package-load-list}, and 2757such as @code{package-enable-at-startup}, @code{package-load-list}, and