perm filename TEACH[NET,GUE] blob sn#024372 filedate 1973-02-12 generic text, type T, neo UTF8
This file is intended to teach the use of the "TV" editor. If
   you read everything sequentially (or in the order specified),
   and do everything several times, you should become proficient
   at using TV very quickly.

NOTATION:
   α means <control>
   β means <meta>
   ⊗ means αβ.
   >> indicates a line which is present for you to play with.
   ! indicates that you should follow the instruction in that
     line (it's usually best to read ahead a few lines first).
   <cr> means carriage return.
   <lf> means line feed.
   <alt> means altmode.
   <bs> means backspace.
   <form> means form-feed.
   always read down unless otherwise instructed.
   CURRENT means the current line (the one with the arrow on the left).

If you get into a state you don't understand, type <alt> first,
   ask questions later.

! Type ⊗P to go on to page 2.
Good for you.

TV has "LINE mode" commands (like ⊗P given above, and more given below),
   "INTRA-line" commands (really the system line editor), and some other
   (INSERT, EXTEND, ATTACH) modes which we'll get to.  All LINE mode commands
   may be invoked using ⊗-modified characters, except for <cr> and <vt>,
   where all α-β combinations are legal, each modifying the meaning of the
   basic command. So these are the only hard ones to get straight.

Almost any LINE command may be preceded by a repeat argument,
   any number of ⊗<digit>s.

Usually a null repeat argument implies a repeat argument of 1.
   Exceptions will be explicitly noted.
   Repeat arguments will be indicated by <rept>

An arrow (← or ↔) in the leftmost column on the screen indicates CURRENT,
   the line you can currently change.  It's probably on the top line now.

<rept><cr> (no α, no β) is the main way of moving the arrow (CURRENT) down.
   It moves CURRENT down <rept> lines, if possible (1 if <rept> is left out).
<rept><vt> (with any combination (including none) of α or β) moves CURRENT
   back up <rept> (or 1) lines.

*** REMEMBER, "!" in column 1 means that you should do this now.
!Type <cr> a few times (NO CONTROL BITS ON THE <cr>!) to see what it does.
!  Try <rept><vt> and <rept><cr>, to observe the effect of <rept>.
!  Then type ⊗P to go on to page 3.
The ⊗P (Page) command, without a repeat argument, goes on to the next
  page.  If a repeat argument is present, the page with that number is
  read. It is only when changing pages (or finishing the edit) that
  changes you have made to this page (with commands to be discussed)
  are recorded in the disk file.  When the new page appears, the file
  has been completely updated, and is safe over any catastrophe short
  of earthquake. Any catastrophe you inflicted on the previous page is
  cast in concrete.

So far, the pages have been short.  It's good to keep them
   fairly short (50-75 lines is a good number), but you can safely
   edit pages up to about 200 lines.  When too many are present,
   TV gracefully collapses, hopefully without ruining the file.

This page is presented to demonstrate more operations which are
   useful on pages longer than 30 lines or so (one screenful).

The ⊗W (Window) command moves the bottom line on the screen to
  the top line, thereby displaying the next screenful of the
  current page. The top line becomes CURRENT.

!Type ⊗W to WINDOW the bottom line (down there↓) to
! the top of the screen.

This line is meaningless, and is included to avoid dead air.
This line is meaningless, and is included to avoid dead air.
This line is meaningless, and is included to avoid dead air.
This line is meaningless, and is included to avoid dead air.
This line is meaningless, and is included to avoid dead air.
This line is meaningless, and is included to avoid dead air.
This line is meaningless, and is included to avoid dead air.
This line is meaningless, and is included to avoid dead air.
This is the bottom line (down here←) (or was).

Thus opening up a whole new world.

!Now type <cr> a few times
 
!  Down to here.

The ⊗J (Jump) command is like ⊗W (Window), except that it doesn't move 
  the bottom line to the top, but instead moves CURRENT to the top. The
  next screenful, starting at CURRENT (which becomes line 1) will be
  visible.  If there are not enough lines left in the page, both ⊗W and
  ⊗J will move lines up only far enough to display the rest of the page
  below CURRENT.

!Type <cr> enough times to reach the line following this one, then 
! type ⊗J to JUMP this line to the top.

⊗L (Last) moves the top line to the bottom, displaying the previous screenful.
  It is the inverse of ⊗W. The bottom line becomes CURRENT.

!READ THE next 2 lines before doing anything!
!  Type ⊗L to move the top line to the LAST, then ⊗J or
!  ⊗W to get back.  Then type <cr> until you pass this line again.

Notice that the asterisks at the top or bottom of the screen
  are replaced by dashes if there are lines in that direction which
  you can't see.  So you can always tell if you are at the beginning,
  at the end, or in the middle of the page.

⊗W and ⊗L accept <rept> arguments.  The command is repeated <rept> times.

Whenever a <cr> or similar command attempts to move to a line
  not on the screen, a few more lines appear at that end of the screen
  so the arrow will have somewhere to go.  Of course, some lines disappear
  from the other end.

!Try it by going to the top or bottom of the page, then go a little further.
!  Come back here after you're done.

The following commands move the arrow (CURRENT) to visible lines. They differ
   from W and friends, in that the lines attached to the arrow don't move
   with it.  They are more like <cr> or <vt> than ⊗W.

⊗T (Top) moves the arrow to the top line, then moves down a few lines if possible.
⊗B (Bottom) moves the arrow to the bottom line, glitching up if possible.
⊗<, ⊗>, ⊗≤, ⊗≥ move the arrow up and down by varying amounts.

!Try all these arrow-moving things, and return to the lines below.

!Type ⊗1⊗P to look at page 1 again (pure nostalgia), then ⊗P your way
!   back to page 4 (the next one)
Type <alt>, inside a line or out, whenever you get into
  trouble.  This will attempt to nullify whatever dumb thing
  you or I did, and get you into a state where you might 
  expect to recover. You will probably soon need this lifesaver.

Now to edit some lines. Characters, which when typed, cause the line
  editor to activate include non-control characters, along with α<space>,
  α<digit>, α<tab>, αI, αS, αK, or αD, and almost all β characters.  These
  characters should be recognizable as those familiar to the line editor
  (some additional α characters also trigger line editing in TV -- these
  are discussed below).

Typing one of these "line-entering" characters (call it `C') causes the text
  of CURRENT to be sent to the line editor (in situ).  It then applies the
  `C' character you typed to the line.  The effect is very much like that of
  the system's <ctrl><cr> (get my last line back): it is as if you had
  typed the text of CURRENT, then <ctrl><cr>, then `C'.

***************************************************************************
*WARNING!!!!! UNLESS THE LINE TO BE CHANGED IS EMPTY (OLD OR BRAND NEW),  *
* ALWAYS WAIT FOR THE LINE EDITOR CURSOR (UNDERLINE) TO APPEAR AFTER YOU  *
* TYPE THE FIRST LINE-ENTERING CHARACTER, AND BEFORE TYPING THE SECOND.   *
* OTHERWISE TIMING PROBLEMS WILL SCREW UP THE EDIT OF THAT LINE.	  *
***************************************************************************

!Get the arrow down to the data (>>) line below, then type any alphabetic
!  character, do some line editing if you wish, followed by a <cr>.
 
>> The first character is not ">" any longer, but " " (fill in the blank)

As you can see, <cr> gets you out of the line, accepts the changes, and
  goes on to the next line.

!Now change the following data line, terminating with <alt>.

>> This line remains invariant under all legal transformations!!

If you type a <rept> before entering the line editor with one of these
  commands, the first non-<rept> character (the line-entering character)
  will be transmitted <rept> times (e.g., ⊗2⊗0α<space> will space out 20
  columns). This allows you to simulate the system line editor's repeat
  feature, even before the line editor has been invoked.

!Practice starting a line edit with αS, β<char>, αD, αK, αI, α<tab>,
!   etc. Get out of αI mode (with α<space> or something) before typing <cr>.
!   Use any line for practice, but there are some just below which you can change
!   without destroying the lesson for tomorrow.

>> One fine high quality practice line.
>> Two fine high quality practice line.
>> Three fine high quality practice line.
>> Four fine high quality practice line.
>> Five fine high quality practice line.

There are some other things you can do while editing a line.
α<cr> terminates the edit of this line, leaves any (inter or intraline) insert
  modes.
β<cr> inserts a carriage return and terminates the line-edit, leaving CURRENT
  pointed at the (new) next line. Some adjustment of spaces and tabs in the
  vicinity is made.
αD, when typed at the end of a line has the effect of deleting the carriage
  return between this line and the next.  WAIT FOR THE CURSOR TO SET UP
  AGAIN BEFORE CONTINUING!  Some adjustment of spaces and tabs in the
  vicinity is made.
If you are in αI insert mode and type <cr>, the <cr> will be inserted 
  (like β<cr>), and you will be in insert mode, editing the (new) line
  (unlike β<cr>).
⊗<vt> terminates the edit, then does a <vt>.
⊗↑ terminates the line edit, then <tab>s to the end of the previous line.
⊗↓ terminates the line edit, then <tab>s to the end of the next line.
Thus you can get out of a line, accepting the changes and proceeding to
  the beginning or end of the next or previous line.
  (The last two also work when you're not editing a line).
⊗V redraws the entire screen.

Try these:
! Go about halfway into a practice line, and type β<cr>.
! α<tab> out to the end of the first of 2 lines, and type αD.  Wait.
!   After the cursor sets up, terminate the edit
! Get into a line, then type αI, some characters, <cr>, **WAIT!** and
!   some more characters.  Then type α<space>, followed by <cr>.
! Get into the second of 3 lines, and type ⊗<vt>.
! Ditto with ⊗↑.
! Ditto with ⊗↓.

If you are editing a line and type a α character which the line editor
  doesn't understand, or a ⊗ character which TV doesn't understand when
  you are not editing a line, the character will be ignored by re-editing
  the line, automatically spacing back out to the column where the illegal
  character was typed. ** WAIT FOR THE CURSOR TO RESET WHEN THIS HAPPENS! **

! Get into a line, and type α# or αA or αJ or something.  Wait for the 
!  cursor to stabilize again (if it doesn't show up, type <esc>R), and
!  observe the result).

If you type a legal ⊗ character while line-editing, however, the line
   will be accepted as edited.  Then the command will be carried out.
   Certain legal commands, (⊗E, ⊗P, ⊗D) are ignored anyway (too dangerous).

! Get into a line, and type ⊗J, or ⊗W, or ⊗≥.  Also try ⊗E, ⊗P, ⊗D.

⊗<cr> puts the editor into line-insert mode.
  In this mode the arrow (over there←) is a double arrow (↔) instead of a
  single one (→). The previous CURRENT has moved down one line,
  creating a vacuum, which you can fill by typing into it.  Each time
  you type <cr>, a new vacuous line will appear, and you will already be
  editing the empty line. YOU NEED NOT WAIT FOR THE CURSOR TO APPEAR BEFORE
  TYPING IN LINE INSERT MODE.  JUST DON'T GET TOO FAR AHEAD.

To leave line-insert mode, type α<cr> to accept the line you're on and
  get out.  α<cr> is also good to terminate αI mode inside a line without
  inserting the carriage return.

You may also leave line-insert mode by typing <alt> (good old <alt>).
  If there is nothing in the line when you type <alt>, the line is deleted
  completely (the next line moves up).  If there are characters in the line
  when you type <alt>, the line will remain, but be empty (the value of that
  line before you started editing it, as usual.

⊗<cr> is legal while line-editing.  It causes the current line to be accepted,
  the arrow to move to the next line, and line-insert mode to be entered.
! Try all this somewhere.

>> perhaps between here
>>    and here

! Continued on page 6.
(Unbridled, continued from page 47)

Mark sighed breathlessly.
"But we must not go on meeting like this", Mary replied
  in a non-sequiturial manner he had long since learned to expect.

 (continued on page 115, column 3).
(TV teacher -- continued from page 4).

<rept>⊗<cr> is different from ⊗<cr>. <rept>⊗<cr> inserts <rept> blank
  lines below the arrow, never actually entering insert mode.  This is
  more efficient than insert mode, when you know about how many new lines
  there will be.
!  Try it.

>> Perhaps between here 
>>  and here.

When you <cr> past the end of a page, new lines are created just ahead of
  you, so you won't fall off.  This is almost, but not quite like insert mode.
!  Try it here, then advance to the next page.
The ⊗E command terminates the edit by updating
  the current page if necessary, then blanking the screen
  and exiting.  Don't try it now, unless you want to waste
  some time getting back here. 
(page)
Welcome back.

<rept>⊗D is fun -- try it on the practice line below.

>> This line doesn't exist.

You are not currently allowed to delete more lines than you can see.

⊗. writes the current page into the disk file, if it has changed.  This
   has the same effect as, but is faster than, the sequence -⊗P⊗P.  It
   is the equivalent of, but again is faster than, the W command in SOS.

⊗Z joins CURRENT with the line after it (deletes the <cr> between them),
   then advances to the line beyond both of the original lines.

⊗Q causes the line just above CURRENT to be duplicated.  The duplicate
   line is then opened for editing.  The effect is similar to that obtained
   by α<cr> when you are not using TV.


SEARCHING
The Repeat argument <rept> may, in most cases, be obtained associatively:
   that is, by specifying some text string to be searched for in order
   to specify a range of lines to be affected.
⊗F, followed by a string of non-activation characters, specifies a search
   string.  This string is used by different commands in different ways:

  ⊗Fsmith<cr> computes the number of lines from the arrow to a line containing
     "smith", using that count as the <rept> factor-- in other words, the arrow
     moves to the line containing "smith". (⊗↓ can replace <cr>).
  ⊗Fsmith⊗D  computes the number of lines as above, then uses the count to
     delete all lines down to, but not including the line with the match.
  ⊗Fsmith⊗<vt> looks backwards in the page, going up rather than down to the
     line with the match. (⊗↑ will also work here).
  ⊗Fsmith⊗J is the same as ⊗Fsmith<cr>⊗J.
  ⊗Fsmith⊗S searches forward, as with ⊗Fsmith<cr>, but starting on the current
     line.  If it finds the string, it moves CURRENT to that line and does
     a ⊗S (see below).  You will be editing the line, with the cursor under
     the "s" in "smith".
  ⊗Fsmith⊗F will find the first subsequent line which matches, then display
     a double arrow (↔) there.  If the line is not on the screen, that line will
     appear at the bottom of the screen, complete with double arrow.  Continued
     ⊗F's will find subsequent matches, or will inform you that none exist.
     The next command (<cr>, αβD, etc.), if it accepts an associative repeat
     argument, will use the number of lines between the current one and 
     the last successful match.
  Thus, ⊗Fsmith⊗F⊗F⊗F<cr> will advance the arrow (→) to the line containing
     the third "smith".
  In other words, ⊗Fstring⊗F gives a preview of what will happen when you 
     actually execute the command which will use the string for a search arg.

  <alt> cancels the current search string, and cancels any repeat factor already
      calculated.  Otherwise, ⊗F with a null string causes the previous value 
      to be used.
  ⊗F never crosses page boundaries.

! Use ⊗F<string>⊗<vt> to find some line above this one.  Then experiment with
!  the other ⊗F goodies.

There is one special use for ⊗F.  TV keeps in a core array the first line
   of each page (with "COMMENT", ";", and "⊗" removed).  If you know the
   contents (or part of it) of the first line of some page, you can type
 ⊗Fcontents⊗P.  This in-core directory will be searched rather than the
   current page.  If a match occurs, the page whose first line matches will
   be read and displayed.  Otherwise nothing at all happens.  If a new page
   is read, ⊗F<cr> will find the next match after the first line (since the
   search string is retained).
 This feature is more useful when you have a directory for your file.  This
   will be explained later.

⊗S tries to find (in the CURRENT line) the string (e.g., smith) used in the
   last ⊗F search.  If it finds it, it enters line-edit mode, with the cursor
   positioned under the first character of that string.

Go on to page 9.
<rept>⊗A (ATTACH) causes <rept> lines (where <rept> may be specified
   with ⊗F) to be deleted from the page, from CURRENT to CURRENT+
   <rept>-1 (up to 50 lines) and placed in a special array, safe from
   harm.  Up to 8 of these lines are also displayed (with "|" along the
   left margin) at CURRENT. These lines remain "ATTACHed", no matter where
   the arrow (which has become a "|" for clarity) is moved.

When lines are attached, a large subset of commands are illegal; Remaining
   legal commands are ⊗A, ⊗C, and arrow-moving commands, for the most part. 
   Legal commands may be experimantally discovered.  In addition, there
   are a few commands which are redefined or unique to ATTACH mode:

 ⊗E -- EXIT Attach mode, and restore the lines to the current page
   (which may be different from the original) in the position they 
   occupy on the screen.
 ⊗K -- exit ATTACH mode, and KILL the attached lines -- they go away.
 ⊗R -- exit ATTACH mode, and REPLACE the attached lines in their original
   page and line.
 <rept>β<space> -- move the entire attached complex right <rept> spaces
   (using tabs and spaces for max efficiency)
 <rept>αD -- move the entire attached complex left <rept> spaces, or until
   a printing character would be deleted in some line.

!Attach some lines and move them around.  Try detaching from them in any of
!  the ways indicated.

>> a practice line.
>> a practice line.
>> a practice line.
>> a practice line.
>> a practice line.
>> a practice line.

<rept>⊗C is identical to ⊗A, except the original lines are not removed from
  the file.  The lines have been COPYd.

⊗R (when no lines are attached) has an effect only if the last ATTACHed 
   lines were αK'd out of existence. This command puts them back where
   they were originally.

!Try it if you must.

The next page describes EXTEND mode.
⊗X enters EXTEND mode for one extend-mode command line.
  Extend mode commands are complete words, which may be
  abbreviated as can commands to the TS monitor (that is,
  you have to type enough characters).  If any parameters
  are required for a command, they should be separated from
  the command by a space. <cr> terminates a command line.
  After the command has been executed, TV reverts to LINE mode.

Extend-mode commands:

DRAW -- Use this when your screen is covered with glitches, garbage,
  etc., after doing an <esc>C to clear it.  All segments of the TV
  screen will be re-displayed.  Otherwise, only those things which
  change are redrawn. This command will happen automatically as soon
  as possible after an <esc> C is typed.
When editing a line, typing <esc>C, followed by ⊗V, will cause a DRAW
  to happen (may not be implemented yet).
! Type <esc>C, <esc>P, ⊗XDRAW<cr>

DDT -- If RAID is present in this version, branches to RAID.  Execute
  BACKαG to return.

DELETE -- deletes the page mark between this page and the next.
! Back up a few pages and try it.

MARK -- inserts a page mark between CURRENT and the line above
  it.  Displays the page on which CURRENT appears.
! Restore the page mark which you deleted.

READONLY -- if in read/write mode, writes the current page if any changes
  were made, then inhibits further writing.  You can modify a page in core,
  but not on the disk.

READWRITE -- if in readonly mode, disables the write-inhibit.

CANCEL -- Reads the current page from the disk, without writing anything
  out.  Cancels any changes to the page since the last time it was written.
 
FIND -- Follow by space, then a string, then a <cr>.
  This is like ⊗Fstring<cr>, except it will cross page boundaries to find
  the line.  The search string for FIND is remembered independently of
  that for ⊗F.
 If, during a FIND search, you decide that you don't want the search to
  be completed, type the sequence "<esc>I".  The search will be terminated
  as soon as possible.  You will be editing some page down the line from
  the original one.  If you have typed something else before the <esc>I, it
  will be treated as the next input -- so it is best in this case to type
  <call>, then CONTINUE, before typing the "<esc>I" sequence.

GO -- Does what ⊗E does, except that, instead of exiting,
  it repeats the last RPG command.  It is like the G command of
  SOS.

SWITCHTO -- This feature was added to allow copying data from one file
to another. Follow SWITCHTO with a space, then an argument string:

 Filename -- TV will begin editing that file.  If lines were attached
             to the cursor, they still are -- this allows "copy" or
             "transfer" operations, so be careful.  You can use "/R",
	     "/nP", "/nL", etc., switches after the file name (see next
	     page and the TVED manual), to further specify the destination.

 #number -- TV has been saving the file names you typed.  #0 will switch
	     to the most recent one, #1 to the next most recent, etc.  #99,
	     or anything greater than have been saved, will edit the least
	     recently edited one.

 <empty> -- SWITCHTO with a blank argument is the same as #0.

 ? -- Your screen will be replaced by a display of the current stack of
	    saved file names, and a description of SWITCHTO commands.
    	    It will then wait for any SWITCHTO command to complete the
	    operation.

 π -- no operation -- normally used after ? to avoid switching.


This document has not been entirely honest in describing the commands. 
   It has made available all the features of the editor, but has not
   necessarily described all the ways in which these features may be
   invoked.  Many commands have optional codings -- most may be called
   using fewer control bits than we have required here.  A complete
   description of TV features is available in the TV manual,
  TVED.DCS[S,DOC].  It is the reference of record for TV.

One page remains (the next one). On it is described the various commands
  one can give to begin editing a file.
Start an edit by typing:

TV filespec<cr>

A <file spec> is:
    <file name, including extensions, p,pns and stuff>{switch}
    where switch can be /R only, for now.

  /R means readonly -- it should be given only if the file has a directory.

  If a p,pn is specified, and not /R, the file will be copied to your area
    (same name).  This is the file you will be editing.

CTV filespec<cr>
  will create a file of the given name (omit p,pn and /R).  It will have
  a directory page, and one more, blank, page.
 ________
 N.B. A directory is a special first page, which is tacked on to the file
   before the first actual data page (unless inhibited), the first time the
   file is edited.  You can edit much faster if you have a directory.
   If the directory is no good (marked invalid, SOS line numbers seen, you
   said /N on input side), you'll get the opportunity to fix it.
 --------

!Type ⊗E, then type TV FOO<cr> (or whatever you called this file).  This will
   create a version of FOO which has a directory.  Then come back to page 12
   (this will be page 12 by then).

! Now you have all the information you need to decide whether you want a
!  directory or not.

More complicated commands, including the one you used to start this edit, are
   described in the TV manual.
				-30-