POW.THE - simulates power typing in The Hessling Editor.

This is the latest version of the POW.THE macro for Mark Hessling's
THE editor.  Its purpose is to provide a means of inputting text in
THE in a manner similar to the power typing mode in the VM/CMS version
of XEDIT (or at least my memory of how it operated 5 years or so
ago.).

After putting the POW.THE command in your macro path, you just issue
the POW command from the THE command line and begin typing.  As you
type, the text is inserted directly into the document as the line is
typed indented by the amount of the left margin setting.  It stores
the current line in a working variable and updates any changes to the
line with the REPLACE command.

When you get to the end of the line, POW performs a word wrap based on 
the difference of your right margin setting and the left margin setting
It does this by truncating the current line at the last space before
the margin length, inserting that line into the file (or at the margin
if there are no spaces on the line).  The macro then inserts a new 
blank line in the file and puts the leftover text on that line.

If you press the ENTER key before reaching the end of the line, that
line will be inserted into the document right away and a new blank
line is started.  To exit the macro, you just need to hit return
on a blank line.  To enter a blank line into the text, just precede it
with a space.  While the macro is running, the backspace, del, left
cursor key and ^H (C-H) can all be used to go back one space to the
beginning of the current line (mistakes on lines other than the 
current line must be corrected outside of the POW macro).

I wrote this macro primarily to facilitate my use of THE, but I thought
others might like to try it out.  Currently it has been tested under 
version 2.4 of THE with the Linux and the Win32 versions.  This macro
is mostly useful in the XEDIT compatibility mode due to the behavior
of the ENTER key in that mode.  (In XEDIT mode, if the cursor is in
the filearea and the ENTER key is pressed, the cursor will return to
the command line.  In other compatibility modes, this action will
insert a blank line into the file).

Known issues:

Due to some problems in the way that THE handles the PRESERVE and
RESTORE commands, I had to provide some extra coding to properly
restore my prefix area when the macro terminates.  This code may not
work properly on all systems and may not work in other versions of
THE.

|Also, when setting the reserved line on the screen, it is not
|displayed until there are at least two characters in the workline
|variable that is used to store the working line.

The above problem seems to have dissappeared in my latest update with
the addition of some simple code to display a cursor on the working
line (I appended an underline character to the workline when it is
displayed on the screen.)

All of the keys that I have setup to work as backspace may not work
on all systems.  The keys that I have setup work under the Win32 and 
Linux versions.  

|Warning: pressing a key that does not return an ASCII value with the
|readv command will currently cause the macro to abort with a bad
|arithmetic conversion error.  At this point, POW has no error handling
|and will not restore your previous settings.

The above problem should be fixed in version 0.3 in which I added a
simple routine to trap the problem keys.  POW still has no error
handling so other types of errors may cause the macro to terminate
without restoring settings.

Finally, I usually run THE with XEDIT compatibility (set compat x x
x).  I have tried to test POW in the other compatibility modes and it
seems to work, but I can't make any guarantees on how well it will
behave.

Right now I'm am personally statisfied with the way this macro works
(most of the time at least :).  However, if any one wants to make or
suggest any improvements, I'm willing to try an implement them. 
Please send any feedback to jbeach@freenet.columbus.oh.us.

(This document was created in Win32 THE using the POW macro.)

Revision History:

08/12/97 - First version 0.1.  Works fairly well under Win95 and Linux
           Used a RESERVED line to display the data on the screen
           until the end-of-line condition was met.
09/04/97 - Version 0.2.  Added 'set linend off' to prevent problems
           when the user keys a line containing the linend character.
           ('#' is the default linend character).  Also, appended an
           underline character to the workline to serve as a cursor.
09/05/97 - Version 0.3.  Discovered a bug in the macro that when
           setting the reserved line, if the first word in the 
           workline variable was a valid THE color name, it would
           strip that word from the line and change the line color. 
           Fixed this by setting a default color of white with black
           background in the set reserved command.  Also added a 
           simple routine to trap keys that do not return ASCII 
           values.
09/08/97 - Vesion 0.4.  Totally re-wrote the routine for displaying
           current input line.  Instead of using a reserved line to
           show the current line, the macro now immediately inserts
           line into the file and uses the replace command as changes
           are made.  This completely eliminates the worry about the
           color settings since the previous fix would generate errors
           on versions without color support.  Also, added code so that
           the macro would respect the margin settings in THE.
