1.4. Yet Another Line Oriented Editor

Version II.0, February 1979

page063 This text editor is intended for use on systems that do not have powerful screen terminals. It is designed to be very similar to the text-editor which accompanies DEC's RT-11 system. Its name is pronounced: Yaw-loo-ee.

The editor assumes, but is not dependent on, the existence of the workfile text. Upon reading it YALOE will proclaim ‘workfile STUFF read in’. If it does not find such a file, it will proclaim ‘No work file read in’. This means that you entered YALOE with an empty workfile. From this point you may create a file in YALOE; and when you exit by typing ‘QU’, your workfile will no longer be empty.

The editor operates in one of two modes: Command Mode or Text Mode. In command mode all keyboard input is interpreted as commands instructing the editor to perform some operation. When you first enter the editor you will be in the Command Mode. The Text Mode is entered whenever the user types a command which must be followed by a text string. After the command F(ind, G(et, I(nsert, M(acro define, R(ead file, W(rite to file, or eX(change has been typed, all succeeding characters are considered part of the text string until an <esc> is typed. Note: when typed <esc> echoes a ‘$’. The <esc> terminates the text string and causes the editor to re-enter the Command Mode, at which point all characters are again considered commands.

Note: Follow command strings in YALOE with <esc><esc> to execute them. (This is unlike the rest of the systems ‘immediate’ commands.)

1.4.1. Special Key Commands

Various characters have special meanings, as described below. Some of these apply only in YALOE. Many have similar effects in the rest of the system; for these the ASCII code to which the system responds as indicated can be changed using the program SETUP, described in Section 4.3. (<esc> is the most particular anomaly to YALOE.)

<esc>
Echoes a `$`. A single <esc> terminates a text string. A double <esc> executes the command string.

page064 RUBOUT <linedel>
Deletes current line. On hard-copy terminals echoes ‘<ZAP’ and a carriage return. On others, it clears the current line on the screen. In both cases the contents of that line are discarded by the editor.

CTRL H <chardel>
Deletes character from the current line. On hard-copy terminals it echoes a percent sign followed by the character deleted. Each succeeding CTRL H the by the user deletes and echoes another character. An enclosing percent sign is printed when a key other than CTRL H is typed. This erasure is done right to left up to the beginning of the command string. CTRL H may be used in both Command and Text mode.

CTRL X
Causes the editor to ignore the entire command string currently being entered. The editor responds with a <cr> and an asterisk to indicate that the user may enter another command. For example:
*IDALE AND
        KEITH<CTRL X>
        *
A <linedel> would cause deletion of only KEITh; CTRL X would erase the entire command.
CTRL O
Will switch you to the optional character set (i.e. bit 7 turned on). This works only on the TERAK 8510A. The CTRL O is used as a toggle between the character sets. Note: You may find while in the editor that weird characters are showing up on the terminal instead of normal ones. It could be because you accidentally typed CTRL O. To get back just type CTRL O again.

CTRL F <flush>
All output to the terminal is discarded by the system until the next CTRL F is typed.

CTRL S <stop>
All output to the terminal is held until another CTRL S is typed.

All other control characters are ignored and discarded by YALOE.

Command Arguments

page065 A command argument precedes a command letter and is used either to indicate the number of times the command should be performed or to specify the particular portion of text to be affected by the command. With some commands this specification is implicit and no argument is needed; other commands, however, require an argument.

Command arguments are as follows:

n
stands for any integer. It may be preceded by a + or -. If no sign precedes n, it is assumed to be a positive number. Whenever an argument is acceptable in a command, its absence implies an argument of 1 (or -1 if only the - is present).

m
m is a number 0..9.

0
‘0’ refers to the beginning of the current line.

/
‘/’ means 32700. ‘-/’ means -32700. It is useful for a large repeat factor.

=
‘=’ is used only with the J, D and C commands and represents -n, where n is equal to the length of the last text argument used, for example *GTHIS$=D$$ finds and removes THIS.

1.4.3 Command Strings

All EDIT command strings are terminated by two successive <esc>s. Spaces, carriage returns and tabs (CTRL I) within a command string are ignored unless they appear in a text string.

Several commands can be strung together and executed in sequence. For example:

*B GTHE INSERTED$ -3CING$ 51< GSTRING$$

page066 As a rule, commands are separated from one another by a single <esc>. This separating <esc> is not needed, however, if the command requires no text. Commands are terminated by a single <esc>; a second <esc> signals the end of a command string, which will then be executed. When the execution of the command string is complete, the editor prompts for the next command with “*”.

If at any point in executing the command an error is encountered, the command will be terminated, leaving the command executed only up to that point.

1.4.4 The Text Buffer

The current version of your text is stored in the Text Buffer. This buffer's area is dynamically allocated; its size and the room left for expansion may be ascertained by using the ? command.

The editor can only work on files that fit entirely within the Text Buffer.

1.4.5 The Cursor

The “cursor” is the position in your text where the next command will be executed. In other words it is the current “pointer” into the Text Buffer. Most edit commands function with respect to the cursor:

A, B, F, G, J:
Moves it.

D, K:
Remove text from where it is.

U, I, R:
Add text to where it is.

C, X:
Remove and then add text at it.

L, V:
Print the text on the terminal from it.

1.4.6 Input/ Output Commands

L(ist

The L(ist command prints the specified number of lines on the console terminal without moving the cursor.

*-2L$$
Prints all characters starting at the second preceding line and ending at the cursor.

page067 *4L$$
Prints all characters beginning at the cursor and terminating at the 4th <cr>.

*0L$$
Prints from the beginning of the current line up to the cursor.

V(erify

The V(erify command prints the current text line on the terminal. The position of the cursor within the line has no effect and the cursor is not moved. Arguments are ignored. The V(erify command is equivalent to a 0LL (list) command.

W(rite

The W(rite command is of the form

*W<file title>$
File title is any legal file title as decried in section 1.2 less the file type. The editor will automatically append a ‘.TEXT’ suffix to the file title given unless the file title ends with ‘.’, ‘]’, or ‘.TEXT’. If the filename ends in a ‘.’, the dot will be stripped from the filename. Refer to Figure 2 in section 1.2.14 for details on filename specifications.

The W(rite command will write the entire Text Buffer to a file with the given file title. It will not move the cursor nor alter the contents of the Text Buffer. If there is no room for the Text Buffer on the volume specified in the file title given, the message:

OUTPUT ERROR. HELP!
will be printed. It is still possible to write the Text Buffer out by writing it to another volume.

R(ead:

The R(ead command is of the form

*R<file title>$
The editor will attempt to read the file title as given. In the event no file with that title is present, a ‘.TEXT’ is appended and a new search is made.

The R(ead command inserts the specified file into the Text Buffer at the cursor. The cursor remains in the Text Buffer before the text inserted. If the file read in does not fit into core buffer, the entire Text Buffer will be undefined in content, i.e. this is an unrecoverable error.

page068 Q(uit

The Q(uit command has several forms

QU
Quit and update by writing out a new SYSTEM.WRK.TEXT

QE
Quit and escape session; do not alter SYSTEM.WRK.TEXT

QR
Don't quit; return to the editor

Q
A prompt will be sent to the terminal giving all the above indices; enter option mnemonic (U, E, or R) only.

Executing the QU command is a special case of the write command, and the attempt to write out SYSTEM.WRK.TEXT may fail. In this case use the W command to write out your file and then QE to exit the editor.

The QR command is used on the occasions when a Q is accidentally typed, and you wish to return to the editor rather than leave it.

E(rase:

The E(rase command (intended for CRT terminals) erases the screen.

1.4.7 Cursor Relocation Commands

When using character and line oriented commands, a positive (n or +n) argument specifies the number of characters or lines in a forward direction, and a negative argument the number of characters or lines in a backward direction. The editor recognizes a line of text as a unit when it detects a <cr> in the text.

Carriage return characters are treated the same as any other character. For example assume the cursor is positioned as indicated in the following text (^ represents the current position of the cursor and does not appear in actual use. It is present here only for clarification):

THERE WAS A CROOKED MAN^<cr>
AND HUMPTY DUMPTY FELL ON HIM<cr>

J(ump:

The J(ump command moves the cursor over the specified number of characters in the Text Buffer. The edit command -4J moves the cursor back 4 characters.

THERE WAS A CROOKED^ MAN<cr>
AND HUMPTY DUMPTY FELL ON HIM<CR>

page069 The command 10J moves the cursor forward 10 characters and places it between the ‘H’ and the ‘U’.

THERE WAS A CROOKED MAN<cr>
AND H^UMPTY DUMPTY FELL ON HIM<cr>

A(dvance

The A(dvance command moves the cursor a specified number of lines. The cursor is left positioned at the beginning of the line.

Hence the command 0A moves the cursor to the beginning of the current line.

THERE WAS A CROOKED MAN<cr>
^AND HUMPTY DUMPTY FELL ON HIM<cr>
The command -1A (or -A) moves the cursor back one line.
^THERE WAS A CROOKED MAN<cr>
AND HUMPTY DUMPTY FELL ON HIM<cr>

B(eginning

The B(eginning command moves the cursor to the beginning of the Text Buffer. Use /J to move to the end of the buffer. Search commands are used to locate specific characters or strings of characters within the Text Buffer.

G(et and F(ind:

The G(et and F(ind commands are synonymous. Starting at the position of the cursor, the current Text Buffer is searched for the nth occurrence of a specified text string. A successful search leaves the cursor immediately after the nth occurrence of the text string if n is positive and immediately before the text string if n is negative. An unsuccessful search generates an error message and leaves the cursor at the end of the Text Buffer for n positive and at the beginning for n negative.

*BGstring$=J$$
This command string will look for the string string starting at the beginning of the Text Buffer; and if found it will leave the cursor immediately before it.

1.4.8 Text Modification Commands

I(nsert

The I(nsert command causes the editor to enter the TEXT mode. Characters are inserted immediately following the cursor until an <esc> is typed. The cursor is positioned immediately after the last character of the insert. Occasionally with large insertions the temporary insert buffer becomes full. Before this happens a message will be printed on the console terminal, ‘Please finish’. In response page070 type two successive <esc>s. To continue, type ‘I’ to return to the Text mode.

Note: Forgetting to type the ‘I’ command will cause the text entered to be executed as commands.

D(elete:

The D(elete command removes a specified number of characters from the Text Buffer, starting at the position of the cursor. Upon completion of the command, the cursor's position is at the first character following the deleted text.

*-2D$$
Deletes the two characters immediately preceding the cursor.

*B$FHOSE $=D$$
Deletes the first string ‘HOSE ’ in the Text Buffer, since =D used in combination with a search command will delete the indicated text string.

K(ill:

The K(ill command deletes n lines from the Text Buffer, starting at the position of the cursor. Upon completion of the command, the cursor's position is the beginning of the line following the deleted text.

*2K$$
Deletes characters starting at the current cursor position and ending at (and including) the second <cr>.

/K$$
Deletes all lines in the Text Buffer after the cursor.

C(hange:

The C(hange command replaces n characters, starting at the cursor, with the specified text string. Upon completion of the command, the cursor immediately follows the changed text.

*0CAPPLES$$
Replaces the characters from the beginning of the line up to the cursor with ‘APPLES’, (equivalent to using 0X).

*BGHOSE$=CLIZARD$$
Searches for the first occurrence of ‘HOSE’ in the Text Buffer and replace it with ‘LIZZARD’.

eX(change:

The eX(change command exchanges n lines, starting at the cursor, with the indicated text string. The cursor remains at the end of the changed text.

page071 -5Xtext$$
Exchanges all characters beginning with the first character on the 5th line back and ending at the cursor with the string ‘text’.

0Xtext$$
Exchanges the current line from the beginning to the cursor with the string ‘text’ (equivalent to using 0C).

/Xtext$$
Exchanges the lines from the cursor to the end of the Text Buffer with the text ‘text’ (equivalent to using /C or /DI).

1.4.9 Other Commands

S(ave

The S(ave command copies the specified number of lines into the Save Buffer starting at the cursor. The cursor position does not change, and the contents of the Text Buffer are not altered. Each time a S(ave is executed, the previous contents of the Save Buffer, if any, are destroyed. If executing the S(ave command would have overflowed the Text Buffer, the editor will generate a message to this effect and not perform the save.

U(nsave

The U(nsave command inserts the entire contents of the Save Buffer into the Text Buffer at the cursor. The cursor remains before the inserted text. If there is not enough room in Text Buffer for the Save Buffer, the editor will generate a message to this effect and not execute the unsave.

The Save Buffer may be cleared with the command 0U.

M(acro

The M(acro command is used to define macros. A maximum of ten macros, identified by the integer (0..9) preceding the ‘M’, are allowed. The default number is 1. The M(acro command is of the form:

mM%command string%
This says to store the command string into Macro Buffer number m, where m is the optional integer 0..9. The delimiter, `%` in this example, is always the first character following the M command and may be any character which does not appear in the macro command string itself. The second occurrence of the delimiter terminates the macro.

All characters except the delimiter are legal Macro command string characters, including single <esc>s. All commands are legal in a macro command string. Example of a macro definition: page072

5M%GBEGIN$=CEND BEGIN$V$%$$
This defines macro number 5. When macro number 5 is executed, it will look for the string ‘BEGIN’, change it to ‘END BEGIN’, and then display the change.

If an error occurs when defining a macro, the message

Error in macro definition
will be printed, and the macro will have to be redefined.

The execute macro command, N, executes a specified macro command string. The form of the command is:

nNm$
Here n is simply any command argument as previously defined; m is the macro number (an integer 0..9) to be executed. If m is omitted, 1 is assumed. Because the digit m is technically a command text string, the N command must be terminated by an <esc>.

Attempts to execute undefined macros cause the error message ‘Unhappy macro’. Errors encountered during macro execution cause the message ‘Error in macro’. Errors encountered in macro command syntax cause the message ‘Error in macro definition’.

Help:

The ? command prints a list of all the commands and the sizes of the Text Buffer, Save Buffer, and available memory left for expansion. It also lists the numbers of the currently defined macros.

page073 1.4.1O Summary of All Commands

n - an argument, m - macro number

nA Advance the cursor to the beginning of the nth line from the current position.
B Go to the Beginning of the file.
nC Change by deleting n characters and inserting the following text. Terminate text with <ese>.
nD Delete n characters.
E Erase the screen.
nF Find the nth occurrence from the current cursor position of the following string. Terminate string with <esc>.
nG Get, same as Find.
H - invalid -
I Insert the following text. Terminate text with <esc>.
nJ Jump cursor n characters.
nK Kill n lines of text. If current cursor position is not at the start of the line, the first part of the line remains.
nL List n lines of text.
mM Define macro number m.
nMn Perform macro number m, n times.
O - invalid -
P - invalid -
Q Quit this session, followed by:
U(pdate Write out a new SYSTEM.WRK.TEXT
E(scape Escape from session
R(eturn Return to editor
R Read this file into buffer (insert at cursor); ‘R’ must be followed by <file name> <esc>
Warning: If the file will not fit into the buffer, the content of the buffer becomes undefined!
nS Put the next n lines of text from the cursor position into the Save Buffer.
T - invalid -
U Insert (Unsave) the contents of the Save Buffer into the text at the cursor; does not destroy the Save Buffer.
V Verify: display the current line
W Write this file (Iran start of buffer); ‘W’ must be followed by <filename> <esc>.
nX Delete n lines of text, and insert the following text; terminate with <esc>.
Y - invalid -
Z - invalid -
page074
This page last regenerated Sun Jul 25 01:09:11 2010.