INDIVIDUAL EDITING COMMANDS
Move (forward one line) M
The Move command causes the file pointer to be moved from its current
position to the start of the following line.
Attaching a repetition number to a Move command provides a means
of moving forward a fixed number of lines. For example, the
command "M99" issued at the start of the file, causes the pointer
to be moved to the start of the hundredth line in the file.
The command fails if the file pointer is at the very end of the file,
that is, beyond the last line of text.
It is legitimate to Move from the last line in the file to the
end-of-file position, but then further Moves will fail.
Move back (one line) M-
This command causes the file pointer to be moved from its current
position to the start of the previous line.
The command fails if the current line is the first line in the file,
the pointer being moved nonetheless to the start of this line.
Cursor Down }
This command is similar to the Move command, except that the pointer is
moved to the column position in the following line corresponding to its
position in the current line.
The command is typically the definition of a cursor control key.
With this and the other cursor movement commands, the resulting
line position may be beyond the end of the line (that is, to the
right of the last printing character). This is often a temporary
state en route to another position, and so the fact that the
cursor is out in space does not of itself imply any extension of
the line, but if any text is entered in this situation, the gap
between the existing end of the line and the file pointer is
first filled with spaces.
The command fails when the file pointer is on (or beyond) the last line
of the file.
Cursor Up {
This command is similar to the Move Back command, except that the
pointer is moved to the column position in the previous line
corresponding to its position in the current line.
See the notes on Cursor Down (above)
The command fails when the file pointer is on the first line of the
file, and the pointer does not move.
Right-shift (one char) R
This command causes the file pointer to be moved right one character
position.
The command fails if the file pointer is at or beyond the end of the
current line.
Hence "R*" takes the pointer from anywhere within the line to the
right hand end of the line.
Left-shift (one char) L
This command causes the file pointer to be moved left one character
position.
The command fails if the file pointer is at the start of the current
line.
Hence "L*" takes the pointer from any position to the start of
the line.
Cursor Right >
This command is similar to the Right-shift command except that it
permits the file pointer to be moved beyond the end of the line, that
is, beyond the rightmost character on the line.
See the notes on Cursor Down.
The Cursor Right command fails if the file pointer is at or beyond the
maximum line length defined by WIDTH.
Cursor Left <
The Cursor Left command is identical in effect to the left-shift
command. It is provided for reasons of symmetry.
Find TEXT F
The Find command causes the Editor to search forward in the file for
the first occurrence of the specified text string. The search starts
at the current position of the file pointer, except that an occurrence
just at the file pointer which has already been matched, either by Find
or by Uncover or Verify, is ignored.
For example, adding a repetition count to a Find command, as in
"F/cat/3", will locate the third occurrence of the sequence
"cat". The repetition does not have to be in the form of a count
attached to the original command. For example, it is a common
experience to discover, after a Find has been executed once, that
the character sequence chosen in fact appears earlier in the file
than the intended position. In this case the Find command can
simply be repeated, by typing 1 as a repetition command, until
the desired occurrence is reached.
By default the search continues to the end of the file. The scope of
the search may, however, be limited to a particular number of lines
counting from (and including) the current line, by specifying the
number of lines between the command letter and the quoted text.
For example, "F9/cat/" limits the scope of the search to the
current line and the next eight.
The command fails if there is no occurrence of the specified sequence
of characters within the scope of the search. Where the scope is more
than one line, the file pointer is moved to the start of the last line
searched (end-of-file in the case of unlimited scope). Where the scope
is one line, the file pointer is not moved.
Find back TEXT F-
The Find back command is similar in effect to Find except that the
search proceeds backwards through the file. The number of lines to be
searched may be specified between the minus and the text parameter; by
default the search continues to the start of the file.
The command fails if there is no occurrence of the specified text
within the scope of the search, the file pointer ending up at the start
of the last line searched.
Traverse TEXT T
The Traverse command causes the first occurrence of the specified text
to be located and the pointer to be positioned at the right-hand end of
the occurrence, rather than at the start as with Find. The search
proceeds as for Find except that the default scope is confined to the
current line and that an occurrence of text already matched is not
ignored.
The command fails if there is no occurrence of the text string within
the scope of the search. Pointer movement in the case of failure is
exactly as for Find.
Verify TEXT V
The Verify command neither moves the file pointer nor alters the
content of the file. It succeeds if the sequence of characters
immediately to the right of the file pointer matches the text
specified; otherwise it fails.
The Verify command only has a use in conjunction with programmed
commands (see the section on this topic).
Delete TEXT D
The Delete command causes the first occurrence of the specified text to
be located and then deleted, leaving the file pointer at the site of
the deletion. The search proceeds as for Find, except that the default
scope is confined to the current line, rather than the rest of the
file, and an occurrence of text already matched is not ignored.
The command fails if there is no occurrence of the specified text
within the scope of the command. Pointer movement in cases of failure
is exactly as for Find.
Insert TEXT I
This command has the effect of inserting the text specified to the left
of the file pointer. The text parameter which follows the letter "I"
may take any of the following forms:
quoted text between delimiter characters
a text macro letter ('X'-'Z' or 'x'-'z')
the ditto character
the exclamation-mark
The last-mentioned case ("I!") provides a direct-entry capability for
inserting a text string within a line. The text to be inserted is
requested when the Insert command is executed, with the video cursor at
the position of the file pointer. The normal way of terminating the
text is with RETURN; if any other control key is used as a terminator,
it causes the command sequence currently being executed to be abandoned
and the control key to be treated as a new command. This applies also
to the use of this form for the other insertion commands (Overwrite,
Substitute, and Get).
For the direct-entry form, in most implementations, a certain
amount of space is opened up at the position of the file pointer
to permit the text to be typed in. Then when the terminating key
is pressed, the line is closed up again. In some
implementations, no space is opened up, and the line
automatically accommodates each character as it is typed.
For typing convenience, the Editor relaxes some of the syntactic rules
for all the insertion commands (Insert, Overwrite, Substitute and Get),
but not for the text matching commands. The closing delimiter in the
case of quoted text may be omitted if the text string is the last thing
in a command line and the exclamation-mark indicating the direct-entry
case may be omitted provided that no ambiguity could arise (that is,
provided the immediately following character is not one of the text
macro letters).
Specifying a repetition count with Insert is a convenient way of
inserting multiple characters, typically spaces.
Insert fails if adding the text would cause the part of the line to the
left of the pointer to exceed the maximum line length (as defined by
WIDTH).
Overwrite with TEXT O
The Overwrite command provides a means of replacing existing text on a
one-for-one basis by new text. It differs from Insert in that one
character is deleted from the file for each character added, except
that if the end of the line is reached, it functions identically to
insertion.
The possible forms of text parameter are as for Insert. The
exclamation-mark form ("O!" or just "O") again provides a
direct-entry capability for a single piece of text. It is useful
only in command mode, since data-entry mode provides that
capability all the time.
The failure condition is the same as for Insert.
Substitute TEXT S
The Substitute command causes the text matched by an earlier Find (or
Uncover or Verify) to be deleted and the text specified as parameter
following the "S" to be inserted.
The operation of substitution involves two text strings, one to
be removed, the other to be inserted. In ECCE the first of these
is established by one command, typically a Find, and the second
is specified as the parameter to Substitute. Thus, for example,
"F/this/ S/these/" will alter the first occurrence of "this" to
"these". One advantage of splitting the function between two
commands is that they can be issued independently and the effect
of the Find checked before giving the Substitute.
Substitute fails if the last positioning action was not a Find, Uncover
or Verify, or the effect of inserting the text would exceed the maximum
line length permitted by the Editor.
Get TEXT (one line) G
The Get command causes the text specified to be inserted as a complete
line above the current line. The file pointer is moved to the start of
the current line if it is not already there, but this remains the
current line.
The Get command is the way in which complete lines are inserted
in a file. The most frequently used form is "G!" (or "G"). In
this case the text is not embedded in the command as a text
string, but is requested when the Get is executed by the Editor.
A repeated Get expects a fresh line each time; it does not cause
the first line typed to be inserted again. Thus "G!5" (or "G5")
causes five lines to be requested and inserted, in the order
typed, above the current line.
The Get command fails if the line typed in starts with a colon.
The failure condition is an arbitrary convention, which may be
used to cause a repeated Get to terminate. In particular, it
permits the use of "G!*" (or "G*") to insert an indefinite number
of lines (which it would be inconvenient to have to count).
Kill & Kill back K K-
The Kill command "K" causes the whole of the current line to be
deleted. The file pointer is left positioned at the start of the
following line.
Kill does not simply erase all the characters on a line leaving
it blank; it removes the line altogether. Kill followed by Get
(eg "KG" or "K2G3") is a common command sequence when replacing a
number of complete lines by other complete lines.
The command fails if the file pointer is at the end of the file.
The Kill back command "K-" causes the whole of the line before the
current line to be deleted. The file pointer is moved to the start of
the current line.
The command fails if the current line is the first line in the file,
the pointer being moved nonetheless to the start of this line.
Erase (one char) E E-
The Erase command "E" causes the character immediately to the right of
the file pointer to be deleted
The command fails if the file pointer is at or beyond the end of the
current line.
Hence "E*" erases all characters on the line to the right of the
pointer.
The Erase back command "E-" causes the character immediately to the
left of the file pointer to be deleted.
The command fails if the pointer is at the start of the line.
Hence "E-*" erases all characters to the left of the pointer.
Case-change (char) C
If the character immediately to the right of the file pointer is a
letter of the alphabet, the Case-change command alters it to the
corresponding letter in the other case, so that upper is mapped to
lower and lower to upper. Whether the character is a letter or not,
the pointer is moved one position to the right.
The command fails if the pointer is at or beyond the end of the current
line.
Hence "C*" changes the case of all letters to the right of the
pointer on the current line.
Uncover TEXT U
The Uncover command causes the first (or next) occurrence of the
specified text to be located and all the material between the position
of the file pointer at the start of the command and the occurrence of
the text to be deleted. The text itself is not deleted. The search
proceeds as for Find, except that the default scope is confined to the
current line.
The Uncover command is applicable where it is most convenient to
specify a deletion as 'up to' a particular character or sequence
of characters. With an explicit scope, Uncover can delete part
of the starting line, a number of complete lines, and an initial
part of the line in which the string is located.
The command fails if there is no occurrence of the text string within
the scope of the search. In the case of the default scope (current
line only), the pointer is not moved and the line is not changed. In
the case of a multi-line search, failure results in deletion of all
material between the initial position of the pointer and the start of
the last line searched, which is where the pointer ends up.
An unlimited search can be specified by means of "U*".
Break (line in two) B
This command causes the current line to be split in two at the position
of the file pointer; the second part becomes the current line.
Break creates two lines from one. One of its uses is to split
lines which may have become undesirably long as a result of
insertions.
Break with the pointer at the start of a line creates a blank
line above the current line.
There is no natural failure condition for this command; implementations
generally impose an upper limit on the number of times it may be
repeated.
Join (two lines) J
This command causes the following line to be appended to the current
line, that is, it creates one line from two.
The command fails if the current line already exceeds the length
defined as the maximum line width. In the case of failure the pointer
is positioned at the end of the current line.
Insert/Get back I- G-
The commands "I-" and "G-" re-introduce material which has been deleted
from the file, the insertion being made at the position at which they
are executed, which may or may not be the position at which the
material was deleted. The order of recovery is the reverse of the
order of deletion, and, in tune with this, these commands leave the
file pointer in front of, rather than after, the newly inserted
material. The use of these commands at a different site from that at
which the material was deleted is the basic technique in ECCE of moving
blocks of text from one position to another.
The command "I-" restores a single deleted character from the last
alteration site in the file. The last alteration site is the position
in the file at which a sequence of contiguous insertions and deletions
was last carried out. All the material deleted at this site is
eligible for insertion. It fails if there are no remaining deleted
characters from that site.
For example, the command "I-0" brings in at any point all the
text deleted at the last alteration site, and the sequence "ERI-"
(Erase, Right, Insert back) reverses the order of a pair of
characters.
The command "G-" restores a complete deleted line. All complete lines
deleted from the file at any time in the course of the edit are
available for recovery, not just those removed at the last alteration
site. It fails if there are no further deletions to be restored.
For example, "KMG-" (Kill, Move, Get back) reverses the order of
a pair of lines.
Overwrite back O-
The command "O-" is an 'undo' command which can both restore material
just deleted and remove material just inserted. It operates at the
last alteration site in the file, irrespective of the position of the
file pointer at the time the "O-" is executed. The last alteration
site is the position in the file at which a sequence of contiguous
insertions and deletions was last carried out. All the material
deleted at this site is eligible for re-insertion, and all the inserted
material is eligible for removal.
Each execution of the "O-" command removes a single inserted character
or line break and/or restores a single deleted character or line break.
It fails if neither of these operations is possible. Hence "O-*"
removes the effect of all the alterations at the site.
Print P
The Print command is used solely to achieve feedback from the Editor.
It causes the current line to be displayed, and, if repeated, causes a
Move to the following line.
Next/previous unit N N-
The Next command "N" locates the next word or matching punctuation
symbol in the file to the right of the file pointer. If the character
currently to the right of the pointer is a letter or digit or a space,
or the pointer is at the end of the line, the pointer is moved to the
beginning of the next word, where a word is defined as a sequence of
alphanumeric characters (letters or digits) not preceded by an
alphanumeric character. If the character is a left bracket (round,
square or curly), the pointer is moved to the corresponding right
bracket, taking account of nested occurrences of bracket symbols. If
the character is any other symbol, the pointer is moved to the next
occurrence of that symbol. In all cases, the unit located is regarded
as having been matched by a text search (so that Substitute is valid,
for example).
The command fails if there is no occurrence of the appropriate kind of
unit before the end of the file.
The Next back command "N-" locates the previous unit in the file, a
unit being defined as for Next (above), with the role of left and right
brackets reversed.
It fails if there is no unit of the appropriate kind before the
beginning of the file.
Query Spelling Q
The Query command is used to invoke a check on the form of the text
starting at the current position of the file pointer. The nature of
the check currently implemented is a simple spelling error detection.
This is done by comparing words with entries in a limited dictionary of
written English.
The command fails if the check fails. Repeated execution implies
advancing to the next unit for checking. Hence the command "Q*" causes
the check to be performed on successive words until one fails, or the
end of the file is reached.
Move to line number n #n
This command causes the file pointer to be moved from its current
position to the start of the line specified.
Lines are numbered from 1 at the start of the file and the
numbers relate to the current state of the file, not its state at
the start of editing. If no line number is specified in the
command, one is requested at the time the command is executed.
The command is executed as a Move or Move back as appropriate, and
fails as for Move if the line number is too big.
Note that the parameter <n> is not a repetition count.
Increment number by n +n
The Increment command (plus-sign) is used to add the value specified by
<n> to the first number to the right of the pointer on the current
line. For this purpose, a number is any sequence of decimal digits, or
a single letter.
This command is most useful when it is required to adjust more
than one number by a constant amount. The value 1 is understood
if <n> is omitted. The form "+-" may be used to specify a
negative increment. Letters are included to cover the case where
they are used to 'number' paragraphs.
The command fails if there is no number to the right of the pointer on
the current line, or the increment specified would take the item out of
range.
Note that the parameter <n> is not a repetition count.
Adjust line length A
The Adjust command is provided to simplify the task of maintaining a
reasonably uniform line length within running text. In brief, it has
the effect of breaking over-length lines and extending under-length
lines by bringing up words from succeeding lines. The line length
applied is as defined by the parameter WIDTH, and the left margin as
defined by MARGIN
The detailed specification which follows is quite complicated.
The main points to note are:
a single Adjust will make the current line an acceptable length
and leave the file pointer at the start of the (perhaps revised)
following line;
A* will (try to) produce adjusted lines up to the end of a
paragraph, a paragraph being understood to terminate with a blank
line (or end of file).
(a) If the end of the file has been reached, the command fails with no
effect.
(b) If the current line (to the right of any margin) is blank, it is
not changed and the file pointer is moved to the start of the following
line.
(c) If the length of the current line exceeds the defined maximum line
length, the line is broken at the rightmost space character to the
right of the file pointer which leaves a line not exceeding the maximum
length, and a new line is formed from the latter part of the original
line, with an added margin of spaces if MARGIN is non-zero. The file
pointer is left at the effective start of the new line. The command
fails if there is no space character satisfying the condition
specified.
(d) If the length of the current line is not greater than the maximum
length, 'words' from succeeding lines are appended to the current line
until either doing so would exceed the maximum length or a line which
is blank to the right of the margin (or end of file) is reached. The
latter case is a failure condition, but in all cases the file pointer
ends up at the start of the line following the adjusted line.
For the purposes of Adjust, a word is defined to be any sequence
of characters terminated by a space or end of line. Appending a
word implies inserting a space plus the word at the end of the
first line, and removing the word plus its terminating space from
the second line (removing the whole line in the case that the
word is the only word on the line).
At column position n @n
The purpose of the 'at' command is to enable text to be aligned to a
particular column position. The effect is that the part of the current
line to the right of the file pointer is aligned to the column position
specified by <n>. This is achieved by the insertion or deletion of
spaces to the left of the file pointer. In the event that aligning to
the column position specified would cause the length of the line to
exceed the defined maximum line length, <n> is reduced to prevent this.
Columns are numbered from zero upwards, so that, for example, @40
has the natural interpretation of placing text half-way along an
80-column line. Spaces to the right of the file pointer are not
affected by this command, and only space characters immediately
to the left of the file pointer are removed in seeking to align
leftwards.
Using "@" with a large <n> has the effect of right-aligning the
text following the pointer.
The @n command fails if space-deletion fails to achieve correct
alignment.
Note that the number <n> is not a repetition count.
Set Marker ^
Execution of the Set Marker command (caret or circumflex by itself)
causes the current position of the file pointer to be noted for future
reference
The marker set by this command may be utilised, and cancelled, by any
of the following commands:
the Define Macro command
the Revert to Marker command
the Switch Inputs command
A marker is also cancelled if the text surrounding it is deleted from
the file.
Define Macro 'X'...'z' ^n
The Define Macro command (caret with accompanying number) serves to
define one of the six text macro letters ('X','Y','Z','x','y','z') as
selected by <n> (1 to 6 respectively). For example "^2" is used to
define 'Y' and "^6" to define 'z'. The effect is to define the letter
selected to stand for the sequence of text between the set marker and
the current position, or, if no marker is set, the text just matched by
a text matching command. Any existing definition of the letter is
lost, and the marker is cancelled.
Although text parameters typed within commands cannot, for
syntactic reasons, contain line breaks, there is no such
restriction on the definition of macro letters by means of this
command, subject to an overall limit on length imposed by the
implementation. However, multi-line text strings are valid only
for the insertion group of commands, not for the text matching
group.
It is immaterial whether the marker is ahead of the current
position or vice versa.
The command fails if no marker is set and the file pointer is not at a
matched text position.
For convenience, with a marker set, a second Set Marker command
(that is, simple caret without accompanying <n>) is interpreted
as Define Macro defining 'X'.
Revert to Marker =
The Revert command (equals-sign) has the property of restoring the file
pointer to the position established by the last executed Set Marker.
The marker is cancelled.
The command fails if there is no marker set.
Toggle Destruction mode |
Successive execution of this command (vertical bar) alternately enters
or leaves a special mode of operation called Destructive mode. In this
state, any of the movement commands may be used in a destructive sense,
that is in such a way as to delete all the material from the starting
position to the position after executing the move. Existence of the
state is indicated by a special prompt.
Note that actual alteration commands are disallowed in this mode.
The mode is most useful in conjunction with some of the more
specialised movement commands such as Next, Cursor Down and
Query.
Switch Inputs $
This command is used to switch from the main file to the secondary
input or back again. Having switched to secondary input, any of the
location commands may be used to move about within that file, but
alteration commands are not valid. The current position in the two
files is independent and is preserved when a switch is made between the
two. When this facility is used, a separate window is created out of
the screen region used for file display, to show the current part of
the secondary input file.
Apart from providing the facility simply to inspect another file while
editing, the main use of secondary input is to enable material from the
second file to be incorporated in the first. One way of doing this is
to Define text macros to represent pieces of text in the secondary file
and use these as parameters for Insert after switching back to the main
file.
To provide a more convenient way of handling the most common
requirements, the convention is also adopted that if a set marker is
outstanding when a switch is made from secondary input to the main
file, the text from the position of the marker up to the current
position within the secondary file is immediately inserted in the main
file.
For example, incorporating the whole of a secondary file in the main
file can be achieved by moving to the appropriate point in the main
file and then giving the commands (separately or as one command line):
$ ^ M* $
that is, Switch to secondary input, Set Marker, Move to end of file,
Switch back to main file.
Any marker set in the main file is cancelled on switching to secondary
input.