diff options
| -rw-r--r-- | doc/emacs/custom.texi | 56 | ||||
| -rw-r--r-- | doc/lispref/files.texi | 7 | ||||
| -rw-r--r-- | doc/lispref/os.texi | 7 |
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 |
| 2229 | an @dfn{initialization file}, or @dfn{init file} for short. This | 2229 | an @dfn{initialization file}, or @dfn{init file} for short. This |
| 2230 | file, if it exists, specifies how to initialize Emacs for you. | 2230 | file, if it exists, specifies how to initialize Emacs for you. |
| 2231 | If the directory @file{@var{xdghome}/.config/emacs} exists, Emacs uses | 2231 | If 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, | 2232 | init 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 | ||
| 2236 | directory. | ||
| 2237 | |||
| 2238 | If @file{~/.config/emacs} does not exist, Emacs looks for your init | ||
| 2239 | file using the filenames @file{~/.emacs}, @file{~/.emacs.el}, or | ||
| 2240 | @file{~/.emacs.d/init.el}; you can choose to use any one of these | ||
| 2241 | names (@pxref{Find Init}). Although this is backward-compatible | ||
| 2242 | with older Emacs versions, modern POSIX platforms prefer putting your | ||
| 2243 | initialization files under @file{.config} so that if you have | ||
| 2244 | to troubleshoot a problem that might be due to a bad init file, or | ||
| 2245 | archive a collection of them, it can be done by renaming or | ||
| 2246 | copying that directory. Note that the @file{.config} versions | ||
| 2247 | don't have a leading dot on the basename part of the file. | ||
| 2248 | For convenience the rest of this section assumes @env{XDG_CONFIG_HOME} | ||
| 2249 | is 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 |
| 2252 | your init file, and @samp{-u} (or @samp{--user}) to specify a | 2237 | your 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 |
| 2655 | directory, e.g., @file{~/.config/emacs/init.el} or | 2640 | directory. @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. |
| 2642 | This default can be overridden as described below. | ||
| 2643 | |||
| 2644 | If @env{XDG_CONFIG_HOME} is set in your environment, its | ||
| 2645 | value replaces @file{~/.config} in the name of the default | ||
| 2646 | init file. | ||
| 2647 | |||
| 2648 | If the default init file's parent directory does not exist but the | ||
| 2649 | directory @file{~/.emacs.d} does exist, Emacs looks for your init file | ||
| 2650 | using the filenames @file{~/.emacs.el}, @file{~/.emacs}, or | ||
| 2651 | @file{~/.emacs.d/init.el}; you can choose to use any one of these | ||
| 2652 | names. (Note that only the locations directly in your home directory | ||
| 2653 | have a leading dot in the location's basename.) Although this is | ||
| 2654 | backward-compatible with older Emacs versions, modern POSIX platforms | ||
| 2655 | prefer putting your initialization files under @file{~/.config} so | ||
| 2656 | that troubleshooting a problem that might be due to a bad init file, | ||
| 2657 | or archiving a collection of init files, can be done by renaming that | ||
| 2658 | directory. To help older Emacs versions find configuration files in | ||
| 2659 | their current default locations, you can execute the following | ||
| 2660 | Emacs 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. |
| 2665 | It gets your user name from the environment variables @env{LOGNAME} and | 2673 | It 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@. |
| 2667 | If that user name matches the real user-ID, then Emacs uses @env{HOME}; | 2675 | If that user name matches the real user-ID, then Emacs uses @env{HOME}; |
| 2668 | otherwise, it looks up the home directory corresponding to that user | 2676 | otherwise, it looks up the home directory corresponding to that user |
| 2669 | name in the system's data base of users. | 2677 | name in the system's data base of users. |
| 2678 | |||
| 2679 | For brevity the rest of the Emacs documentation generally uses just | ||
| 2680 | the current default location @file{~/.config/emacs/init.el} for the | ||
| 2681 | init 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}. | |||
| 2822 | name for a particular use---typically, to hold configuration data | 2822 | name for a particular use---typically, to hold configuration data |
| 2823 | specified by the current user. Usually, such files should be located | 2823 | specified by the current user. Usually, such files should be located |
| 2824 | in the directory specified by @code{user-emacs-directory}, which is | 2824 | in the directory specified by @code{user-emacs-directory}, which is |
| 2825 | @file{~/.config/emacs} or @file{~/.emacs.d} by default (@pxref{Init | 2825 | typically @file{~/.config/emacs} by default (@pxref{Find |
| 2826 | File}). For example, abbrev definitions are stored by default in | 2826 | Init,,How Emacs Finds Your Init File, emacs, The GNU Emacs Manual}). |
| 2827 | @file{~/.config/emacs/abbrev_defs} or @file{~/.emacs.d/abbrev_defs}. | 2827 | For example, abbrev definitions are stored by default in |
| 2828 | @file{~/.config/emacs/abbrev_defs}. | ||
| 2828 | The easiest way to specify such a file name is to use the function | 2829 | The 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 |
| 476 | This variable holds the name of the Emacs default directory. | 476 | This variable holds the name of the Emacs default directory. |
| 477 | It is @file{@var{xdghome}/emacs/} if that directory exists, otherwise | 477 | It defaults to @file{$@{XDG_CONFIG_HOME-'~/.config'@}/emacs/} |
| 478 | @file{~/.emacs.d/} on all platforms but MS-DOS. Here, @var{xdghome} | 478 | if that directory exists and @file{~/.emacs.d/} does not exist, |
| 479 | otherwise to @file{~/.emacs.d/} on all platforms but MS-DOS@. | ||
| 480 | Here, @file{$@{XDG_CONFIG_HOME-'~/.config'@}} | ||
| 479 | stands for the value of the environment variable @env{XDG_CONFIG_HOME} | 481 | stands for the value of the environment variable @env{XDG_CONFIG_HOME} |
| 480 | if that variable is set, and for @file{~/.config} otherwise. | 482 | if 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 |