I was going to write something about the internals, but decided you
don't want to know!  This program is hack and should be rewritten
properly, with appropriate kernel support.  Here are some hints on
adding editing commands, if you want to do that.

First, select a name for your routine, and add it to the "command"
array at the top of kbind.c.  Then write a routine to implement the
command and put it in ed.c.  The name of the routine should be the
same as the name of the command, except that dashes should be replaced
with underscores.

The routine will be called with an integer argument specifying the
prefix arg passed to the command, or 1 if there is no prefix arg.
The global variable prefixarg will be nonzero if a prefix argument
was given.  The global variable cmdcharacter will contain the last
character of the key sequence used to invoke the command.  Your
routine should return zero on success and one on failure; the latter
will cause the editor to ring the terminal bell.

The current line being edited is stored in the global variable curline.
Endcurline points to the location after the last character of the
line, "point" points to the character after the cursor, and "mark"
points to the character following the mark.

To modify the line, you probably want to use the routine makespace and
delregion.  Makespace(n) creates space for n characters after the
point, moving the characters following the point to the right.  You
then have to copy characters into the space created.  The yank routine
illustrates its usage.  Be sure to check the return code from
makespace; a nonzero return means that the space could not be created.

Delregion(p, kill) deletes all the characters between the point and
the location pointed to by p.  For example, delregion(endcurline, 0)
deletes all characters between the point and the end of the line.  If
the integer flag "kill" is nonzero, delregion stores the deleted
characters in the kill buffer.

Beyond this, you're on your own!
