home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / tedi-os2.zip / TEDI.DOC < prev    next >
Text File  |  1992-01-11  |  70KB  |  1,607 lines

  1.                               TEDI: a Text EDItor
  2.  
  3.                       CTSS, VMS, UNIX, and IBM PC Versions
  4.  
  5.  
  6.                                 Clair W. Nielson
  7.                          Los Alamos National Laboratory
  8.                           Los Alamos, New Mexico 87545
  9.                                   June 1, 1988
  10.  
  11.  
  12.  
  13.          TEDI is a general purpose text editor designed to  be  used  in  a
  14.     variety   of  applications,  including  program  development  and  word
  15.     processing.  All versions contain line-oriented commands which  may  be
  16.     executed  on  all  kinds  of  terminals, including hard-copy terminals.
  17.     Among the advanced line-editing features in TEDI are string and numeric
  18.     registers,  iteration  commands, and command files; these features make
  19.     possible editing programs which can perform complex editing operations.
  20.     A powerful metacharacter manipulation capability is also provided.
  21.  
  22.          Screen  editing  for  selected  terminals  is provided in the VMS,
  23.     UNIX, and IBM PC versions.  Screen editing is generally more convenient
  24.     for entering new text or programs, and for making changes which involve
  25.     several changes in a localized region.  The line editing  commands  are
  26.     often more convenient for making global changes and for quickly finding
  27.     all occurrences of specified patterns.
  28.  
  29.  
  30.  
  31.                                 GETTING STARTED
  32.  
  33.  
  34.          TEDI is a public  file  on  all  Los  Alamos  CTSS  computers  and
  35.     therefore  no  special  arrangements  are necessary for access on CTSS.
  36.     Many system managers have made it public on their UNIX or VMS machines.
  37.     If  this  is  not  the case, you may obtain a copy from the Common File
  38.     System for your own use.  The IBM PC version may also be obtained  from
  39.     CFS.
  40.  
  41.          The   latest   executables  are  stored  in  CFS  respectively  as
  42.     /tedi/ctss/tedi,  /tedi/unicos/tedi,  /tedi/vms/tedi.exe,   /tedi/unix-
  43.     /tedi,  /tedi/sun/tedi,  and /tedi/ibmpc/tedi.exe.  All of these may be
  44.     used after getting them from CFS without any conversion except for  the
  45.     IBM  PC  version.  It is stored in a form suitable for downloading with
  46.     UNIX KERMIT using the "set file type  binary"  option.   Another  file,
  47.     /tedi/vms/tedi.ibm,  is in a form for downloading from VMS KERMIT using
  48.     the same option.  (In order  for  the  VMS  KERMIT  to  work  properly,
  49.     /tedi/vms/tedi.ibm  must be obtained with the CFS utility, not with the
  50.     older MASS utility.)
  51.  
  52.          On VMS it is convenient to define TEDI as a foreign  command.   In
  53.     addition,  VMS  TEDI  will start up faster if "installed" by the system
  54.     manager.
  55.  
  56.     Execution is begun with the command line
  57.  
  58.                                       -2-
  59.  
  60.          TEDI filename <R>
  61.  
  62.          or
  63.  
  64.          TEDI <R>
  65.  
  66.          If TEDI has not been defined as a command on  VMS,  execution  may
  67.     begin with "RUN TEDI" if TEDI.EXE is in your default directory.  On VMS
  68.     you may define your own TEDI command with  the  definition  (presumably
  69.     saved in your LOGIN.COM file)
  70.  
  71.          TEDI:==$(dev):[(dir)]TEDI
  72.  
  73.     where  (dev)  and  (dir) are the device and directory in which TEDI.EXE
  74.     resides.
  75.  
  76.          The symbol "<R>" means return.
  77.  
  78.          In the cases where the filename does not  appear  on  the  execute
  79.     line,  the  most  recently edited file will be assumed.  This file name
  80.     and other parameter settings are saved in a file "TEDI.INI" which is in
  81.     your  home directory or in the root directory of the current drive.  If
  82.     this file does not exist, you will be  asked  for  a  filename  with  a
  83.     prompt.   Successful  opening  of a file will be evidenced by a message
  84.     giving the filename and the number of lines found in the file.   For  a
  85.     new file, the number of lines will be zero.
  86.  
  87.          Any time that TEDI has typed out the command prompt "*" (asterisk)
  88.     you may give any command, including one  of  the  termination  commands
  89.     "END" or "QUIT".  If you have made no changes to the file (for example,
  90.     you  have  just  typed  out  selected  lines)  neither  command  causes
  91.     rewriting  of  any  files.   However,  if  you have made changes, "END"
  92.     causes a new version of the file to be  written  into  your  filespace,
  93.     whereas  "QUIT"  does not, even though changes may have been made.  The
  94.     QUIT exit is appropriate  if  the  changes  were  erroneous.   The  END
  95.     command  saves  part of the working file so that switch settings may be
  96.     restored for the next execution.  The QUIT command does not save switch
  97.     settings  and future executions resume with default values.  If TEDI is
  98.     aborted with the break key on CTSS or CTRL-C on TOPS-10 or VMS, changes
  99.     in  switch settings will not be saved since the "tedi.ini" file has not
  100.     been written.  If the abort is accidental, editing may be resumed  with
  101.     the "continue" command on VMS and by executing the drop-file on CTSS.
  102.  
  103.          The  lines in files edited by TEDI are limited to a maximum length
  104.     of 150 characters, which may include any combination of upper and lower
  105.     case.   TEDI  is  always receptive to either case and single case input
  106.     must be controlled through the use of  locking  keys  on  the  terminal
  107.     keyboard.   While  using  TEDI,  either  the  system  managed  "CTRL-X"
  108.     (LTSS/CTSS) or "DEL" (TOPS-10/VMS), or the internally managed  "CTRL-H"
  109.     (which  echoes  as  a  backspace) may be used for character erase.  The
  110.     line erase is "CTRL-Y" (CTSS), "CTRL-U" (VMS), or "ESC" (IBM  PC).   On
  111.     UNIX  these  characters  are  set by parameters in your login file.  To
  112.     abort multiple-line commands use "CTRL-Z" followed by a return  (CTSS),
  113.     "CTRL-Z"  alone  (VMS,  IBM  PC),  or  "CTRL-D"  (UNIX).   To terminate
  114.     excessive type-out, enter "CTRL-E, i, return" (CTSS) or "CTRL-O" (VMS).
  115.                                       -3-
  116.  
  117.     If  the  type  out is from a verification, the update will be completed
  118.     even though the verification stops.
  119.  
  120.  
  121.  
  122.                              TWELVE BASIC COMMANDS
  123.  
  124.  
  125.          TEDI has a large instruction set  designed  to  allow  experienced
  126.     users to carry out complex editing operations with a minimum of effort.
  127.     However, the following subset of commands will be sufficient  for  most
  128.     editing operations and should at least be sufficient for a new user.
  129.  
  130.                                 Line Replacement
  131.  
  132.     IALm/text/text/.../.   Insert After Line    Add text after line m.
  133.     IBLm/text/text/.../.   Insert Before Line   Add text before line m.
  134.     DLm,n                  Delete Lines         Delete Lines m through n.
  135.     RLm,n/text/text/.../.  Replace Lines        Replace m through n
  136.                                                 with text.
  137.     CAi,j,m                Copy After           Copy lines i through j
  138.                                                 after line m.
  139.  
  140.                               Pattern Replacement
  141.  
  142.     RPm,n/pat/newpat       Replace Pattern      Replace pattern in lines m
  143.                                                 through n.
  144.     DPm,n/pat              Delete Pattern       Delete pattern in lines m
  145.                                                 through n.
  146.  
  147.                                 Type and Search
  148.  
  149.     Tm,n                   Type                 Type lines m through n.
  150.     TAm,k                  Type After           Type k lines after line m.
  151.     TPm,n/pat              Type Pattern         Type lines from m to n with
  152.                                                 pattern.
  153.     TPA/pat                Type Pattern After   Type next line having
  154.                                                 Pattern.
  155.     TPB/pat                Type Pattern Before  Type previous line with
  156.                                                 pattern.
  157.  
  158.  
  159.          In  the representations of commands and their arguments above, the
  160.     slash represents either a return, in which case the editor will  prompt
  161.     for  additional input with the prompt shown in quotations, or a logical
  162.     line feed character (for which the  slash  itself  is  suitable  if  no
  163.     actual slashes are to be entered as text or pattern), in which case the
  164.     additional input is typed in on the same line with the command.
  165.  
  166.          The following represent examples of these commands.  Remember that
  167.     these  commands  must  be  entered  immediately  after  an asterisk "*"
  168.     prompt.  If any other prompt is given, something other than  a  command
  169.     is  called  for  as  will  be described shortly.  The examples show the
  170.     variation in punctuation possible for  numeric  line-number  arguments.
  171.                                       -4-
  172.  
  173.     The  examples  also reveal that commands may be entered in either upper
  174.     or lower case.
  175.  
  176.          *T 1 5 <R>     (Type out lines 1 through 5)
  177.  
  178.          *dl10,11 <R>   (Delete lines 10 and 11)
  179.  
  180.          *rp10/x/y      (Replace x's with y's in line 10)
  181.  
  182.          *IAL 3 <R>     (Enter text mode to insert new text after line 3)
  183.  
  184.          *tp*/Chapter   (Type out all occurrences of "Chapter")
  185.  
  186.          *END <R>       (Terminate making a new version of the file)
  187.  
  188.          *quit <R>      (Terminate discarding any changes)
  189.  
  190.  
  191.  
  192.                                  COMMAND FORMAT
  193.  
  194.  
  195.          Commands consist of  a  string  of  letters  followed  by  numeric
  196.     arguments.   Most  of  the  time  the letters are abbreviations for the
  197.     command name.  The "END" and "QUIT" commands are  exceptional  in  that
  198.     the entire command word is typed in.  Examples of command abbreviations
  199.     are "T" for Type,  "IAL"  for  Insert  After  Line,  "RP"  for  Replace
  200.     Pattern,  and  "DL"  for  Delete  Lines.   Up to four numeric arguments
  201.     follow the command abbreviation.  The numeric arguments may in  general
  202.     represent  a  variety  of  things, but most often the first two numbers
  203.     represent the first and last line numbers of a range of lines to  which
  204.     the operation is to be applied while the third and fourth represent the
  205.     beginning and ending column numbers between which pattern  matches  are
  206.     to  be  considered.   For  example, "RP15,20,1,7" replaces a pattern in
  207.     lines 15 through 20 if it occurs in columns 1 through 7.  Other uses of
  208.     these   numeric   arguments  are  described  in  the  detailed  command
  209.     descriptions.  Note that among the basic dozen commands, the Copy After
  210.     command,  CAi,j,m  uses  the first two arguments as source line numbers
  211.     and the third as a destination line number.  The  punctuation  for  the
  212.     numeric  arguments  is flexible.  The first number may come immediately
  213.     after the command abbreviation without a space, or it may be  separated
  214.     from  the  abbreviation  by  one  space.  The subsequent numbers may be
  215.     separated by either spaces or commas.
  216.  
  217.          Defaults apply to all numeric arguments and are invoked by  simply
  218.     omitting the argument.  To default an early argument while specifying a
  219.     later argument explicitly, successive commas are used.  The default for
  220.     the  line  number arguments is the current line, which is the last line
  221.     on which a change or type-out occurred.  (The exception is  the  source
  222.     line  range  in  file  copy  and write commands CFA, CFB, WF, W, and WR
  223.     which default to the entire file.) The  default  column  range  is  one
  224.     through  150,  i.e.,  the entire line.  The default for count arguments
  225.     such as the number of lines k in the Type After  command,  "TAm,k",  is
  226.     one line.
  227.                                       -5-
  228.  
  229.                                   LINE NUMBERS
  230.  
  231.  
  232.          As was stated in the introductory remarks, TEDI uses implicit line
  233.     numbers which denote the current position of a line in the file.  These
  234.     numbers  run  1,  2,  3, ..., ], where "]" is a symbol representing the
  235.     last line in the file.  (This symbol, the right square bracket, may  be
  236.     used  in place of a number in a line number position in a command.) One
  237.     of the properties of such a line number is that it changes if any lines
  238.     before  it  are inserted or deleted.  These line numbers, therefore, do
  239.     not acquire permanent significance in the way that line numbers  do  in
  240.     some  line-oriented  editors.   While  the  constant  changing  of line
  241.     numbers may be inconvenient in some instances, it is simpler not to  be
  242.     concerned  about  whether  the increment is suitable, and it completely
  243.     avoids difficulties associated with copying or moving blocks  of  lines
  244.     with  fixed  line  numbers.   One  trick  to  keep in mind is that if a
  245.     sequence of changes is being made from a single reference listing, when
  246.     the  changes  are made in reverse order from the largest line number to
  247.     the smallest, the line numbers remain valid until all the  changes  are
  248.     complete.   However,  usually  this  is  not  a significant issue since
  249.     context related information will be used  as  the  principal  means  of
  250.     location.
  251.  
  252.  
  253.  
  254.                             SPECIAL INPUT CHARACTERS
  255.  
  256.  
  257.          A  single  return  when in command mode causes the next line to be
  258.     typed.  CTRL-Z return types the previous line.  A blank followed  by  a
  259.     return  types the next ten lines, two blanks followed by a return types
  260.     the next twenty lines, and three blanks followed by a return types  the
  261.     next  thirty  lines.  In any line number argument, a negative number is
  262.     interpreted  relative  to  the  current  line.   In  place  of  numeric
  263.     arguments,  one  may  use  "."  to  reference  the current line, "]" to
  264.     reference the last line in the file, and "*" to represent "a very large
  265.     number".  These symbols and numeric arguments may be joined by plus and
  266.     minus signs.  Thus
  267.  
  268.          T.-5,.+5
  269.  
  270.     types from five lines before the current line to five lines  after  the
  271.     current line,
  272.  
  273.          TA,*
  274.  
  275.     types the rest of the file starting with the next line, and
  276.  
  277.          T]-15,]
  278.  
  279.     types the last sixteen lines in the file.
  280.  
  281.          A  command  (including  its  numeric arguments) and any associated
  282.     strings must be separated from each other by either returns,  in  which
  283.     case  TEDI  will  prompt  for the string arguments, or by a dynamically
  284.                                       -6-
  285.  
  286.     determined logical line  feed  character,  in  which  case  the  entire
  287.     sequence  may  be  entered  on  one  line.   The logical line feed is a
  288.     separator such as ";", "/", or "\" which is given immediately after the
  289.     first  command  on  a  line  and  then applies for the duration of that
  290.     command (perhaps over many lines  for  multiple  line  commands).   For
  291.     example, the multiple line version for a "Type Pattern" is
  292.  
  293.          *TP <R>
  294.          P:Hello <R>
  295.  
  296.     whereas the single line version is
  297.  
  298.          *TP/Hello <R>
  299.  
  300.     using the logical line feed character "/".  The P: in the first case is
  301.     a prompt given by TEDI.  Any non-alphanumeric except *, ., ], +, -,  or
  302.     blank may be used as the logical line feed character.  In addition, the
  303.     ASCII escape character always functions as a logical  line  feed,  even
  304.     when another logical line feed character is in use.  However, to insure
  305.     system independence, the use of the escape  for  this  purpose  is  not
  306.     recommended.
  307.  
  308.          One  may wish to input into a text line or string the logical line
  309.     feed character itself.   To  make  this  possible,  the  force  literal
  310.     character,  the  grave  accent  "`", is used.  If it precedes a special
  311.     character, the special character is  input  into  the  text  or  string
  312.     regardless  of whether or not it is currently the logical line feed (or
  313.     the tab character, see the STC command).  To  input  the  grave  accent
  314.     itself,  type two of them "``".  (In many cases one may simply chose to
  315.     use an alternate logical line feed character and avoid the need for the
  316.     "`"  sequence.)  In  addition  to its force literal function, the grave
  317.     accent is used to input control characters.  The grave accent  followed
  318.     by  an  upper-case  alphabetic  character inputs the associated control
  319.     character.  For example, "`C" inputs "CTRL-C" into the text or string.
  320.  
  321.  
  322.  
  323.                                 TEXT INPUT MODE
  324.  
  325.  
  326.          Two of the examples above, IAL, Insert After Line, and RL, Replace
  327.     Lines, cause entry into text entry mode.  This means that the editor is
  328.     prepared to accept lines of text to be entered into the file.  A prompt
  329.     of the ampersand "&" is given for each line, but the ampersand does not
  330.     go into the line.  (The prompt may be turned of--see the section called
  331.     switch  settings--but  it is helpful as a reminder of the fact that the
  332.     editor is in text entry mode.) When you have entered all of  the  lines
  333.     you wish, enter one line with only a period "." at the beginning of the
  334.     line and then type a return.   The  period  terminates  text  mode  and
  335.     returns  the editor to command mode.  (Although it will be rare to wish
  336.     to enter a line with only a period in the first  position,  it  can  be
  337.     done  by  typing one or more blanks after it.  Since before writing the
  338.     line to disk TEDI removes all trailing blanks, the line that enters the
  339.     file  contains only the period in the first position.  The extra blanks
  340.     on type-in tell the editor that you  do  not  wish  to  terminate  text
  341.                                       -7-
  342.  
  343.     mode.)  To  enter  text  mode for a new file, the line number is simply
  344.     omitted from the insert command "IAL".  When you  leave  text  mode  by
  345.     this   means,   the  editor  will  immediately  begin  typing  out  the
  346.     consequences   of   the   change.    This   is   called   verification.
  347.     (Verification may be turned off--see section called "Settings".)
  348.  
  349.          Example with multiple line input:
  350.  
  351.          *IAL <R>
  352.          &Now is the time  <R>
  353.          &for all good men.  <R>
  354.          &.
  355.  
  356.          Example with single line input:
  357.  
  358.          *IAL/Now is the time/for all good men/.   <R>
  359.  
  360.  
  361.  
  362.                                COLUMN REFERENCING
  363.  
  364.  
  365.          Column  referencing  is  possible  through  the  third  and fourth
  366.     arguments of ordinary string  matching  commands,  or  though  explicit
  367.     column referencing commands.  An example of the former is "TS*,,1,7/10"
  368.     which will find the symbol "10"  only  if  it  occurs  in  columns  one
  369.     through  seven.   An  example of the latter is "RC,,6;2" which places a
  370.     digit "2" in column 6 of the current line, regardless  of  the  current
  371.     contents of column 6.
  372.  
  373.          Default  cases  of the column referencing commands are of frequent
  374.     use.  The AC "After Columns" command with  no  explicit  column  number
  375.     puts the string after the last non-blank character in the line.  The BC
  376.     "Before Columns" command with no  explicit  column  number  places  the
  377.     string  before column one, i.e., at the beginning of the line.  The DAC
  378.     "Delete After  Columns"  command  with  no  explicit  column  reference
  379.     deletes all trailing blanks.  (TEDI always deletes trailing blanks when
  380.     creating  text;  however,  files  converted  from  some  other   origin
  381.     sometimes have wasteful trailing blanks.)
  382.  
  383.  
  384.  
  385.                         PATTERNS, SYMBOLS, AND METATEXT
  386.  
  387.  
  388.          Certain commands search for the occurrence of specified strings of
  389.     characters.  These strings are limited to 80 characters,  although  the
  390.     lines  that  result  from  changes  using  the strings may be up to 150
  391.     characters long.  A pattern is  any  string  of  legal  characters.   A
  392.     symbol is a pattern that is delimited in the text by special characters
  393.     or blanks.  This distinction is useful as a means of changing variables
  394.     in  a  source  program  or  full words in a text file.  For example, it
  395.     allows finding all occurrences of  the  FORTRAN  variable  "I"  without
  396.     interference  from  occurrences of the letter "I" in the symbol "PI" or
  397.     the word "IF".  Pattern commands use the letter "P" to denote  pattern,
  398.                                       -8-
  399.  
  400.     i.e.,  "TP" for Type Pattern, while symbol commands use the letter "S",
  401.     i.e., "RS" for Replace Symbol.
  402.  
  403.          For more powerful string matching and  replacement,  TEDI  defines
  404.     several metatext (wild card) constructs.  A metatext string is a string
  405.     taken to stand  for  more  than  the  literal  sequence  of  characters
  406.     constituting  it  by  defining  some  special  characters  to  be given
  407.     generalized meanings.  To indicate that the referenced strings  are  to
  408.     be  so  interpreted,  the  letter  "X"  is used in the commands; in the
  409.     command descriptions, the abbreviation "mtext" is used for metatext  in
  410.     a  matching context while "rtext" is used for metatext in a replacement
  411.     context.
  412.  
  413.          For metatext matching purposes, the case is not considered.   Thus
  414.     one use of metatext is to search for strings whose case is unknown.  If
  415.     one of the special characters introduced below is desired literally, it
  416.     should be preceded in the mtext string by the AT sign "@".  The AT sign
  417.     itself may be specified in a metatext string as  "@@".   Finally,  note
  418.     that  metatext  searching  is much slower than either pattern or symbol
  419.     searching, so such a search should be used only when its generality  is
  420.     needed.
  421.  
  422.          (1) Single Wild Characters: "?" matches any character, "&" matches
  423.     any alphanumeric, and "!" matches any non-alphanumeric.   No  mechanism
  424.     for  identification  of these single characters is available for use in
  425.     replacement strings, but the same result may be  obtained  by  using  a
  426.     character  class of length one using the notation described in the next
  427.     paragraph.
  428.  
  429.          Example:
  430.  
  431.          TX*,,72,80;?
  432.  
  433.     types all lines containing anything in columns 72 through 80.
  434.  
  435.          (2) Character Classes: Brackets enclosing a string  of  characters
  436.     matches  any one of the enclosed characters.  For example [xyz] matches
  437.     a single x, a single y, or  a  single  z.   [&$_]  matches  any  single
  438.     alphanumeric,  dollar,  or  underline.   The  minus  sign  between  two
  439.     characters indicates a range of characters.  For example [I-N]  matches
  440.     any  character  in  the  range  from  I to N inclusive.  In replacement
  441.     strings, use [] without any enclosed characters to obtain whatever  was
  442.     matched in the same character class, same meaning ordinal position from
  443.     left to right.  To  change  the  order,  enclose  the  ordinal  in  the
  444.     brackets  in  the replacement string.  For example, [3] enters into the
  445.     replacement string whatever was matched by the third character class in
  446.     the match string.
  447.  
  448.          Example:
  449.  
  450.          RX*;5[0-9];8[]
  451.  
  452.     replaces  each  two digit number beginning with 5 by a two digit number
  453.     beginning with 8 and ending in the same digit as the original.
  454.  
  455.                                       -9-
  456.  
  457.          (3)  Ellipses:  For  matching   variable   length   strings,   the
  458.     dot-dot-dot  notation  is  used.   "..." matches anything.  For example
  459.     "m...e" matches both "message" and "mad ape".  "..&" matches any number
  460.     of  contiguous  alphanumeric  characters.   "..!" matches any number of
  461.     contiguous  non-alphanumeric  characters.   (The  ellipses   "..?"   is
  462.     identical to "..."; the latter is introduced because it is easily typed
  463.     and  corresponds  to  common  usage.)  "..a"  matches  any  number   of
  464.     contiguous a's.  "..[xyz]" matches any strings composed solely of x, y,
  465.     and z.  Note that  zero  occurrences  is  acceptable,  so  without  the
  466.     presence  of something else an isolated ellipsis will match every line,
  467.     using zero of the quantities as a  successful  match.   In  replacement
  468.     strings  the  simple  ellipsis  is used to represent any of the special
  469.     forms.  The correspondence is made in an ordinal manner  from  left  to
  470.     right.  To change the order, use the form "..n" where n is the ordinal.
  471.     For example, in a replacement text string, "..3" invokes  whatever  was
  472.     matched  by  the  third ellipsis in the match string, regardless of the
  473.     type of that ellipsis.  In all cases, the  shortest  possible  ellipsis
  474.     match is taken.
  475.  
  476.          Examples:
  477.  
  478.          RX*;PRINT...,;WRITE (5,...)
  479.  
  480.     replaces  all  FORTRAN  PRINT  statements  with  WRITE  statements with
  481.     logical unit 5 and the same format number while
  482.  
  483.          RX*;WRITE...(5,...);PRINT ..2,
  484.  
  485.     reverses the change.
  486.  
  487.          (4) Symbols: Metatext strings enclosed  in  angle  brackets  match
  488.     only if preceded and followed by either a separator or by the beginning
  489.     or the end of the line.  Thus <x..&> matches all symbols beginning with
  490.     x.  A single angle bracket may be used to obtain a one-sided symbol.
  491.  
  492.          Example:
  493.  
  494.          TX*;<x[1-9]>
  495.  
  496.     types out all lines containing the symbol x1, x2, ..., or x9.
  497.  
  498.  
  499.  
  500.                            TAB STOPS AND INDENTATION
  501.  
  502.  
  503.          The  automatic  insertion  of  blanks  before  specified points in
  504.     insertion or replacement text is provided by the Set  Tab  Stops  "STS"
  505.     and Set Tab Character "STC" commands, by the Replace Data "RD" command,
  506.     and by the Set Indent "SI" command.
  507.  
  508.          Both left adjust and right  adjust  tabs  are  provided.   A  left
  509.     adjust  tab  stop  is  specified  by  a positive or unsigned number and
  510.     causes the following text to be preceded by enough blanks to cause  the
  511.     next  character to begin in the column number equal to the value of the
  512.                                      -10-
  513.  
  514.     tab stop.  Columns start at one.  A right adjust tab stop is  specified
  515.     by  a negative number.  The text following the tab character is scanned
  516.     for the next blank or tab character.  If the text is  not  already  too
  517.     far  right,  the  text  is  preceded by enough blanks to cause the last
  518.     character in the word to be placed one column to the left of the column
  519.     number  equal to the absolute value of the tab stop.  The tab character
  520.     itself is user selectable with the Set Tab Character "STC" command.  In
  521.     most  cases  one  occurrence  of  the  current tab character causes the
  522.     action described in the preceding paragraph to take place.  However, if
  523.     the  tab  character  is  a  blank, two blanks cause the tabbing to take
  524.     place.  The default tab character is the blank which is  very  easy  to
  525.     type.   Left  and  right  adjust  tab  stops may be combined in the STS
  526.     command.
  527.  
  528.          The above tabbing is in effect for text input lines,  i.e.,  those
  529.     entered  after  the  insert and replace line commands "IAL", "IBL", and
  530.     "RL".  No special interpretation of the tab character is  made  by  the
  531.     pattern  replacement commands.  However, it may be desirable to replace
  532.     a pattern while retaining the tab  stop  alignment.   To  this  end,  a
  533.     special  pattern  replacement  command,  Replace Data "RD" is provided.
  534.     The columnar range of its action is specified by considering  the  line
  535.     to  be  divided  into  data  fields which extend between successive tab
  536.     stops.  Specifically, the d'th data field extends from  (|ts(d-1)|)  to
  537.     (|ts(d)|-1)  with the understanding that the first data field begins at
  538.     column one.  The command Replace Data, "RDm,n,d/pat" will  replace  the
  539.     d'th  data  field  with  the replacement pattern.  For example, the tab
  540.     stops set by "STS 10,20,35,72" would be suitable for entering a COMPASS
  541.     assembly  language  program  on  LTSS, separating the label, operation,
  542.     operand, and comment fields.  To replace only the  comment  field,  the
  543.     command  "RD,,4/new  comment" would replace the comment while retaining
  544.     its proper position on the line.
  545.  
  546.          The Set Indent "SI i,j" command provides a more  dynamic  columnar
  547.     positioning  and  is  suitable for emphasizing the logical structure of
  548.     computer programs.  The initial indent level is set to column i and the
  549.     increment  to column j.  Only text input lines are affected when the SI
  550.     command has been given and to remind the user, they are prompted by the
  551.     special prompt ">".  When this has been done, any lines entered in text
  552.     mode  will  be  indented  to  the  current  level  with  the  following
  553.     exceptions.   If  a  line begins with a period, the text following will
  554.     begin in column one.  If a line begins with a  plus  sign,  the  indent
  555.     level will be incremented by j before beginning the following line, and
  556.     a minus will similarly decrement the indent level.  A zero  will  reset
  557.     the  indent  level to i.  A colon as the first character will cause all
  558.     characters through the first blank to be placed starting at column two,
  559.     and  then  the  remainder starting at the current indent level (this is
  560.     for statement labels in many languages) while a comma behaves similarly
  561.     except  the  first  string starts at column i-1 as is appropriate for a
  562.     FORTRAN continuation.  The indent function may be  disabled  by  an  SI
  563.     command  with  no  arguments.   The indent parameters i and j are saved
  564.     across executions in the working file, but the current indent level  is
  565.     not and is restarted at the beginning of each execution.  As an example
  566.     of using the Set Indent command to input RATFOR text, the input string
  567.  
  568.     SI3,3;IAL;while (getlin(buffer,STDIN) ^= EOF);+[
  569.                                      -11-
  570.  
  571.     if (buffer(1) == EOS);+next;-else;+call putlin(buffer,STDOUT);-];.
  572.  
  573.     causes the text to be entered as
  574.  
  575.        while (getlin(buffer,STDIN) ^= EOF)
  576.           [
  577.           if (buffer(1) == EOS)
  578.              next
  579.           else
  580.              call putlin(buffer,STDOUT)
  581.           ]
  582.  
  583.     Multiple occurrences of the  plus  or  minus  indicators  are  properly
  584.     interpreted.
  585.  
  586.  
  587.  
  588.                                    REGISTERS
  589.  
  590.  
  591.          Ten  numeric registers, R0, R1, ..., R9, may be used for temporary
  592.     storage of integer data.   The  command  Set  Register,  "SRn,k",  sets
  593.     register  n  to  value  k.  The register may then be used in place of a
  594.     numeric argument in a command.  For example, "SR3,5" followed by "T R3"
  595.     types  line 5.  Note that the Set Register command is a single mnemonic
  596.     so there is no space between the "S"  and  the  "R"  whereas  when  the
  597.     register  is  used to represent a number in the Type command there is a
  598.     space between the "T" and the  "R".   The  greatest  utility  of  these
  599.     registers  is  in DO loops and command files, but manual use is helpful
  600.     when doing copies or moves in long files as a means of  recording  line
  601.     numbers.  As a DO-LOOP example,
  602.  
  603.          "SR1,1/DOP*/     END/SR2,./TD R1,R2/SR1,R2+1/NDO"
  604.  
  605.     will  type  out all FORTRAN program units in a delimited form such that
  606.     each function or subroutine begins on a new page.  Future  versions  of
  607.     TEDI  will set R0, R8, and R9 after every string match command, so only
  608.     registers R1 through R7 are recommended  for  general  use  in  command
  609.     files.   Type  commands useful with registers are "TI", Type Immediate,
  610.     and "TSI", Type String Immediate.  The  following  example  counts  and
  611.     displays the number of lines in which the symbol X1 occurs.
  612.  
  613.          "SR1,0;DOS*;X1;SR1,R1+1;NDO;TSI;Number of X1's =;TI R1"
  614.  
  615.  
  616.  
  617.                                      -12-
  618.  
  619.                                REMEMBERED STRINGS
  620.  
  621.  
  622.          Three different strings are remembered.  They are respectively the
  623.     match string, the replacement string, and the do string.  These strings
  624.     contain  the  string  most  recently used to reference them.  If in any
  625.     command the null string is input for one of the string  arguments,  the
  626.     remembered value is invoked.  For example, the command sequence
  627.  
  628.          TPA;Hello;RP;;Goodbye
  629.  
  630.     will  replace the next "Hello" found with "Goodbye" without the need to
  631.     type "Hello" twice.  One of the consequences of remembered  strings  is
  632.     that  the  replace  commands  may not be used with null input to delete
  633.     strings--the delete commands must be used instead.
  634.  
  635.          In order to explicitly set the match, replacement, and  do  string
  636.     buffers  from the contents of a line, the set string commands are used.
  637.     They are SSMm,,c1,c2", "SSRm,,c1,c2", and SSDm,,c1,c2.  These  set  the
  638.     appropriate  string with the contents of line m, columns c1 through c2.
  639.     Trailing blanks will be supplied if necessary.  As an example, to  move
  640.     columns  21  through  30 to the beginning of lines 100 through 200, use
  641.     the following command:
  642.  
  643.          DO100,200/SSR,,21,30/DC,,21,30/BC//NDO
  644.  
  645.  
  646.  
  647.                 KEY-EDIT SCREEN EDITING (VMS, UNIX, and IBM PC)
  648.  
  649.  
  650.          A  screen  editor  for  VT-220  and  VT-100  terminals  and  their
  651.     emulators,  and  for  the  IBM  PC,  is  invoked with the "K", Key Edit
  652.     command.  The command "K" or "K m" invokes the screen editor  with  the
  653.     initial window determined by the line number "m".  The Key-edit command
  654.     is terminated and line editing resumed with the CTRL-Z key.
  655.  
  656.          When in key-edit mode, the cursor keys  move  the  cursor  to  any
  657.     point on the displayed screen, and cause scrolling of the screen at its
  658.     boundaries.  Other key  edit  functions  may  be  invoked  either  with
  659.     control  key combinations in which an alphabetic letter is struck while
  660.     the control key is held down.   On  most  terminals  and  workstations,
  661.     alternative  single-stroke  function  keys  may  be used instead of the
  662.     control key combinations.
  663.  
  664.          In the following descriptions, the column  marked  ALL  shows  the
  665.     keys  one can use on any ANSII video terminal, while the columns marked
  666.     VT220, IBM PC, and VT100 show the alternate single-key forms  available
  667.     on  these  terminals  or  PC's.  When using an emulator, the mapping of
  668.     VT-220 or VT-100 function keys must be  determined  from  the  emulator
  669.     documentation.
  670.  
  671.     ALL       ACTION                              VT220     IBM PC   VT100
  672.  
  673.                                      -13-
  674.  
  675.     CTRL-Z    Leave key edit and enter line
  676.               edit; to return to key-edit type
  677.               K <ret> or K m <ret> (m is a
  678.               line number)
  679.  
  680.     CTRL-?    Help.  Display brief help screen    Help      F1
  681.               (CTRL-MINUS on some emulators)
  682.  
  683.     Arrows    Move about the text
  684.  
  685.     CTRL-H    Scroll ten lines up                 Prev      Page     PF1 or
  686.                                                   Screen    Up       Back
  687.                                                                      Space
  688.  
  689.     CTRL-J    Scroll ten lines down               Next      Page     PF2 or
  690.                                                   Screen    Down     Line
  691.                                                                      Feed
  692.  
  693.     CTRL-E    Jump between first and last         F14       End
  694.               characters of line
  695.  
  696.     CTRL-F    Jump between first and last         F12       Home
  697.               lines on screen
  698.  
  699.     CTRL-L    Locate.  Prompts for pattern.       Find      F2
  700.               Searches forward if terminated
  701.               with Enter or CTRL-J or Down
  702.               Arrow; backwards if terminated
  703.               with CTRL-H or Up Arrow;
  704.               CTRL-L repeats without other
  705.               characters cycles pattern, symbol,
  706.               and metatext search.
  707.  
  708.     Enter or  Causes a blank line to be inserted
  709.     Return    after the present line
  710.  
  711.     CTRL-T    Increase (soft Tab) indent level,   F8        F4
  712.               default three columns. First CTRL-T
  713.               moves to current indent level, use
  714.               with CTRL-E
  715.  
  716.     CTRL-R    Decrease (Reverse tab) indent       F7        F3
  717.               level, default three columns
  718.  
  719.     CTRL-P    Push. Enters insert mode. A single  F9        Insert   PF3
  720.               CTRL-P puts the editor in volatile
  721.               insert mode ("i displayed");
  722.               overwrite mode is entered on move
  723.               to new line.  Two CTRL-P's in a
  724.               row lock the editor in insert
  725.               mode ("I displayed"); overwrite
  726.               mode is restored only after
  727.               another CTRL-P
  728.  
  729.                                      -14-
  730.  
  731.     CTRL-D    Delete the character under the      F14       Delete   PF4
  732.               cursor
  733.  
  734.     DEL or <- Delete character before the cursor
  735.  
  736.     CTRL-K    Delete from cursor to end  of       Remove    F7
  737.               line or, if at beginning of line,
  738.               delete entire line; replaces buffer
  739.  
  740.     CTRL-U    Delete everything before cursor               ESC
  741.               on present line
  742.  
  743.     CTRL-N    JoiNs the present line              F17       F11
  744.               to the next line
  745.  
  746.     CTRL-V    DiVides the line before the         F18       F12
  747.               present cursor position
  748.  
  749.     CTRL-G    Get.  Enters select mode where      Select    F8
  750.               patterns or lines will be marked
  751.               for deletion or copying.  A single
  752.               CTRL-G puts editor in pattern
  753.               select mode ("P" displayed).  An
  754.               second CTRL-G or Up Arrow, Down
  755.               Arrow, Page Up or Page Down
  756.               activates line select mode
  757.               ("L" displayed). The arrow and
  758.               scroll keys are used to complete
  759.               the selection
  760.  
  761.       CTRL-K or  When in select mode, deletes     Remove    F7
  762.       CTRL-D    high-lighted characters,
  763.                 puts them in buffer, and ends select
  764.  
  765.       CTRL-G    When in select mode, the final    Select    F8
  766.                 CTRL-G puts highlighted text in
  767.                 pattern or line buffer without
  768.                 deletion and ends select mode
  769.  
  770.       CTRL-A or  When in select mode, adds high-  Insert    F6
  771.       CTRL-B    lighted material to that already  Here
  772.                 in buffer and ends select
  773.  
  774.     CTRL-A    When not in select mode adds        Insert    F6
  775.               contents of buffer as lines After   Here
  776.               current line
  777.  
  778.     CTRL-B    When not in select mode adds        F13       F5
  779.               contents of buffer as pattern Before
  780.               cursor position
  781.  
  782.                                      -15-
  783.  
  784.     CTRL-]    FILL lines from present cursor      F10       F9
  785.               position to the next line that
  786.               is either all blank, begins with
  787.               a blank, or begins with a period
  788.  
  789.     CTRL-W    WORLD command which prompts         DO        F10
  790.               on status line for letter:
  791.               W  Write (save file)
  792.               E  End saving file
  793.               Q  Quit not saving file
  794.               O  Open new file
  795.               R  Repaint screen
  796.               S  Show file name
  797.  
  798.  
  799.          TEDI saves both line-edit and key-edit status information, as well
  800.     as the most recently used file name, in a file "TEDI.INI" in  the  home
  801.     directory.   This  file  allows restoration of parameters each time you
  802.     start up TEDI.  Starting TEDI without a file name uses the saved name.
  803.  
  804.          There are two line edit commands, "SK" set key edit, and  "NK"  no
  805.     key edit, which cause the editor to start up in either key edit or line
  806.     edit mode.  The default indents for the CTRL-T and CTRL-R soft tabs can
  807.     be altered by the line edit "SI" command.
  808.  
  809.          On  VMS  the  editor  reads  the  page  length  value from the VMS
  810.     terminal settings.  Users of the Visual  550  should  SET  TERM/PAGE=33
  811.     while  users  of  the  Tektronix  4100  and 4200 series should set page
  812.     length to either 30 or 32 lines.  The setting of page length for  users
  813.     of networked DEC workstations is automatic.
  814.  
  815.  
  816.  
  817.                                  COMMAND FILES
  818.  
  819.  
  820.          Files  containing sequences of commands may be executed.  The file
  821.     is invoked with the Use command, "Um1,m2,...,mk/filename".  The numeric
  822.     arguments  are optional and cause setting of the registers R1, R2, ...,
  823.     Rk before beginning execution of the command file.  For example,  if  a
  824.     sequence  of  commands  is  prepared in the file "COMFIL", the commands
  825.     will be executed as a consequence of the command  "U/COMFIL".   Command
  826.     files may also be invoked using the indirect notation "@" either on the
  827.     initial execute line or in any of  the  Open  commands.   For  example,
  828.     "TEDI @COMFIL"  or  "O;@COMFIL".   Lines  beginning with an exclamation
  829.     point "!" in column one are considered comment lines.   Leading  blanks
  830.     in commands (although not in strings) are ignored, so that commands may
  831.     be indented for readability.   Command  files  may  not  be  nested  or
  832.     included in the range of a "DO".
  833.  
  834.          As an example of the use of command files, consider the mailing of
  835.     form letters to a standard list of addressees.  Let the  file  "letter"
  836.     contain  the  text  of  the letter with a line containing only the word
  837.     "INSERT" at the point at which the address  and  salutation  should  be
  838.     inserted.   Let the file "address" contain the addresses, each of which
  839.                                      -16-
  840.  
  841.     is followed by the proper form of the recipient's name to  be  used  in
  842.     the  salutation,  followed  by  a line containing only the symbol "EOA"
  843.     (end of  address).   Finally,  let  the  file  "mail"  consist  of  the
  844.     following lines:
  845.  
  846.          nv/o/temp/dl*
  847.          cfa/address/sr1,.
  848.          cfa/letter
  849.          lpa r1/INSERT/sr2,.
  850.          sr3,1/nn
  851.          dop 1,r1/EOA/sr4,./tsi/`L/t r1+1,r2-1/t r3,r4-2/tsi/`M`J
  852.          tsi/Dear /t r4-1/t r2+1,]/sr3,r4+1/ndo
  853.          tsi/`L/quit
  854.  
  855.     The command "tedi @mail" on a form-feed sensitive terminal will cause a
  856.     copy of the letter to be typed out to each of the addressees.
  857.  
  858.  
  859.  
  860.                              FILE HANDLING COMMANDS
  861.  
  862.  
  863.     O;filename               Open
  864.  
  865.          Open an existing filename or, if  filename  does  not  yet  exist,
  866.          start  a  new  file of that name.  If another file is already open
  867.          when this command is given, and if any changes have been  made  in
  868.          it,  a  new  version  is  written  before  proceeding with the new
  869.          filename.
  870.  
  871.     OD;filename              Open Discarding
  872.  
  873.          Open an existing or new file as in  the  Open  command.   In  this
  874.          case,  however,  a  previously opened file is not updated, even if
  875.          changes have been made.  This is a useful command  when  erroneous
  876.          changes  have  been  made  and  a new copy of the original file is
  877.          desired.
  878.  
  879.     W                        Write
  880.  
  881.          Write out a new version of the working file.  This command  should
  882.          be  used  frequently to provide "snapshots" of the editing process
  883.          and to provide a recovery file to use to recover from  editing  or
  884.          hardware failures.  The equivalent of a Write is automatic when an
  885.          End command is given or  a  new  file  is  opened  with  the  Open
  886.          command.
  887.  
  888.     WFm,n;filename           Write File
  889.  
  890.          Write  lines  m  through  n of the working file into a file of the
  891.          name filename.  No change of the name of the  working  file  takes
  892.          place.  The default range is the entire working file.
  893.  
  894.                                      -17-
  895.  
  896.     WFNm,n;filename          Write File Numbered
  897.  
  898.          Write  lines  m  through  n of the working file into a file of the
  899.          name filename.  Include the  line  numbers  in  the  file  at  the
  900.          beginning of each line.  No change to the name of the working file
  901.          takes place.  The default range is the entire working file.
  902.  
  903.     WR;filename              Write Renaming
  904.  
  905.          The present working file is written out  to  filename.   Moreover,
  906.          the  name  associated  with the working file (the name used when a
  907.          file write is necessary for the End or Open commands)  is  changed
  908.          to filename.
  909.  
  910.     Um1,...,mk;filename      Use
  911.  
  912.          Use  the  contents  of filename as a source of commands.  The file
  913.          should be created to contain  commands  identical  to  those  that
  914.          would  otherwise  be  typed  in  at  the  terminal.  At the end of
  915.          reading through filename and executing its commands, TEDI  returns
  916.          to  the  terminal  for additional commands.  The numeric arguments
  917.          m1,...,mk are optional and cause setting of the registers R1,  R2,
  918.          ....,  Rk  before  beginning  execution of the command file.  This
  919.          allows passing "arguments" to the command file in the manner of  a
  920.          subroutine  or macro.  Command files may not be nested or included
  921.          in the range of DO commands.
  922.  
  923.  
  924.  
  925.                               EXCHANGE CURSOR EDIT
  926.  
  927.  
  928. Xm,n                          Exchange
  929.  
  930.     Exchange types out lines m through n one at a time,  prompting  with  a
  931.     colon  beneath  the  line  for  the  user  to  specify  the exchange of
  932.     characters desired in the line above.
  933.  
  934.                   BLANK -- replicate the character above.
  935.  
  936.           \       BACKSLASH -- delete the character above.
  937.  
  938.           _       UNDERSCORE -- replace the character above with a blank.
  939.  
  940.           ^...^   CARET string  CARET  --  insert  the  string  before  the
  941.                   character above the first caret.  The ellipsis stands for
  942.                   any character(s) except carets.
  943.  
  944.           |       VERTICAL BAR -- split the line before the character above
  945.                   the bar.
  946.  
  947.  
  948.  
  949.                                      -18-
  950.  
  951.                         TYPE, PRINT, and LOCATE COMMANDS
  952.  
  953.  
  954.          The  type  commands  cause  type  out of the selected lines at the
  955.     controlling terminal.  The print commands  send  output  to  a  printer
  956.     attached  to  an  ANSI printer port on the terminal such as that on the
  957.     VT-100 printer port  option.   The  locate  commands  cause  no  actual
  958.     output.   They do, however, carry out the same search procedures as the
  959.     type and print commands and affect the current line number in the  same
  960.     way.   They  are  useful  for  locating desired lines in command files,
  961.     particularly within the range of "DO" iteration loops.
  962.  
  963.     Tm,n                     Type
  964.     Pm,n                     Print
  965.     Lm,n                     Locate
  966.  
  967.          Type, print, or locate lines m through n.
  968.  
  969.     TAm,k                    Type After
  970.     PAm,k                    Print After
  971.     LAm,n                    Locate After
  972.  
  973.          Type, print, or locate the k lines after line m.
  974.  
  975.     TBm,k                    Type Before
  976.     PBm,k                    Print Before
  977.     LBm,k                    Locate Before
  978.  
  979.          Type, print, or locate the next k lines after the current line.
  980.  
  981.     TNk                      Type Next
  982.     PNk                      Print Next
  983.     LNk                      Locate Next
  984.  
  985.          Type, print, or locate the k lines before line m.
  986.  
  987.     TPm,n,c,d;pat            Type Pattern
  988.     PPm,n,c,d;pat            Print Pattern
  989.     LPm,n,c,d;pat            Locate Pattern
  990.  
  991.          Type, print, or locate all lines from m through  n  which  contain
  992.          pat in columns c through d.
  993.  
  994.  
  995.     TPAm,k,c,d;pat           Type Pattern After
  996.     PPAm,k,c,d;pat           Print Pattern After
  997.     LPAm,k,c,d;pat           Locate Pattern After
  998.  
  999.          Type the next k lines containing pat in columns c through d.  If m
  1000.          is present, start the search after line m.
  1001.  
  1002.                                      -19-
  1003.  
  1004.     TPBm,k,c,d;pat           Type Pattern Before
  1005.     PPBm,k,c,d;pat           Print Pattern Before
  1006.     LPBm,k,c,d;pat           Locate Pattern Before
  1007.  
  1008.          Type the previous k lines containing pat in columns c  through  d.
  1009.          If m is present, start the search before m.
  1010.  
  1011.     TSm,n,c,d;sym            Type Symbol
  1012.     PSm,n,c,d;sym            Print Symbol
  1013.     LSm,n,c,d;sym            Locate Symbol
  1014.  
  1015.          Type,  print,  or  locate all lines from m through n which contain
  1016.          sym in columns c through d.
  1017.  
  1018.     TSAm,k,c,d;sym           Type Symbol After
  1019.     PSAm,k,c,d;sym           Print Symbol After
  1020.     LSAm,k,c,d;sym           Locate Symbol After
  1021.  
  1022.          Type, print, or locate the next k lines containing sym in  columns
  1023.          c through d.  If m is present, start the search after line m.
  1024.  
  1025.     TSBm,k,c,d;sym           Type Symbol Before
  1026.     PSBm,k,c,d;sym           Print Symbol Before
  1027.     LSBm,k,c,d;sym           Locate Symbol Before
  1028.  
  1029.          Type, print, or locate the previous k lines contain sym in columns
  1030.          c through d.  If m is present, start the search before line m.
  1031.  
  1032.     TXm,n,c,d;mtext          Type TeXt
  1033.     PXm,n,c,d;mtext          Print TeXt
  1034.     LXm,n,c,d;mtext          Locate TeXt
  1035.  
  1036.          Type, print, or locate all lines from m through  n  which  contain
  1037.          mtext in columns c through d.
  1038.  
  1039.     TXAm,k,c,d;mtext         Type TeXt After
  1040.     PXAm,k,c,d;mtext         Print TeXt After
  1041.     LXAm,k,c,d;mtext         Locate Text After
  1042.  
  1043.          Type,  print,  or  locate  the  next  k  lines containing mtext in
  1044.          columns c through d.  If m is present, start the search after line
  1045.          m.
  1046.  
  1047.     TXBm,k,c,d;mtext         Type TeXt Before
  1048.     PXBm,k,c,d;mtext         Print TeXt Before
  1049.     LXBm,k,c,d;mtext         Locate TeXt Before
  1050.  
  1051.          Type,  print,  or  locate the previous k lines containing mtext in
  1052.          columns c through d.  If m is present,  start  the  search  before
  1053.          line m.
  1054.  
  1055.                                      -20-
  1056.  
  1057.     TOm,n                    Type Octal
  1058.     POm,n                    Print Octal
  1059.  
  1060.          Type  or  print lines m through n displaying each character in its
  1061.          7-bit octal representation.
  1062.  
  1063.     TDm,n,k,i                Type Decimal
  1064.     PDm,n,k,i                Print Decimal
  1065.  
  1066.          Type or print lines m through n displaying each character  in  its
  1067.          decimal representation.
  1068.  
  1069.     TCm,n                    Type Columns
  1070.     PCm,n                    Print Columns
  1071.  
  1072.          Type  or  print  lines  m  through  n preceded by a list of column
  1073.          numbers.
  1074.  
  1075.     TIk                      Type Immediate
  1076.     PIk                      Print Immediate
  1077.  
  1078.          Type or print the numerical values k.  In practice k is usually  a
  1079.          register (see discussion of registers above).
  1080.  
  1081.     TSI;string               Type String Immediate
  1082.     PSI;string               Print String Immediate
  1083.  
  1084.          Type or print "string".  Useful in command files to send messages.
  1085.  
  1086.  
  1087.  
  1088.                                 SWITCH SETTINGS
  1089.  
  1090.  
  1091.     S                        Settings
  1092.  
  1093.          Report the value of all switch settings.
  1094.  
  1095.     SIi,j                    Set Indentation
  1096.  
  1097.          This  command initiates a special mode for the text input commands
  1098.          IAL, IBL, and RL to cause systematically indented text  so  as  to
  1099.          emphasize  program  structure.   If  i is present and not zero, it
  1100.          establishes  the  initial  indent  level  and  j  establishes  the
  1101.          increment.  If both i and j are absent, indent mode is turned off.
  1102.          The operation of indent mode is  explained  in  the  section  "Tab
  1103.          Stops and Indentation".
  1104.  
  1105.     STC;char                 Set Tab Character
  1106.  
  1107.          Sets the tab character to char.  Subsequent occurrences of char in
  1108.          text input mode (in response to the IAL,  IBL,  and  RL  commands)
  1109.          will  be  expanded to blanks in accordance with the column numbers
  1110.          set in the STS, Set Tab Stops, command.  The  blank,  the  initial
  1111.          setting,   has  a  special  interpretation  when  it  is  the  tab
  1112.                                      -21-
  1113.  
  1114.          character--an even number of blanks is interpreted  as  half  that
  1115.          many tabs while an odd number of blanks is taken literally.
  1116.  
  1117.     STSc,...,d               Set Tab Stops
  1118.  
  1119.          Set  the tab stops to c,...,d up to a maximum of 20.  There are no
  1120.          initial settings.
  1121.  
  1122.     SCC                      Set Control Characters
  1123.  
  1124.          This switch causes control characters, other than the final return
  1125.          line-feed,  to  be  printed in the "caret" notation, i.e., a caret
  1126.          followed by an  upper  case  alphabetic  character.   This  switch
  1127.          combined  with  the force literal character allows fairly complete
  1128.          manipulation of nonprinting control characters in the text.
  1129.  
  1130.     NCC                      No Control Characters
  1131.  
  1132.          This  switch  disables  the  "caret"  mode  of  printing   control
  1133.          characters  and  instead transmits them literally to the terminal.
  1134.          This is the initial setting.
  1135.  
  1136.     SLWn                     Set Line Width
  1137.  
  1138.          CTSS only.  Causes line wrap on terminals which do not provide it.
  1139.          The default value is 80.
  1140.  
  1141.     SN                       Set Numbers
  1142.  
  1143.          Precede  each  line  of  terminal  output  with  its implicit line
  1144.          number.  This is the initial setting.
  1145.  
  1146.     NN                       No Numbers
  1147.  
  1148.          Do not precede lines with their line numbers.
  1149.  
  1150.     SV                       Set Verification
  1151.  
  1152.          Type out all changes that occur as a result  of  line  or  pattern
  1153.          replacement commands.  This is the initial setting.
  1154.  
  1155.     NV                       No Verification
  1156.  
  1157.          Do not type out verification of changes as they are made.
  1158.  
  1159.     SCTc,d                   Set Columns Typed
  1160.  
  1161.          Type  out  only  columns  c through d in subsequent type and print
  1162.          commands.  A SCT command with no  arguments  restores  the  normal
  1163.          situation wherein all columns present are typed.
  1164.  
  1165.                                      -22-
  1166.  
  1167.     SXP;char                 Set TeXt Prompt
  1168.  
  1169.          When  in  text  entry  mode,  i.e., when using the IAL, IBL, or RL
  1170.          commands,  the  input  lines  are  normally  prompted   with   the
  1171.          ampersand.   This  command  allows  setting  the  prompt  to  some
  1172.          alternative character.
  1173.  
  1174.     NXP                      No Text Prompt
  1175.  
  1176.          This disables the text prompt altogether.
  1177.  
  1178.     SRi,k                    Set Register
  1179.  
  1180.          Set register i to the integer value k.
  1181.  
  1182.     SSMm,,c,d                Set String Match
  1183.  
  1184.          Set the match string to the contents of line m columns  c  through
  1185.          d.
  1186.  
  1187.     SSRm,,c,d                Set String Replace
  1188.  
  1189.          Set the replace string to the contents of line m columns c through
  1190.          d.
  1191.  
  1192.     SSDm,,c,d                Set String Do
  1193.  
  1194.          Set the DO string to the contents of line m columns c through d.
  1195.  
  1196.  
  1197.  
  1198.                                 INSERT COMMANDS
  1199.  
  1200.          Insert is the default command in the sense that the initial "I" in
  1201.     any  of  the  insert commands may be omitted.  For example, "AP", After
  1202.     Pattern, is identical to "IAP", Insert After Pattern.
  1203.  
  1204.     IALm;text;...;text;.     Insert After Line
  1205.  
  1206.          Insert new lines after line m.  Text input is terminated by a line
  1207.          containing  only  a  period  in  column  one.   To  enter  a  line
  1208.          containing only a period, enter a blank after the period.
  1209.  
  1210.     IBLm;text;...;text;.     Insert Before Line
  1211.  
  1212.          Insert new lines before line m.  Text input  is  terminated  by  a
  1213.          line  containing  only  a  period  in column one.  To enter a line
  1214.          containing only a period, enter a blank after the period.
  1215.  
  1216.     IAPm,n,c,d;pat;newpat    Insert After Pattern
  1217.  
  1218.          Insert newpat after each occurrence of pat in columns c through  d
  1219.          of lines m through n.
  1220.  
  1221.                                      -23-
  1222.  
  1223.     IBPm,n,c,d;pat;newpat    Insert Before Pattern
  1224.  
  1225.          Insert newpat before each occurrence of pat in columns c through d
  1226.          of lines m through n.
  1227.  
  1228.     IASm,n,c,d;sym;newpat    Insert After Symbol
  1229.  
  1230.          Insert newpat after each occurrence of sym in columns c through  d
  1231.          of lines m through n.
  1232.  
  1233.     IBSm,n,c,d;sym;newpat    Insert Before Symbol
  1234.  
  1235.          Insert newpat before each occurrence of sym in columns c through d
  1236.          of lines m through n.
  1237.  
  1238.     IAXm,n,c,d;mtext;rtext   Insert After TeXt
  1239.  
  1240.          Insert rtext after each occurrence of mtext in columns c through d
  1241.          of lines m through n.
  1242.  
  1243.     IBXm,n,c,d;mtext;rtext   Insert Before TeXt
  1244.  
  1245.          Insert  rtext before each occurrence of mtext in columns c through
  1246.          d of lines m through n.
  1247.  
  1248.     IACm,n,c;newpat          Insert After Column
  1249.  
  1250.          Insert newpat after column c in  lines  m  through  n.   If  c  is
  1251.          absent, after the last nonblank character.
  1252.  
  1253.     IBCm,n,c;newpat          Insert Before Column
  1254.  
  1255.          Insert  newpat  before  column  c  in  lines m through n.  If c is
  1256.          absent, insert before column one.
  1257.  
  1258.  
  1259.  
  1260.                                 REPLACE COMMANDS
  1261.  
  1262.  
  1263.     RL;text;...;text;.       Replace Lines
  1264.  
  1265.          Replace  lines  m  through  n  with  new  lines.   Text  input  is
  1266.          terminated  by  a line containing only a period in column one.  To
  1267.          enter a line containing only a period, enter  a  blank  after  the
  1268.          period.
  1269.  
  1270.     RPm,n,c,d;pat;newpat     Replace Pattern
  1271.  
  1272.          Replace  each  occurrence of pat in columns c through d of lines m
  1273.          through n with newpat.
  1274.  
  1275.                                      -24-
  1276.  
  1277.     RSm,n,c,d;sym;newpat     Replace Symbol
  1278.  
  1279.          Replace each occurrence of sym in columns c through d of  lines  m
  1280.          through n with newpat.
  1281.  
  1282.     RXm,n,c,d;mtext;rtext    Replace TeXt
  1283.  
  1284.          Replace each occurrence of mtext in columns c through d of lines m
  1285.          through n with rtext.
  1286.  
  1287.     RCm,n,c,d;newpat         Replace Columns
  1288.  
  1289.          Replace columns c through d of lines m through n with newpat.
  1290.  
  1291.     RDm,n,d;newpat           Replace Data
  1292.  
  1293.          Considering the d'th data field to extend from the d-1'th tab stop
  1294.          to  one  column  before  the  d'th tab stop, replace the d'th data
  1295.          field with newpat in lines m through n.
  1296.  
  1297.     RAPm,n,c,d;pat;newpat    Replace After Pattern
  1298.  
  1299.          Replace everything after the first occurrence of pat in columns  c
  1300.          through d of lines m through n with newpat.
  1301.  
  1302.     RASm,n,c,d;sym;newpat    Replace After Symbol
  1303.  
  1304.          Replace  everything after the first occurrence of sym in columns c
  1305.          through d of lines m through n with newpat.
  1306.  
  1307.     RAXm,n,c,d;mtext;rtext   Replace After TeXt
  1308.  
  1309.          Replace each occurrence of mtext in columns c through d of lines m
  1310.          through n with rtext.
  1311.  
  1312.     RACm,n,c;newpat          Replace After Column
  1313.  
  1314.          Replace  everything  after  column  c  in  lines  m through n with
  1315.          newpat.
  1316.  
  1317.     RBPm,n,c,d;pat;newpat    Replace Before Pattern
  1318.  
  1319.          Replace everything before the first occurrence of pat in columns c
  1320.          through d of lines m through n with newpat.
  1321.  
  1322.     RBSm,n,c,d;sym;newpat    Replace Before Symbol
  1323.  
  1324.          Replace everything before the first occurrence of sym in columns c
  1325.          through d of lines m through n with newpat.
  1326.  
  1327.                                      -25-
  1328.  
  1329.     RBXm,n,c,d;mtext;rtext   Replace Before TeXt
  1330.  
  1331.          Replace everything before the first occurrence of mtext in columns
  1332.          c through d of lines m through n with rtext.
  1333.  
  1334.     RBCm,n,c;newpat          Replace Before Column
  1335.  
  1336.          Replace  everything  before  column  c  in  lines m through n with
  1337.          newpat.
  1338.  
  1339.     RLUm,n,c,d               Replace Lower by Upper
  1340.  
  1341.          Replace all lower case characters in columns c through d of  lines
  1342.          m through n with the corresponding upper case characters.
  1343.  
  1344.     RULm,n,c,d               Replace Upper by Lower
  1345.  
  1346.          Replace  all upper case characters in columns c through d of lines
  1347.          m through n with the corresponding lower case characters.
  1348.  
  1349.  
  1350.  
  1351.                                 DELETE COMMANDS
  1352.  
  1353.  
  1354.     DLm,n                    Delete Lines
  1355.  
  1356.          Delete lines m through n.
  1357.  
  1358.     DPm,n,c,d;pat            Delete Pattern
  1359.  
  1360.          Delete each occurrence of pat in columns c through d  of  lines  m
  1361.          through n.
  1362.  
  1363.     DSm,n,c,d;sym            Delete Symbol
  1364.  
  1365.          Delete  each  occurrence  of sym in columns c through d of lines m
  1366.          through n.
  1367.  
  1368.     DXm,n,c,d;mtext          Delete TeXt
  1369.  
  1370.          Delete each occurrence of mtext in columns c through d of lines  m
  1371.          through n.
  1372.  
  1373.     DCm,n,c,d                Delete Columns
  1374.  
  1375.          Delete columns c through d in each of lines m through n.
  1376.  
  1377.     DAPm,n,c,d;pat           Delete After Pattern
  1378.  
  1379.          Delete  everything  after the first occurrence of pat in columns c
  1380.          through d of lines m through n.
  1381.  
  1382.                                      -26-
  1383.  
  1384.     DASm,n,c,d;sym           Delete After Symbol
  1385.  
  1386.          Delete everything after the first occurrence of sym in  columns  c
  1387.          through d of lines m through n.
  1388.  
  1389.     DAXm,n,c,d;mtext         Delete After TeXt
  1390.  
  1391.          Delete everything after the first occurrence of mtext in columns c
  1392.          through d of lines m through n.
  1393.  
  1394.     DACm,n,c                 Delete After Column
  1395.  
  1396.          Delete everything after column c  in  lines  m  through  n.   This
  1397.          command also removes trailing blanks.
  1398.  
  1399.     DBPm,n,c,d;pat           Delete Before Pattern
  1400.  
  1401.          Delete  everything before the first occurrence of pat in columns c
  1402.          through d of lines m through n.
  1403.  
  1404.     DBSm,n,c,d;sym           Delete Before Symbol
  1405.  
  1406.          Delete everything before the first occurrence of sym in columns  c
  1407.          through d of lines m through n.
  1408.  
  1409.     DBXm,n,c,d;mtext         Delete Before TeXt
  1410.  
  1411.          Delete  everything before the first occurrence of mtext in columns
  1412.          c through d of lines m through n.
  1413.  
  1414.     DBCm,n,c                 Delete Before Column
  1415.  
  1416.          Delete everything before column c in each of lines m through n.
  1417.  
  1418.  
  1419.  
  1420.                              MOVE and COPY COMMANDS
  1421.  
  1422.  
  1423.     MAm,n,s                  Move After
  1424.  
  1425.          Move lines m through n after line s.
  1426.  
  1427.     MBm,n,s                  Move Before
  1428.  
  1429.          Move lines m through n before line s.
  1430.  
  1431.     CAm,n,s                  Copy After
  1432.  
  1433.          Copy lines m through n after line s.
  1434.  
  1435.                                      -27-
  1436.  
  1437.     CBm,n,s                  Copy Before
  1438.  
  1439.          Copy lines m through n before line s.
  1440.  
  1441.     CFAm,n,s;filename        Copy File After
  1442.  
  1443.          Copy lines m through n of filename after line  s  of  the  working
  1444.          file.   A  nonstandard  default  of  1  for m and the last line of
  1445.          filename for n is used for this command.
  1446.  
  1447.     CFBm,n,s;filename        Copy File Before
  1448.  
  1449.          Copy lines m through n of filename before line s  of  the  working
  1450.          file.   A  nonstandard  default  of  1  for m and the last line of
  1451.          filename for n is used for this command.
  1452.  
  1453.  
  1454.  
  1455.                             DIVIDE and JOIN COMMANDS
  1456.  
  1457.  
  1458.     VAPm,n,c,d;pat           DiVide After Pattern
  1459.  
  1460.          Divide line into new lines after each occurrence of pat in columns
  1461.          c through d of lines m through n.
  1462.  
  1463.     VASm,n,c,d;sym           DiVide After Symbol
  1464.  
  1465.          Divide line into new lines after each occurrence of sym in columns
  1466.          c through d of lines m through n.
  1467.  
  1468.     VAXm,n,c,d;mtext         DiVide After TeXt
  1469.  
  1470.          Divide line into new lines  after  each  occurrence  of  mtext  in
  1471.          columns c through d of lines m through n.
  1472.  
  1473.     VACm,n,c                 DiVide After Column
  1474.  
  1475.          Divide  line  into  new  lines  after  column c in each of lines m
  1476.          through n.
  1477.  
  1478.     VBPm,n,c,d;pat           DiVide Before Pattern
  1479.  
  1480.          Divide line into new  lines  before  each  occurrence  of  pat  in
  1481.          columns c through d of lines m through n.
  1482.  
  1483.     VBSm,n,c,d;sym           DiVide Before Symbol
  1484.  
  1485.          Divide  line  into  new  lines  before  each  occurrence of sym in
  1486.          columns c through d of lines m through n.
  1487.  
  1488.                                      -28-
  1489.  
  1490.     VBXm,n,c,d;mtext         DiVide Before TeXt
  1491.  
  1492.          Divide line into new lines before  each  occurrence  of  mtext  in
  1493.          columns c through d of lines m through n.
  1494.  
  1495.     VBCm,n,c                 DiVide Before Column
  1496.  
  1497.          Divide  line  into  new  lines  before column c in each of lines m
  1498.          through n.
  1499.  
  1500.     JLm,n                    Join Lines
  1501.  
  1502.          Join lines m through n into one line.
  1503.  
  1504.  
  1505.  
  1506.                                ITERATION COMMANDS
  1507.  
  1508.  
  1509.          It is often desirable to execute a command for those  lines  in  a
  1510.     range  of  lines  which  satisfy some pattern matching conditions.  For
  1511.     simple cases, the "RP", Replace Pattern, command is adequate.  However,
  1512.     if the conditional pattern and the pattern to be altered are different,
  1513.     a more general construct is required.  TEDI provides "DO" commands  for
  1514.     this  purpose.   A "DO" command is followed by a sequence of additional
  1515.     commands which are to be executed for those lines implied by the  "DO".
  1516.     The  sequence  must  be  terminated with an "NDO", End Do command.  The
  1517.     separate elements of the command sequence may be  separated  by  either
  1518.     logical line-feed characters or with actual returns.
  1519.  
  1520.          For  example,  to  delete  the symbol "X" in every line which also
  1521.     contains the pattern "ABC" one would use the sequence,
  1522.  
  1523.  
  1524.          DOP*;ABC;DS;X;NDO
  1525.  
  1526.  
  1527.          DO's may be nested up to five deep.  For example,  to  delete  all
  1528.     lines  which  contain  the  symbol  "PI" but do not contain the pattern
  1529.     "RADIUS", one would use the sequence,
  1530.  
  1531.  
  1532.          DOS*;PI;DNP;RADIUS;DL;NDO;NDO
  1533.  
  1534.     It is important to note that the first DO has  the  asterisk  following
  1535.     it,  indicating "all lines", whereas the second DO does not, indicating
  1536.     its execution only for the "current line", i.e., the line  in  which  a
  1537.     "PI" has been found.
  1538.  
  1539.          The total character count of a nested sequence of DO commands must
  1540.     be less than or equal to 512, which includes all  characters  from  the
  1541.     outermost DO to the outermost NDO.
  1542.  
  1543.                                      -29-
  1544.  
  1545.     DOm,n                    Do
  1546.  
  1547.          Repeat  the  following commands up until the next matching NDO for
  1548.          all lines in the range m through n.
  1549.  
  1550.     DOPm,n,c,d;pat           Do On Pattern
  1551.  
  1552.          Repeat the following commands up until the next matching  NDO  for
  1553.          those  lines in the range m through n which contain pat in columns
  1554.          c through d.
  1555.  
  1556.     DOSm,n,c,d;sym           Do On Symbol
  1557.  
  1558.          Repeat the following commands up until the next matching  NDO  for
  1559.          those  lines in the range m through n which contain pat in columns
  1560.          c through d.
  1561.  
  1562.     DOXm,n,c,d;mtext         Do On TeXt
  1563.  
  1564.          Repeat the following commands up until the next matching  NDO  for
  1565.          those  lines  in  the  range  m  through  n which contain mtext in
  1566.          columns c through d.
  1567.  
  1568.     DNPm,n,c,d;pat           Do No Pattern
  1569.  
  1570.          Repeat the following commands up until the next matching  NDO  for
  1571.          those  lines  in the range m through n which do not contain pat in
  1572.          columns c through d.
  1573.  
  1574.     DNSm,n,c,d;sym           Do No Symbol
  1575.  
  1576.          Repeat the following commands up until the next matching  NDO  for
  1577.          those  lines  in the range m through n which do not contain sym in
  1578.          columns c through d.
  1579.  
  1580.     DNXm,n,c,d;mtext         Do No TeXt
  1581.  
  1582.          Repeat the following commands up until the next matching  NDO  for
  1583.          those lines in the range m through n which do not contain mtext in
  1584.          column c through d.
  1585.  
  1586.     NDO                      End DO
  1587.  
  1588.          Terminate a DO sequence.  DO's and NDO's must be matched.
  1589.  
  1590.  
  1591.  
  1592.                                      -30-
  1593.  
  1594.                               TERMINATION COMMANDS
  1595.  
  1596.  
  1597.     END                      End
  1598.  
  1599.          Updates the source file, saving the working file with  all  switch
  1600.          settings and file contents, and terminates the editor.
  1601.  
  1602.     QUIT                     Quit
  1603.  
  1604.          Terminates  the editor, discarding the working file without making
  1605.          any changes to the source file.
  1606.  
  1607.