previous next top contents index framed top this page unframed
In Version 16.20 of MAINSAIL, the parameter file is called v1620.prm (in general, the name of the file depends on the version of MAINSAIL; it consists of the letter v followed by the major and minor version numbers followed by .prm). This file may reside on your home directory, the directory on which you are editing, or in both places (if it exists in both places, the one on the home directory is read first, and then the one on the current directory, which means that settings specified in the current directory override those in the home directory if the same parameter is specified in both).
The file name eparms must be lowercase on case-sensitive file systems. MAINEDIT looks first for the file on the current directory. If it finds it there, it uses this file to access and store information about the environment in which you normally use MAINEDIT. If it does not find eparms in your current directory, it looks for it on your home directory (as returned by the MAINSAIL system procedure $homeDirectory).
If MAINEDIT does not find an eparms file at the start of the MAINEDIT session, it does not create a new one. Users typically create an eparms file just once, since eparms is automatically updated by MAINEDIT thereafter.
2.1. The $MAINEDIT Group in the Parameter File
The parameter file may contain parameters for a number of applications
besides MAINEDIT.
The parameters for MAINEDIT are organized into a group, where
the group begins with the line:
$GROUP $MAINEDIT
Each subsequent line (up to the next $GROUP or $ENDGROUP command) consists of a parameter name followed by its value, e.g.:
windowWidth 72
where windowWidth is the parameter name and 72 is the parameter's value. Case is not distinguished in parameter names; the line could just as well read:
WINDOWWIDTH 72
MAINEDIT recognizes a number of different parameter names. In some cases, the value of the parameter is ignored; the mere presence of the parameter name in the parameter file is enough to affect MAINEDIT's behavior.
Some MAINEDIT front ends may also allow parameters to specified in their own groups; see the documentation for each front end for details.
2.1.1. DONOTPROMPTFORPAGEANDLINE
If the DONOTPROMPTFORPAGEANDLINE parameter is present in
the parameter file,
MAINEDIT suppresses the prompt for initial page and line
when it creates a new buffer; it always positions the cursor at
the default page and line.
2.1.2. DISPLAYMODULE
To display text properly, MAINEDIT must know the characteristics of
your terminal. For each terminal MAINEDIT supports, there is a
display module that handles the specifics of the terminal
interaction.
The DISPLAYMODULE entry in your parameter file supplies MAINEDIT with a default display module. For example:
DISPLAYMODULE vt100
means that the default is the VT100 display module.
If the DISPLAYMODULE parameter is present, MAINEDIT uses the specified display module without prompting for one, unless a comma is typed after the file name specified to the initial File to edit: prompt. If this parameter is not present, MAINEDIT always prompts for the display module name.
If you want MAINEDIT to update the display
module automatically when you choose one different from the default,
the DISPLAYMODULE entry can appear in your eparms file instead
of your parameter file,
as described in Section 2.1.3.
2.1.3. UPDATEDISPLAYMODULE
If this parameter is present, the DISPLAYMODULE entry in eparms
is updated to be the display module in use whenever
eparms is rewritten. Otherwise,
the DISPLAYMODULE entry in eparms (if any) is unchanged.
For example, if, when MAINEDIT is invoked, the parameter file contains:
$GROUP $MAINEDIT
UPDATEDISPLAYMODULE
and the eparms file contains:
DISPLAYMODULE vt100
and you override the default (VT100) display module because you are using a Heath terminal and need the HEATH display module, then when MAINEDIT updates eparms, it changes the DISPLAYMODULE line to be:
DISPLAYMODULE heath
so that the next time MAINEDIT is invoked, the default display
module is HEATH.
2.1.4. DONOTPROMPTFORDISPLAYMODULE
Certain XIDAK utilities allow you to switch from line-oriented to
display mode (see, for example,
Section 3.1 of the MAINDEBUG User's Guide).
When the switch occurs,
MAINSAIL needs to know what display module to use.
Normally, when such a switch occurs, you are prompted for the
name of the display module regardless of whether a DISPLAYMODULE
entry appears in your parameter or eparms file.
If you specify both
the DISPLAYMODULE and DONOTPROMPTFORDISPLAYMODULE parameters,
however, then when MAINSAIL switches to display mode, it uses the
default display module without prompting.
The DONOTPROMPTFORDISPLAYMODULE parameter is ignored at the initial File to edit: prompt; that is, if a comma terminates the initial file name, you are prompted for the display module name whether or not the DONOTPROMPTFORDISPLAYMODULE parameter is present in the parameter file.
If both the DISPLAYMODULE and DONOTPROMPTFORDISPLAYMODULE
parameters are present, it is not possible to override
the default display module when switching to display mode from a
program.
2.1.5. PROMPTFORDISPLAYMODULE
The PROMPTFORDISPLAYMODULE parameter has the reverse effect of
the DONOTPROMPTFORDISPLAYMODULE parameter:
if specified, MAINEDIT always prompts for a display module
when beginning an editing session or switching into display mode
(offering a default if applicable), even when the prompt would
normally be suppressed (e.g., because there is a default display
module).
2.1.6. BAUDRATE and UPDATEBAUDRATE
These parameters can be used to specify
the line speed of your terminal. On some terminals, padding is
required to perform certain terminal functions properly, and
that padding is dependent on the baud rate of the terminal line.
If MAINEDIT appears
to be losing characters or otherwise improperly updating the
screen when it is first invoked, it is possible that you do not
have the baud rate set correctly.
The BAUDRATE and UPDATEBAUDRATE
parameters function analogously to the DISPLAYMODULE and
UPDATEDISPLAYMODULE parameters,
except that there is always a default baud rate (which is
terminal- or operating-system-dependent).
Therefore, MAINEDIT does not prompt for the baud
rate after the initial File to edit:
prompt unless a comma terminates
the initial display module name,
even if there is no BAUDRATE parameter present
in your parameter file.
2.1.7. WINDOWWIDTH
The WINDOWWIDTH parameter specifies the default location of the
right margin whenever a new window is created. For example,
WINDOWWIDTH 72
gives you 72 columns in which to enter text. If this entry is not present, MAINEDIT sets margins to the maximum width for the terminal you are using; see the information for your display module in Appendix B.
You may also change the window width of the current buffer
at any time with the MAINED QnX
command, as described in Chapter 9 of the MAINED User's Guide;
some other front ends may also provide commands that affect the window
width. This does not affect the
value stored in your parameter file; you must explicitly edit the
parameter file to change the default window width.
2.1.8. DONOTUPDATEEPARMS
This parameter tells MAINEDIT not to update the eparms file.
It is useful
in the event that the editor is embedded in an application for which
a fixed set of eparms parameters is desired.
If this parameter is present, your contexts and macros cannot be
updated.
2.1.9. FRONTEND and BACKEND
The FRONTEND parameter specifies a default front end;
if absent, MAINED is used.
The BACKEND parameter specifies a default back end;
if absent, TXTMGR (the usual back end) is used.
2.1.10. PROPORTIONALWINDOWS, VISIBLELEFTBORDER,
VISIBLERIGHTBORDER, AUTOHORIZONTALSCROLL, and
MAXIMUMPROPORTIONALWINDOWS
The initial values of
some global editor options can be set in the $MAINEDIT group.
These options are described in Chapter 16 of the MAINED User's Guide.
The parameter names and the corresponding option names are
not always the same;
the correspondence is as follows:
| Parameter Name | Global Option Name |
|---|---|
| proportionalWindows | proportionalWindowsMode |
| visibleLeftBorder | leftBorder |
| visibleRightBorder | rightBorder |
| autoHorizontalScroll | autoHorizontalScroll |
| maximumProportionalWindows | maximumUnanchoredProportionalWindows |
Boolean options must be followed with the value TRUE or FALSE;
numeric options with the value of the option.
Each line in eparms starts with a keyword.
2.2. The eparms File
Except when creating a new eparms file,
it is not normally necessary
for you to edit or examine the eparms file;
It is maintained automatically by MAINEDIT.
However, this section describes the format
of an eparms file in case
you are curious about its contents.
2.2.1. EDITORPARMSFILE
The EDITORPARMSFILE keyword is used to specify the file name to be
used when the eparms file is updated.
It is usually satisfactory to allow the eparms on your current
or home directory to be updated, so this keyword is rarely needed.
2.2.2. CONTEXT
When eparms is updated, MAINEDIT records the final
page and line of the cursor position
for each of the files you edited during the
current session as the context for
that file. Whenever you edit a file, MAINEDIT checks
eparms to see if context information is recorded for the file.
If so, it offers the saved page and line as a
starting point (on the front ends that support this option),
since it is common to want to continue editing from
the most recently edited point.
MAINEDIT maintains context for the thirty most recently edited files. Sample CONTEXT entries are:
CONTEXT mainedit-manual.txt 3 55
CONTEXT w:editor-notes.txt 1 7
There is no need to change these entries, since they are maintained by
MAINEDIT.
2.2.3. MACRO and NAMEDMACRO
MAINEDIT stores editor macro
definitions using these keywords. A macro
is a user-defined sequence of commands.
Macros are defined and invoked
with different commands under the different MAINEDIT front ends.
When you define a macro from
the keyboard, MAINEDIT stores the definition in eparms when
eparms is updated. Thus,
a permanent library of macro definitions is maintained
across edit sessions.
The type of the terminal on which each macro was originally defined
and the front end for which it was defined
are stored with the macro, since the codes transmitted by different
keys make different macros appropriate on different terminals,
and a macro appropriate to one front end is probably not appropriate
to another.
An example of a MACRO entry is:
MACRO(HEATH,MAINED) 30 <27> j q > . ( b
On an ASCII system using a Heath terminal this means that the character with code 30 (CTRL-^) is defined to be the sequence <esc> J Q > . ( B. Blanks are ignored in the command sequence following the MACRO keyword.
An example of a NAMEDMACRO entry is:
NAMEDMACRO(DATAMEDIA,MAINED) FOO
<13> i F O O <27> <27>
The named macro FOO is defined for a Datamedia terminal
as <eol> i F O O <esc> <esc>.
MACRO and NAMEDMACRO entries are maintained by MAINEDIT, so
there is no need for you to understand or modify them.
2.2.4. DISPLAYMODULE
As described in Section 2.1.2, the DISPLAYMODULE
command can be specified in eparms instead of in the parameter
file.
2.2.5. Creating a New eparms File
If you wish MAINEDIT to maintain an eparms file for you,
you should use MAINEDIT (or any other text editor) to create
a file named eparms on your home directory (or some other directory
if you will be editing there and you want the eparms in that
directory to override the one in your home directory).
If you want MAINEDIT to update your default display module automatically as described in Section 2.1.3, you should create an eparms that contains one line that specifies your display module, e.g.:
DISPLAYMODULE sunxterm
if you want SUNXTERM to be your initial default display module, but you want MAINEDIT to update the default display module if you specify a new one. In this case, you should also add the line:
UPDATEDISPLAYMODULE
to the $MAINEDIT group in your parameter file.
If you do not want MAINEDIT to update your default display module automatically, you should create an eparms file consisting of a single blank line, and omit the UPDATEDISPLAYMODULE parameter from the parameter file.