home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
editor
/
gal210a4.arc
/
APPD.GAL
< prev
next >
Wrap
Text File
|
1987-08-11
|
12KB
|
250 lines
.a js=y nm=1 pn=1 hy=n lp=12 bo=51 te=12 to=90
.st3,14,1
&dAppendix%D:%%The%Galahad%II%Text%Editor .jc
&d[%Appendix%D%] .hc
.t36 D - .zl
.std3,14,1
INTRODUCTION .jr
.st3,11,1 .x-5
Galahad has two parts:
1) The printing formatter (see Appendix C and I), and
2) The editor (see Appendices D, E, F, G).
This Appendix discusses configuring and customizing Galahad.
.std3,12,1
Configuring Galahad II
.st3,11,1
Galahad II (Gal2) has a highly customizable editor. It is configured
using a two step process. First, an initialization file must be created. The
distribution disk has a file called GALIBM.INI. This is the starting point.
You should make changes to it as desired. See Chapter Six for details.
To configure Galahad II with the INI file you have made, you must execute
ConfPer. ConfPer will ask you for four options. The first argument is the
file to be configured (GAL2.COM is the default). The second argument is the
INI file. The third argument is the file to be the newly configured Gal2. The
fourth argument is the listing file, useful only in the event of an error in
the INI file.
.std3,14,1
CUSTOMIZING GALAHAD II .jr
.st3,11,1 .x-5
Galahad II allows you to cause any key to execute any sequence of
functions using an INI file. By modifing the GALIBM.INI file itself you may
customize Galahad II so that it does what you want. Alternatively, you may
elect to enter two INI files to Confper, the first being GALIBM.INI, and the
second INI file containing just the keys that you wish to redefine. This is
done by specifying two =.INI files separated by a "+" when the =.INI file is
requested.
ConfPer also will accept its arguments on the command line in the same
fashion as MS-Pascal, MS-Fortran, MS-Link, etc., or not prompt for any
arguments if you enter A> CONFPER ;.
We shall explain how to write your own INI file by giving some examples
next. You are assumed to have run Gal2 at least once before.
.std3,14,1
CREATING KEY DEFINITIONS .jr
.st3,11,1
A few definitions are in order. A &ikey is the "botton" one presses on
the keyboard. A &ifunction defines the basic unit of Galahad II operation. A
&ikey%definition maps a key into a sequence of functions. An &iINI%file
contains a number of key definitions. A &iprintable%key is a character that
has a printable representation in the ASCII character set. A &istring is a
sequence of arbitrary characters enclosed in double quotes ("). Double quotes
may be included in a string by entering two double quotes ("").
A key definition consists of a key name, an equals sign, the list of
functions separated by spaces, and a semicolon. The case of both the key name
and the function names is insignificant (except for the letter keys, of
course), and whitespace may separate any of the above elements. Literal
characters (letter keys and printable characters) are included by enclosing
them in double quotes ("). If a function prompts for input, and a string
follows it in the key definition, the string is used for the input.
Galahad II allows for key prefixes similar to WordStar (tm of MicroPro),
but in a more general fashion. Picture a multiple layer keyboard where most of
your typing occurs on the bottom layer. One or more of the bottom layer keys
allows you to jump to an upper layer, temporarily giving you a whole new set of
keys. Each layer has a single character name, such as A, B, 0, 1, etc. A key
which is in an upper layer is called a &imeta%key.
Galahad II provides an optional set of meta prefixes for all keys. Meta
keys are formed by prefixing the key name with 'm1' through 'm9', and 'mA'
through 'mZ'. These called meta levels, making possible 36 different meta
keyboard levels. A metaized key may be input by executing the key bound to the
desired meta level function before executing the key. The meta keys are bound
by the level key, for example, Esc==MetaKey "1".
WordStar key layout might use three layers B, K, and Q. The ^B, ^K, and
^Q keys would then be assigned to &dMetaKey "B", &dMetaKey "K", and &dMetaKey
"Q" respectively. Then the desired functions would be assigned to meta B, K,
and Q keys. That is, one set of key definitions at meta level K, and another
set at meta level K, etc. To use the definitions at meta level K, the user
would press ^K to access meta level K and then the desired key to cause the
bound function to be executed.
Typically, only the named (unprintable) keys are redefined. The named
keys are listed in Appendix F under &ireserved&iname. Some of the named keys
have shifted versions which may be formed by prefixing the key with an 's',
meaning shifted. Some control keys have names. Any that don't are named by
prefixing the letter by a caret (^). Printable keys are expressed as a key
name by enclosing them in quotes to form a string. The quote character is
included in a string by doubling it, so the name of the quote key is """".
.n10
&oExamples:
UpArrow .t15 The up arrow key.
sUpArrow .t15 The shifted up arrow key.
Return .t15 The return key (Control-M).
^M .t15 Also the return key.
"," .t15 The comma key.
"""" .t15 The quote key.
mReturn .t15 The meta return key.
m"," .t15 The meta comma key.
You now know enough about key definitions to refer to Appendix F, which
contains the GALIBM.INI file. Locate the keys that you are most familiar with,
and find the meaning of the functions that they are assigned to by referring to
Appendix E. The function names have been chosen to have mnemonic meanings so
that extensive help messages are not required.
In your reading of Appendix E, you will notice two "keys" that do not
appear on the keyboard, "Init." and "CmdLF.". The "Init." key is executed once
and only once, just after Galahad II starts executing. This is handy for
configuring the cursor to your liking, setting the screen color, etc. The
other special key, "CmdLF.", is a special rendition of the linefeed key. When
you press linefeed in Command Mode, the "CmdLF." key is executed instead. This
allows you to drop straight from command mode into edit mode with a single
keypress.
There are two ways to create key definitions. You can make a permanent
change by editing the default key definition file and use it to configure
Galahad II, or you can use the &dReadInitBuffer function which changes the key
definitions just this one time. Both of these methods will be discussed in
detail later, but for now we shall use the temporary method which uses
&dReadInitBuffer.
.std3,12,1
An Example Key Definition
.st3,11,1
You should be ready for more advanced key definitions than the ones given
in Appendix F. Say that you use the string "Clarkson University" quite often.
You may wish to assign it to the KP7 key, which is not defined by the
GALIBM.INI file. You first create an empty buffer by executing the command NEW
(Press <RETURN>, and enter NEW), then enter the following key definition:
'KP7=="Clarkson University";'. The single quotes are included for your
edification and should not be included in the key definition. Note that the
key definition has the requisite four parts mentioned earlier: Key name (KP7),
equals sign, function ("Clarkson University"), and a semicolon.
Now instruct Galahad II to read the buffer as if it were an INI file by
executing the &dReadInitBuffer function by typing 'ReadInitBuffer' ('read' is
sufficient) at the Command: prompt. If you have made any mistakes then you
will be thrown back into the buffer at the point at which the error occured.
If not then you may press the shift Home key to test your example definition.
In any case, you have &inot made any permanent change to Galahad II so feel
free to make mistakes. The following examples use the same method.
Let's improve on this key definition by including Clarkson's mailing
address on a separate line. The key definition would be: 'KP7=="Clarkson
University" InsertNewline "Potsdam, N.Y. 13676";'. The InsertNewline function
does just that, insert a newline.
Let's keep improving the key definition by posing a problem. Say that we
had indented in a few columns and tried to insert Clarkson's name and address
using the previous key definition (try it). Unfortunately, the address part is
not indented to the same column. We'll fix that by using the TabToPrev
function: 'KP7=="Clarkson University" InsertNewline TabToPrev "Potsdam, N.Y.
13676";'. Now the address part gets tabbed out to the same column as the
previous line started on.
Now for a meta key example. Let's presume that you have no more function
keys to assign for the above example. That is you have defined all possible
keys to have some action. In GALIBM.INI, Esc is bound to m1, that is, meta
level one. By pressing Esc you have opened up a whole new level of keys
available for assignment. In the above example make the assignment:
'm1KP7=="Clarkson University" InsertNewline TabToPrev "Potsdam, N.Y. 13676";'.
Now KP7 has its previous meaning and Esc KP7 will display 'Clarkson University
=......'.
Let's say you wanted a new meta level for yourself. Make the definition:
sKP7==MetaKey "A";
KP7=="Clarkson =.....";
.std3,12,1
Entering Key Definitions
.st3,11,1
As promised earlier, the two methods for entering key definitions will be
explained. The first method involves using ConfPer to permanently affix your
keys to Gal2.
Find the GALIBM.INI file on the distribution diskette. Make another INI
file with your custom key definitions in it. Call it YOURS.INI. Now you are
ready to run the files through ConfPer. When ConfPer prompts you for your INI
file, enter "+YOURS" without the enclosing quote marks. This tells ConfPer to
use both GALIBM.INI and YOURS.INI.
The other method for entering key definitions is to include only your key
definitions in a =.INI file, load that file into Gal2, and execute the
&dReadInitBuffer command. This method can be somewhat clumsy, but is useful
for testing new key definitions.
.std3,12,1
Tidbits
.st3,11,1
Listed below are a few tidbits that are not obvious without carefully
reading the entire documentation.
1) The easiest way to redefine a few keys is to make an INI file
containing just those keys. Test the definitions using &dReadInitBuffer
function. When you are satisfied, use ConfPer with two INI files, GALIBM.INI
and your INI file.
2) Several functions are intrinsically useless and are included just for
compatiblity with Galahad I. &dCommandMode is just that, a mode in which
commands must be entered. It is superceded by &dCommand, which allows the
entry of one command and throws you back into editing after that one command is
executed. &dEditMode is a companion (useless) function to &dCommandMode.
3) &dLoadFile causes the current file to be overlaid with the new file.
Unless you have filled your computer's memory, &dLoadBuffer is more useful
because the new file is loaded into a new buffer and the old file is still
available using &dNextBuffer.
4) &dUserPhrase is a watered-down version of &dRecordKey. Most people
will want to use &dRecordKey because &dUserPhrase will not accept cursor
movement keys.
5) Don't edit an INI file that contains PrinterFont functions in ASCII
mode. This is because the translation of older-style control characters mucks
with the argument to PrinterFont. Instead, enter the command &dBinaryFile
before you load the INI file.
.g2