aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/emacs/custom.texi56
-rw-r--r--doc/lispref/files.texi7
-rw-r--r--doc/lispref/os.texi7
3 files changed, 43 insertions, 27 deletions
diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi
index d3d7d97120a..0c2509e1cd6 100644
--- a/doc/emacs/custom.texi
+++ b/doc/emacs/custom.texi
@@ -2228,25 +2228,10 @@ as a function from Lisp programs.
2228 When Emacs is started, it normally tries to load a Lisp program from 2228 When Emacs is started, it normally tries to load a Lisp program from
2229an @dfn{initialization file}, or @dfn{init file} for short. This 2229an @dfn{initialization file}, or @dfn{init file} for short. This
2230file, if it exists, specifies how to initialize Emacs for you. 2230file, if it exists, specifies how to initialize Emacs for you.
2231If the directory @file{@var{xdghome}/.config/emacs} exists, Emacs uses 2231If the file @file{~/.config/emacs/init.el} exists, it is used as the
2232@file{@var{xdghome}/.config/emacs/init.el} as the init file. Here, 2232init file; otherwise Emacs may look at @file{~/.emacs.el},
2233@var{xdghome} stands for the value of the environment variable 2233@file{~/.emacs}, @file{~/.emacs.d/init.el}, or other locations.
2234@env{XDG_CONFIG_HOME}, or for @file{~/.config} if 2234@xref{Find Init}.
2235@env{XDG_CONFIG_HOME} is unset; @file{~/} stands for your home
2236directory.
2237
2238 If @file{~/.config/emacs} does not exist, Emacs looks for your init
2239file using the filenames @file{~/.emacs}, @file{~/.emacs.el}, or
2240@file{~/.emacs.d/init.el}; you can choose to use any one of these
2241names (@pxref{Find Init}). Although this is backward-compatible
2242with older Emacs versions, modern POSIX platforms prefer putting your
2243initialization files under @file{.config} so that if you have
2244to troubleshoot a problem that might be due to a bad init file, or
2245archive a collection of them, it can be done by renaming or
2246copying that directory. Note that the @file{.config} versions
2247don't have a leading dot on the basename part of the file.
2248For convenience the rest of this section assumes @env{XDG_CONFIG_HOME}
2249is unset or has a value equivalent to @file{~/.config}.
2250 2235
2251 You can use the command line switch @samp{-q} to prevent loading 2236 You can use the command line switch @samp{-q} to prevent loading
2252your init file, and @samp{-u} (or @samp{--user}) to specify a 2237your init file, and @samp{-u} (or @samp{--user}) to specify a
@@ -2652,8 +2637,31 @@ library. @xref{Hooks}.
2652@subsection How Emacs Finds Your Init File 2637@subsection How Emacs Finds Your Init File
2653 2638
2654 Emacs normally finds your init file in a location under your home 2639 Emacs normally finds your init file in a location under your home
2655directory, e.g., @file{~/.config/emacs/init.el} or 2640directory. @xref{Init File}. By default this location is
2656@file{~/.emacs.d/init.el}. @xref{Init File}. 2641@file{~/.config/emacs/init.el} where @file{~/} stands for your home directory.
2642This default can be overridden as described below.
2643
2644 If @env{XDG_CONFIG_HOME} is set in your environment, its
2645value replaces @file{~/.config} in the name of the default
2646init file.
2647
2648 If the default init file's parent directory does not exist but the
2649directory @file{~/.emacs.d} does exist, Emacs looks for your init file
2650using the filenames @file{~/.emacs.el}, @file{~/.emacs}, or
2651@file{~/.emacs.d/init.el}; you can choose to use any one of these
2652names. (Note that only the locations directly in your home directory
2653have a leading dot in the location's basename.) Although this is
2654backward-compatible with older Emacs versions, modern POSIX platforms
2655prefer putting your initialization files under @file{~/.config} so
2656that troubleshooting a problem that might be due to a bad init file,
2657or archiving a collection of init files, can be done by renaming that
2658directory. To help older Emacs versions find configuration files in
2659their current default locations, you can execute the following
2660Emacs Lisp code:
2661
2662@example
2663(make-symbolic-link ".config/emacs" "~/.emacs.d")
2664@end example
2657 2665
2658 However, if you run Emacs from a shell started by @code{su} and 2666 However, if you run Emacs from a shell started by @code{su} and
2659@env{XDG_CONFIG_HOME} is not set in your environment, Emacs 2667@env{XDG_CONFIG_HOME} is not set in your environment, Emacs
@@ -2663,10 +2671,14 @@ editor customizations even if you are running as the super user.
2663 2671
2664 More precisely, Emacs first determines which user's init file to use. 2672 More precisely, Emacs first determines which user's init file to use.
2665It gets your user name from the environment variables @env{LOGNAME} and 2673It gets your user name from the environment variables @env{LOGNAME} and
2666@env{USER}; if neither of those exists, it uses effective user-ID@. 2674@env{USER}; if neither of those exists, it uses the effective user-ID@.
2667If that user name matches the real user-ID, then Emacs uses @env{HOME}; 2675If that user name matches the real user-ID, then Emacs uses @env{HOME};
2668otherwise, it looks up the home directory corresponding to that user 2676otherwise, it looks up the home directory corresponding to that user
2669name in the system's data base of users. 2677name in the system's data base of users.
2678
2679 For brevity the rest of the Emacs documentation generally uses just
2680the current default location @file{~/.config/emacs/init.el} for the
2681init file.
2670@c LocalWords: backtab 2682@c LocalWords: backtab
2671 2683
2672@node Init Non-ASCII 2684@node Init Non-ASCII
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi
index d53fed4ee87..c3b6c39b283 100644
--- a/doc/lispref/files.texi
+++ b/doc/lispref/files.texi
@@ -2822,9 +2822,10 @@ filter out a directory named @file{foo.elc}.
2822name for a particular use---typically, to hold configuration data 2822name for a particular use---typically, to hold configuration data
2823specified by the current user. Usually, such files should be located 2823specified by the current user. Usually, such files should be located
2824in the directory specified by @code{user-emacs-directory}, which is 2824in the directory specified by @code{user-emacs-directory}, which is
2825@file{~/.config/emacs} or @file{~/.emacs.d} by default (@pxref{Init 2825typically @file{~/.config/emacs} by default (@pxref{Find
2826File}). For example, abbrev definitions are stored by default in 2826Init,,How Emacs Finds Your Init File, emacs, The GNU Emacs Manual}).
2827@file{~/.config/emacs/abbrev_defs} or @file{~/.emacs.d/abbrev_defs}. 2827For example, abbrev definitions are stored by default in
2828@file{~/.config/emacs/abbrev_defs}.
2828The easiest way to specify such a file name is to use the function 2829The easiest way to specify such a file name is to use the function
2829@code{locate-user-emacs-file}. 2830@code{locate-user-emacs-file}.
2830 2831
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi
index df212569087..c94e96bde82 100644
--- a/doc/lispref/os.texi
+++ b/doc/lispref/os.texi
@@ -474,10 +474,13 @@ the value refers to the corresponding source file.
474 474
475@defvar user-emacs-directory 475@defvar user-emacs-directory
476This variable holds the name of the Emacs default directory. 476This variable holds the name of the Emacs default directory.
477It is @file{@var{xdghome}/emacs/} if that directory exists, otherwise 477It defaults to @file{$@{XDG_CONFIG_HOME-'~/.config'@}/emacs/}
478@file{~/.emacs.d/} on all platforms but MS-DOS. Here, @var{xdghome} 478if that directory exists and @file{~/.emacs.d/} does not exist,
479otherwise to @file{~/.emacs.d/} on all platforms but MS-DOS@.
480Here, @file{$@{XDG_CONFIG_HOME-'~/.config'@}}
479stands for the value of the environment variable @env{XDG_CONFIG_HOME} 481stands for the value of the environment variable @env{XDG_CONFIG_HOME}
480if that variable is set, and for @file{~/.config} otherwise. 482if that variable is set, and for @file{~/.config} otherwise.
483@xref{Find Init,,How Emacs Finds Your Init File, emacs, The GNU Emacs Manual}.
481@end defvar 484@end defvar
482 485
483@node Terminal-Specific 486@node Terminal-Specific