diff options
| author | Robert Pluim | 2020-01-15 12:24:43 +0100 |
|---|---|---|
| committer | Robert Pluim | 2020-01-16 16:05:45 +0100 |
| commit | 13995f31a219bfcb24da5887136583cbf2deff4c (patch) | |
| tree | b8abcb0057271c7ed2d6d90144c6925beaaea128 /etc | |
| parent | 91cac24952806c6c4addc3c045854c2c314c2e31 (diff) | |
| download | emacs-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 'etc')
| -rw-r--r-- | etc/NEWS | 37 |
1 files changed, 18 insertions, 19 deletions
| @@ -161,25 +161,24 @@ Emacs 28. | |||
| 161 | * Startup Changes in Emacs 27.1 | 161 | * Startup Changes in Emacs 27.1 |
| 162 | 162 | ||
| 163 | +++ | 163 | +++ |
| 164 | ** Emacs now uses the XDG convention for init files. | 164 | ** Emacs can now use the XDG convention for init files. |
| 165 | For example, it looks for init.el in "~/.config/emacs/init.el", and | 165 | The 'XDG_CONFIG_HOME' environment variable (which defaults to |
| 166 | similarly for other init files. | 166 | "~/.config") specifies the XDG configuration parent directory. Emacs |
| 167 | 167 | checks for "init.el" and other configuration files inside the "emacs" | |
| 168 | The 'XDG_CONFIG_HOME' environment variable (which defaults to "~/.config") | 168 | subdirectory of 'XDG_CONFIG_HOME', i.e. "$XDG_CONFIG_HOME/emacs/init.el" |
| 169 | specifies the parent directory of these and other configuration files, | 169 | |
| 170 | and will override their traditional locations (the home directory, | 170 | However, Emacs will still initially look for init files in their |
| 171 | "~/.emacs.d", etc.). | 171 | traditional locations if "~/.emacs.d" or "~/.emacs" exist, even if |
| 172 | 172 | "$XDG_CONFIG_HOME/emacs" also exists. This means that you must delete | |
| 173 | Emacs will still look for init files in their traditional locations if | 173 | or rename any existing "~/.emacs.d" and "~/.emacs" to enable use of |
| 174 | "$XDG_CONFIG_HOME/emacs" does not exist, but "~/.emacs.d" or | 174 | the XDG directory. |
| 175 | "~/.emacs" does exist, so invoking Emacs with XDG_CONFIG_HOME='/nowhere' | 175 | |
| 176 | might be useful if your new-location init files are scrambled, or if | 176 | If "~/.emacs.d" does not exist, and Emacs has decided to use it |
| 177 | you want to force Emacs to ignore files under 'XDG_CONFIG_HOME' for | 177 | (i.e. "$XDG_CONFIG_HOME/emacs" does not exist), Emacs will create it. |
| 178 | some other reason. | 178 | Emacs will never create "$XDG_CONFIG_HOME/emacs". |
| 179 | 179 | ||
| 180 | If neither "$XDG_CONFIG_HOME/emacs" nor "~/.emacs.d" exist, Emacs will | 180 | Whichever directory Emacs decides to use, it will set |
| 181 | now default to "$XDG_CONFIG_HOME/emacs", and will create that directory | 181 | 'user-emacs-directory' to point to it. |
| 182 | and set 'user-emacs-directory' to point to it. | ||
| 183 | 182 | ||
| 184 | +++ | 183 | +++ |
| 185 | ** Emacs can now be configured using an early init file. | 184 | ** Emacs can now be configured using an early init file. |