This section describes elvis
session files and itemizes the steps it takes during initialization.
is intended to eventually meet
COSE (Common Open System Environment)
These require that programs be able to save their state and
return to that saved state at a later time.
To be able to do this,
maintains all its
state in a session file. Normally
creates the session file when it starts,
and removes it when it exits, but if
crashes, a left-over session file can
be used to implement recovery of the edited files.
performs the following initialization steps.
Interestingly, much of the customization for elvis
moved out of editor options and into initialization files.
Initialize all hardcoded options.
Select an interface from those compiled into elvis
will choose the "best" of the
ones that are compiled in and that can work. For example, the X11
interface is considered to be better than the termcap
interface, but it may not be usable if X Windows is not currently running.
The selected interface can process the command line for
initialization options that are specific to it.
Create the session file if it doesn't exist; otherwise,
read it (in preparation for recovery).
option from the
environment variable. Otherwise, give
it a default value.
is a typical value, but the actual value
will depend upon how elvis
configured and built.
for an ex
and run it. The default
file performs the
Chooses a digraph table based on the current operating
system. (Digraphs are a way to define the system's
extended ASCII character set and how characters from the
extended set should be entered.)
Sets options based on the program's name (for
Handles system-dependent tweaks, such as setting the colors for X11
and adding menus to the interface.
Picks an initialization filename, either .exrc
for UNIX, or elvis.rc
for non-UNIX systems.
Call this file f
exists, executes its value. Otherwise,
is the filename chosen previously.
option has been set, then
command on f
in the current directory.
For X11, sets the normal, bold, and italic fonts, if they
have not been set already.
Load the pre- and post-read and pre- and post-write command
files, if they exist.
Also load the elvis.msg
All of these files are described later in this chapter.
Load and display the first file named on the command line.
option was given, load and display
the rest of the files, each in its own window.