Go to the first, previous, next, last section, table of contents.


The Init File, `~/.emacs'

When Emacs is started, it normally loads a Lisp program from the file `.emacs' in your home directory. We call this file your init file because it specifies how to initialize Emacs for you. You can use the command line switch `-q' to prevent loading your init file, and `-u' (or `--user') to specify a different user's init file (see section Entering and Exiting Emacs).

There can also be a default init file, which is the library named `default.el', found via the standard search path for libraries. The Emacs distribution contains no such library; your site may create one for local customizations. If this library exists, it is loaded whenever you start Emacs (except when you specify `-q'). But your init file, if any, is loaded first; if it sets inhibit-default-init non-nil, then `default' is not loaded.

Your site may also have a site startup file; this is named `site-start.el', if it exists. Emacs loads this library before it loads your init file. To inhibit loading of this library, use the option `-no-site-file'.

If you have a large amount of code in your `.emacs' file, you should move it into another file such as `~/something.el', byte-compile it, and make your `.emacs' file load it with (load "~/something"). See section `Byte Compilation' in the Emacs Lisp Reference Manual, for more information about compiling Emacs Lisp programs.

If you are going to write actual Emacs Lisp programs that go beyond minor customization, you should read the Emacs Lisp Reference Manual.


Go to the first, previous, next, last section, table of contents.