From: Eli Zaretskii Date: Tue, 29 Apr 2025 06:05:28 +0000 (+0300) Subject: ; Mention early-init file in Emacs FAQ for Windows X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3a1857d2871317a6042a57277725ab27f8bb7764;p=emacs.git ; Mention early-init file in Emacs FAQ for Windows * doc/misc/efaq-w32.texi (Location of init file, Init file): Mention the early-init file. Suggested by David Hedlund . (cherry picked from commit 2a8e223b8d7c8e18a10ced98f5b794c4de9737e6) --- diff --git a/doc/misc/efaq-w32.texi b/doc/misc/efaq-w32.texi index 766acb0f3ca..0a0ac539de5 100644 --- a/doc/misc/efaq-w32.texi +++ b/doc/misc/efaq-w32.texi @@ -353,6 +353,7 @@ not bundled with Emacs. @xref{Other useful ports}. @section What is my init file? @cindex .emacs @cindex init file +@cindex early init file When Emacs starts up, it attempts to load and execute the contents of a file commonly called @file{.emacs} (though it may have other names, @@ -362,22 +363,31 @@ code to your .emacs, or you can use the Customization interface accessible from the @emph{Options} menu. If the file does not exist, Emacs will start with the default settings. +In addition, Emacs 27 and later attempts to load and execute the +contents of the @file{early-init.el} file. As its name suggests, this +file, if it exists, is loaded and executed early on during the Emacs +startup sequence, before @code{.emacs}, and is intended to contain the +few initializations which must be performed before @file{.emacs} is +looked up and loaded. + @node Location of init file @section Where do I put my init file? @cindex HOME directory @cindex .emacs.d @cindex _emacs @cindex init.el +@cinde early-init.el @cindex registry, setting the HOME directory in -On Windows, the @file{.emacs} file may be called @file{_emacs} for +On Windows, the @file{.emacs} init file may be called @file{_emacs} for backward compatibility with DOS and FAT filesystems where filenames could not start with a dot. Some users prefer to continue using such a name due to historical problems various Windows tools had in the past with file names that begin with a dot. The init file may also be -called @file{.emacs.d/init.el}. Many of the other files that are -created by Lisp packages are stored in the @file{.emacs.d} directory -too, which keeps all your Emacs related files in one place. +called @file{.emacs.d/init.el}. The @file{early-init.el} file and many +of the other files that are created by Lisp packages are stored in the +@file{.emacs.d} directory too, which keeps all your Emacs related files +in one place. All the files mentioned above should go in your @env{HOME} directory. The @env{HOME} directory is determined by following the steps below: