[ < ] [ > ]   [ << ] [Plus haut] [ >> ]         [Top] [Table des matières] [Index] [ ? ]

57.6 The Init File, ‘~/.emacs

When Emacs is started, it normally loads a Lisp program from the file ‘.emacs’ or ‘.emacs.el’ in your home directory (voir la section How Emacs Finds Your Init File). 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 (voir la section Initial Options).

You can also use ‘~/.emacs.d/init.el’ as the init file. Emacs tries this if it cannot find ‘~/.emacs’ or ‘~/.emacs.el’.

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. Like ‘default.el’, Emacs finds this file via the standard search path for Lisp libraries. Emacs loads this library before it loads your init file. To inhibit loading of this library, use the option ‘--no-site-file’. Voir la section Initial Options. We recommend against using ‘site-start.el’ for changes that some users may not like. It is better to put them in ‘default.el’, so that users can more easily override them.

You can place ‘default.el’ and ‘site-start.el’ in any of the directories which Emacs searches for Lisp libraries. The variable load-path (voir la section Libraries of Lisp Code for Emacs) specifies these directories. Many sites put these files in the ‘site-lisp’ subdirectory of the Emacs installation directory, typically ‘/usr/local/share/emacs/site-lisp’.

If you have a large amount of code in your ‘.emacs’ file, you should rename it to ‘~/.emacs.el’, and byte-compile it. Voir (elisp)Byte Compilation section `Byte Compilation' dans 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. Voir Emacs Lisp: (elisp)Top section `Emacs Lisp' dans the Emacs Lisp Reference Manual.


[ < ] [ > ]   [ << ] [Plus haut] [ >> ]         [Top] [Table des matières] [Index] [ ? ]

Ce document a été généré par Eric Reinbold le 23 Février 2009 en utilisant texi2html 1.78.