When Emacs is started up, it performs the following operations
normal-top-level in startup.el):
load-path, by running the file named subdirs.el in each directory in the list. Normally, this file adds the directory’s subdirectories to the list, and those are scanned in their turn. The files subdirs.el are normally generated automatically when Emacs is installed.
load-pathdirectories. This file is intended for registering input methods. The search is only for any personal leim-list.el files that you may have created; it skips the directories containing the standard Emacs libraries (these should contain only a single leim-list.el file, which is compiled into the Emacs executable).
before-init-timeto the value of
current-time(see Time of Day). It also sets
nil, which signals to Lisp programs that Emacs is being initialized.
initial-window-systemspecifies (see initial-window-system). The initialization function for each supported window system is specified by
window-system-initialization-alist. If the value of
initial-window-systemis windowsystem, then the appropriate initialization function is defined in the file term/windowsystem-win.el. This file should have been compiled into the Emacs executable when it was built.
custom-reevaluate-settingto re-initialize the members of the list
custom-delayed-init-variables. These are any pre-loaded user options whose default value depends on the run-time, rather than build-time, context. See custom-initialize-delay.
nil, nor if the options ‘-q’, ‘-Q’, or ‘--batch’ were specified.
abbrev-file-name, if that file exists and can be read (see abbrev-file-name). This is not done if the option ‘--batch’ was specified.
package-initializeto activate any optional Emacs Lisp package that has been installed. See Packaging Basics. However, Emacs doesn’t initialize packages when
nilor when it’s started with one of the options ‘-q’, ‘-Q’, or ‘--batch’. To initialize packages in the latter case,
package-initializeshould be called explicitly (e.g., via the ‘--funcall’ option).
after-init-timeto the value of
current-time. This variable was set to
nilearlier; setting it to the current time signals that the initialization phase is over, and, together with
before-init-time, provides the measurement of how long it took.
tty-setup-hook. This is not done in
--batchmode, nor if
(substitute-command-keys initial-scratch-message)into that buffer.
initial-buffer-choiceis a string, it visits the file (or directory) with that name. If it is a function, it calls the function with no arguments and selects the buffer that it returns. If one file is given as a command line argument, that file is visited and its buffer displayed alongside
initial-buffer-choice. If more than one file is given, all of the files are visited and the *Buffer List* buffer is displayed alongside
frame-notice-user-settings, which modifies the parameters of the selected frame according to whatever the init files specify.
window-setup-hook. The only difference between this hook and
emacs-startup-hookis that this one runs after the previously mentioned modifications to the frame parameters.
nil, or if the ‘--no-splash’ or ‘-Q’ command-line options were specified.
--daemonwas specified, it calls
server-start, and on Posix systems also detaches from the controlling terminal. See Emacs Server in The GNU Emacs Manual.
emacs-session-restorepassing it as argument the ID of the previous session. See Session Management.
The following options affect some aspects of the startup sequence.
This variable, if non-
nil, inhibits the startup screen. In
that case, Emacs typically displays the *scratch* buffer; but
Do not set this variable in the init file of a new user, or in a way that affects more than one user, as that would prevent new users from receiving information about copyleft and basic Emacs usage.
aliases for this variable.
nil, this variable is a string that specifies a file or
directory for Emacs to display after starting up, instead of the
If its value is a function, Emacs calls that function which must
return a buffer which is then displayed.
If its value is
t, Emacs displays the *scratch* buffer.
This variable controls the display of the startup echo area message. You can suppress the startup echo area message by adding text with this form to your init file:
(setq inhibit-startup-echo-area-message "your-login-name")
Emacs explicitly checks for an expression as shown above in your init
file; your login name must appear in the expression as a Lisp string
constant. You can also use the Customize interface. Other methods of
inhibit-startup-echo-area-message to the same value do
not inhibit the startup message. This way, you can easily inhibit the
message for yourself if you wish, but thoughtless copying of your init
file will not inhibit the message for someone else.
This variable, if non-
nil, should be a string, which is
treated as documentation to be
inserted into the *scratch* buffer when Emacs starts up. If it
nil, the *scratch* buffer is empty.
The following command-line options affect some aspects of the startup sequence. See Initial Options in The GNU Emacs Manual.
Do not display a splash screen.
Run without an interactive terminal. See Batch Mode.
Do not initialize any display; just start a server in the background.
Do not load either the init file, or the default library.
Do not load the site-start library.
Equivalent to ‘-q --no-site-file --no-splash’.