It runs the normal hook @code{before-init-hook}.
@item
-If appropriate (e.g., not in batch mode or started as a daemon), it
-creates a graphical frame.
+If appropriate, it creates a graphical frame. This is not done if the
+options @samp{--batch} or @samp{--daemon} were specified.
@item
It initializes the initial frame's faces, and sets up the menu bar
@item
If @code{initial-buffer-choice} is a string, it visits the file with
-that name. Furthermore, if the @samp{*scratch*} buffer exists and is
+that name. If the @samp{*scratch*} buffer exists and is
empty, it inserts @code{initial-scratch-message} into that buffer.
@c To make things nice and confusing, the next three items can be
@item
It displays the @dfn{startup screen}, which is a special buffer that
contains information about copyleft and basic Emacs usage. This is
-not done if @code{initial-buffer-choice} or
-@code{inhibit-startup-screen} are @code{nil}, nor if the
-@samp{--no-splash} or @samp{-Q} command-line options were specified.
+not done if @code{inhibit-startup-screen} or @code{initial-buffer-choice}
+are non-@code{nil}, or if the @samp{--no-splash} or @samp{-Q} command-line
+options were specified.
@c End of command-line-1.
@end defopt
@defopt initial-buffer-choice
-This variable, if non-@code{nil}, determines a file or buffer for
-Emacs to display after starting up, instead of the startup screen.
+If non-@code{nil}, this variable is a string that specifies a file or
+directory for Emacs to display after starting up, instead of the
+startup screen.
@ignore
@c I do not think this should be mentioned. AFAICS it is just a dodge
@c around inhibit-startup-screen not being settable on a site-wide basis.
If its value is @code{t}, Emacs displays the @samp{*scratch*} buffer.
@end ignore
-If its value is a string, that specifies the name of a file for Emacs to
-visit.
@end defopt
@defopt inhibit-startup-echo-area-message
the standard search path for libraries (@pxref{How Programs Do
Loading}). The Emacs distribution does not come with this file; it is
intended for local customizations. If the default init file exists,
-it is loaded whenever you start Emacs, except in batch mode or if
-@samp{-q} (or @samp{-Q}) is specified. But your own personal init
+it is loaded whenever you start Emacs. But your own personal init
file, if any, is loaded first; if it sets @code{inhibit-default-init}
to a non-@code{nil} value, then Emacs does not subsequently load the
-@file{default.el} file.
+@file{default.el} file. In batch mode, or if you specify @samp{-q}
+(or @samp{-Q}), Emacs loads neither your personal init file nor
+the default init file.
Another file for site-customization is @file{site-start.el}. Emacs
loads this @emph{before} the user's init file. You can inhibit the
user's init file. Its normal value is @code{"site-start"}. The only
way you can change it with real effect is to do so before dumping
Emacs.
+@c So why even mention it here. I imagine it is almost never changed.
@end defopt
@xref{Init Examples,, Init File Examples, emacs, The GNU Emacs Manual}, for
@file{.emacs} file.
@defopt inhibit-default-init
-This variable prevents Emacs from loading the default initialization
-library file for your session of Emacs. If its value is non-@code{nil},
-then the default library is not loaded. The default value is
-@code{nil}.
+If this variable is non-@code{nil}, it prevents Emacs from loading the
+default initialization library file. The default value is @code{nil}.
@end defopt
@defvar before-init-hook
This normal hook is run, once, just before loading all the init files
-(the user's init file, @file{default.el}, and/or @file{site-start.el}).
+(@file{site-start.el}, your init file, and @file{default.el}).
(The only way to change it with real effect is before dumping Emacs.)
@end defvar
@defvar after-init-hook
This normal hook is run, once, just after loading all the init files
-(the user's init file, @file{default.el}, and/or @file{site-start.el}),
-before loading the terminal-specific library and processing the
-command-line action arguments.
+(@file{site-start.el}, your init file, and @file{default.el}),
+before loading the terminal-specific library (if started on a text
+terminal) and processing the command-line action arguments.
@end defvar
@defvar emacs-startup-hook
This normal hook is run, once, just after handling the command line
-arguments, just before @code{term-setup-hook}.
+arguments, just before @code{term-setup-hook}. In batch mode, Emacs
+does not run either of these hooks.
@end defvar
@defvar user-init-file
@defvar user-emacs-directory
This variable holds the name of the @file{.emacs.d} directory. It is
-ordinarily @file{~/.emacs.d}, but differs on some platforms.
+@file{~/.emacs.d} on all platforms but MS-DOS.
@end defvar
@node Terminal-Specific
does not specify all the terminal's function keys. @xref{Terminal
Input}.
- When the name of the terminal type contains a hyphen, and no library
+ When the name of the terminal type contains a hyphen or underscore, and no library
is found whose name is identical to the terminal's name, Emacs strips
-from the terminal's name the last hyphen and everything that follows
+from the terminal's name the last hyphen or underscore and everything that follows
it, and tries again. This process is repeated until Emacs finds a
-matching library, or until there are no more hyphens in the name
-(i.g.@: there is no terminal-specific library). For example, if the
+matching library, or until there are no more hyphens or underscores in the name
+(i.e.@: there is no terminal-specific library). For example, if the
terminal name is @samp{xterm-256color} and there is no
@file{term/xterm-256color.el} library, Emacs tries to load
@file{term/xterm.el}. If necessary, the terminal library can evaluate
You can also arrange to override some of the actions of the
terminal-specific library by setting the variable
-@code{term-setup-hook}. This is a normal hook which Emacs runs using
-@code{run-hooks} at the end of Emacs initialization, after loading both
-your init file and any terminal-specific libraries. You can
-use this variable to define initializations for terminals that do not
+@code{term-setup-hook}. This is a normal hook that Emacs runs
+at the end its initialization, after loading both
+your init file and any terminal-specific libraries. You could
+use this hook to define initializations for terminals that do not
have their own libraries. @xref{Hooks}.
@defvar term-file-prefix
@noindent
You may set the @code{term-file-prefix} variable to @code{nil} in your
init file if you do not wish to load the
-terminal-initialization file. To do this, put the following in
-your init file: @code{(setq term-file-prefix nil)}.
+terminal-initialization file.
-On MS-DOS, if the environment variable @code{TERM} is not set, Emacs
-uses @samp{internal} as the terminal type.
+On MS-DOS, Emacs sets the @code{TERM} environment variable to @samp{internal}.
@end defvar
@defvar term-setup-hook
You can use @code{term-setup-hook} to override the definitions made by a
terminal-specific file.
-@end defvar
- See @code{window-setup-hook} in @ref{Window Systems}, for a related
-feature.
+For a related feature, @pxref{Window Systems, window-setup-hook}.
+@end defvar
@node Command-Line Arguments
@subsection Command-Line Arguments
@cindex command-line arguments
You can use command-line arguments to request various actions when
-you start Emacs. Command-line arguments should not be commonly used,
-since the recommended way of using Emacs is to start it just once,
-after logging in, and do all editing in the same Emacs session
-(@pxref{Entering Emacs,,, emacs, The GNU Emacs Manual}); nonetheless,
-they can be useful when invoking Emacs from session scripts or
-debugging Emacs itself. This section describes how Emacs processes
-command-line arguments.
+you start Emacs. Note that the recommended way of using Emacs is to
+start it just once, after logging in, and then do all editing in the same
+Emacs session (@pxref{Entering Emacs,,, emacs, The GNU Emacs Manual}).
+For this reason, you might not use command-line arguments very often;
+nonetheless, they can be useful when invoking Emacs from session
+scripts or debugging Emacs. This section describes how Emacs
+processes command-line arguments.
@defun command-line
This function parses the command line that Emacs was called with,
-processes it, loads the user's init file and displays the
-startup messages.
+processes it, and (amongst other things) loads the user's init file and
+displays the startup messages.
@end defun
@defvar command-line-processed
@cindex switches on command line
@cindex options on command line
@cindex command-line options
-The value of this variable is an alist of user-defined command-line
-options and associated handler functions. This variable exists so you
-can add elements to it.
+This variable is an alist of user-defined command-line options and
+associated handler functions. By default it is empty, but you can
+add elements if you wish.
A @dfn{command-line option} is an argument on the command line, which
has the form:
@defvar command-line-args-left
@vindex argv
The value of this variable is the list of command-line arguments that
-have not yet been processed. @code{argv} is an alias for this.
+have not yet been processed.
+@c Don't mention this, since it is a "bad name for a dynamically bound variable"
+@c @code{argv} is an alias for this.
@end defvar
@defvar command-line-functions
argument. If it has also dealt with some of the following arguments, it
can indicate that by deleting them from @code{command-line-args-left}.
-If all of these functions return @code{nil}, then the argument is used
+If all of these functions return @code{nil}, then the argument is treated
as a file name to visit.
@end defvar