
.REPORT ECCE Mark 2 - New facilities
.NUMBER DDTRxxx
.ISSUE 1.0
.AUTHOR Ian Macmillan
.CHAPTER INTRODUCTION
This document describes briefly the new facilities offered that were not
present in ECCE Mark 1. These facilities are still in an early stage of
development and may differ from the final implementation which hopefully
will be produced from any feedback received. 
.CHAPTER NEW COMMANDS
.SECTION Overlay (O)
Overlay is a text command similar to insert having a text string argument.
Its effect is to insert the specified text at the position of the file 
pointer overwriting any characters already at that position. The file
pointer is repositioned after the inserted text. Overlay is particularly
usefull for ammending fixed format items such as tables as it does not alter
the position of characters to the right of the overlaid text.

.NJ
.IN+5
=| Item    |  Type  |   Cosr  |
>F/r |/ O/t/
=| Item    |  Type  |   Cost^  |
.IN-5
.JU

The only failure condition results from an attempt to increase the length
of the line beyond the maximum permitted.
.SECTION Highlight (H)
Highlight displays the text surrounding the current line without changing
the position of the file pointer within the file. Appending a number to
Highlight causes the specified number of lines either side of the current
line to be displayed in half-intensity video together with the current line
shown in the normal way. It is similar to the command sequence 'M-n Pn Pn
M-n'except that the file pointer and found status are unaffected. 

.NJ
.IN+5
=Line 4 of ^file
>H2
=Line 2 of file
=Line 3 of file
=Line 4 of ^file
=Line 5 of file
=Line 6 of file
>
.IN-5
.JU
.SECTION Undo
Undo allows an editing change to be 'undone' and is implemented in the
following way. Typing '-number' as the only item on a line will undo the
specified number of complete command lines previously executed. Number
defaults to one and '*' and '0' have their usual meaning. It should be
realised that the number of changes that may be undone is fairly restricted
due to the finite size of the undo log which is held in store. In particular
the maximum number of deleted lines that may be reinstated is around 1000.
If a command can only be partially undone an appropiate error message is
generated.

.NJ
.IN+5
=realised that some ^mistqkes are easily made
>F/tqkes/
=realised that some mis^tqkes are easily made
>s/akes/
=realised that some misakes^ are easily made
>-1                           // wrong change - undo it
=realised that some mis^tqkes are easily made
>s/takes/                     // correct change
=realised that some mistakes^ are easily made

.IN-5
.JU
N.b. In this implementation it may not be possible to undo the last change
made to a line since -1 will reinstate the original contents that existed
when the line was last moved to. i.e. If two seperate changes were made
without an intervening move then -1 will undo both changes.
.SECTION Quote (')
The quote facility allows a particular piece of text to be remembered for
later use so that words in a line may be reordered or duplicated. The 
maximum amount of text that may be remembered using quote is one line
which may be of the maximum permitted length. Quote causes the current
position in the line to be noted. Subsequent use of quote on the same
file line causes the text string defined by the two positions to be
remenbered. To use the remembered text a special form of text string is
defined, this takes the form of the string quote symbol ("). This form of
text string may be used with any of the text commands D, F, I, S, T, U and
V. e.g. i" instead of I/fred/ means insert the most recently defined
text noted using quote (').

.NJ
.IN+5
=123456789
>R0I/*/(F-/*/'L'ER0I")0EP
=987654321

.JU
This rather artificial example reverses the complete file line.
.IN-5
.BP
.SUBSECT Notes on quote
.LIST
.BLOB
The file being edited must not be altered between two uses of '. If it is
the earlier ' is ignored.
.BLOB
A pair of 's can define a null string - subsequent use of " will always
succeed. Inititally the " string is null.
.BLOB
A string can be defined 'the wrong way round'; i.e. the first ' can point
to a position beyond the second ' position.
.BLOB
The " string may be redefined as often as desired.
.ENDLIST
.CHAPTER NEW FACILITES FOR EXISTING COMMANDS
.SECTION Tags
Tags provide the ability to mark a position within the file that may be
refered to by subsequent commands. A tag uniquely defines a position
within a specific line, only one tag may be defined per line, and takes
the form of a single character. This faclility is implemented using a
special form of text string, a commercial at sign (@) followed by the tag
character. Such a text string may be used with any of the text commands. A
tag is set by moving the file pointer to the required place in the file and
then inserting the tag using I@tag e.g. I@A would set the tag A. Tags may
be deleted using D@tag, found using F@tag, changed using S@tag etc.
Searchspace and repetition may be used in the normal way. 

.NJ
.IN+5
=Line of source ^file
>i@A                              // set tag A
=Line of source ^file
>m-0
=Line 1
>f@A                              // search for tag A
=Line of source ^file
>d@A                              // delete tag A
.IN-5
.JU
.SECTION Verify greater than (V+)
This simple modification of the verify (v) command allows much more
powerful text matching. It is implemented as V+/text/ and means succeed
if the specified text is greater than that immediately to the right of the
file pointer. A particular use of this might be to check whether a
character lies within a specific range i.e. if alphabetic. 

E.g. To check for a number use:

(v+/9/,v/9/)(v+/0/\,v/0/)

note the use of comma to provide logical or and backslash to obtain a verify
less than operator.
.CHAPTER NEW ENVIRONMENT COMMANDS
.SECTION Upper and lower case terminal selection
Two special commands %U and %L allow the user to specify the type of
terminal in use. Lower case is the default and means that case is always
significant in text strings. e.g. f/fred/ will only find 'fred' and not
'FRED' or 'Fred'. Specifying upper case only results in a match for any
correct sequence of characters whatever their case. The latter is often
usefull even when the terminal supports both upper and lower case as the
user may not know the case of the required string.
.SECTION Executing system commands
It is possible to execute system commands whilst in ECCE by preceeding the
command with ! as the first character on the command line.
e.g. !STATUS /LP1 ALL 

If several commands are to be executed then the temporary escape to system
faclility may be used. This is invoked by typing ! followed by newline and
will cause ECCE to prompt <Ecce> and route each command to the system.
A line consiting of just carriage return will exit this mode and return to
ECCE.

The last system command may be repeated as often as required by using !!
newline.

A single macro name may follow ! in which case it is first expanded and
then executed as a system command.

.NJ
.IN+5
>!STATUS /LP1 ALL
NOTHING FOUND
>!
<Ecce>OUTPUT /LP1 .FRED
ENTRY NO:   2
<Ecce>
>%x=STATUS CAT1 ALL
>!X
NOTHING FOUND
>!!
NOTHING FOUND
>
.JU
.IN-5
