\pagenumbering{arabic}
\section{Introduction}
\label{Introduction}

     TECO is a powerful text editing  language  available  under  most
     DIGITAL  operating systems.  TECO may be used to edit any form of
     ASCII text:  program sources, command procedures, or manuscripts,
     for  example.   TECO  is  a  character-oriented  editor, and also
     offers a number of facilities for dealing with lines of text.

\medskip

     You can use TECO interactively, issuing commands which are to  be
     executed as soon as they are typed in.  (TECO is an interpreter.)
     In this mode, TECO can be used for tasks ranging from very simple
     to quite complex.

\medskip

     You can write sequences of commands called macros, which  can  be
     stored  and  then  invoked  by  short  commands  or  even  single
     keystrokes.  You can write sequences of commands  to  be  run  as
     TECO   programs,   and  store  them  on  disk  for  execution  at
     convenience.

\medskip

     TECO can be used as an implementation language,  as  it  provides
     powerful   primitive   functions   for  text  processing,  screen
     handling, and keyboard management.  (The VTEDIT program  included
     with  some  TECO  distributions  is  an  example of a full keypad
     editor developed in the TECO language.)

\medskip

     TECO correctly handles most sequential ASCII formats supported by
     the  operating  systems upon which it runs.  It provides flexible
     pattern-matching constructs for text searching, file wildcarding,
     and  special  support  for editing BASIC-PLUS/BASIC-PLUS-2 source
     programs.   A  split  screen  scrolling  feature  allows  command
     dialogue to share the screen with an automatically-updated window
     into the editing buffer.

\medskip

     TECO's syntax  is  terse;   commands  are  designed  to  minimize
     keystrokes.   Also,  the  versatility  of TECO ``in all its glory''
     makes it complex.  However, just a few commands  suffice  to  get
     real  work  done,  and  a novice TECO user can begin creating and
     editing text files after only a few hours of  instruction.   More
     powerful features can be learned one at a time, and at leisure.

\medskip

     This manual presents TECO in two stages.  The first part (Chapter~1)  
	contains basic information and introduces that set of ``just a
     few'' commands.

\medskip

     Subsequent chapters describe the full TECO command set, including
     a  review  of  the  those commands presented in Chapter~1.  These
     chapters also introduce the concept  of  TECO  as  a  programming
     language  and  explain how basic editing commands may be combined
     into  ``programs''  sophisticated  enough  to   handle   the   most
     complicated editing tasks.

\medskip

     The early sections of this manual include few  specific  examples
     of  commands,  since all TECO commands have a consistent, logical
     format which will quickly become apparent to the beginning  user.
     There  is,  however, an extensive example at the end of Chapter~1
     which employs most of the commands introduced up to  that  point.
     Students  of  TECO  should  experiment with each command as it is
     introduced, and then duplicate the examples on their computer.

\medskip

     (If a video terminal which supports split-screen  scrolling  such
     as  a  member of the VT100 or VT200 families is available and the
     TECO being used supports it, seeing both your commands and  their
     effects  in  the  text  buffer  simultaneously  can make learning
     easier.  A command such as {\tt 5,7:W} allows  5  lines  for  command
     dialogue,  while  ``watching''  the text buffer on the remainder of
     the screen.  The {\tt 7:W} command is described in Table 
	\ref{Video Terminal Status Commands}

\medskip

     This manual is intended to be a reference manual, and except  for
     Chapter \ref{Basics of TECO} is not a tutorial.  After Chapter
	\ref{Basics of TECO}, it is assumed that
     the reader has a general familiarity with TECO and  is  referring
     to this manual to find detailed information.

\medskip

     The following notation  is  used  in  this  manual  to  represent
     special characters:

\medskip

\begin{tabular}{|l|c|l|} \hline
           Notation &    ASCII code (octal)  &    Name \\  \hline

           {\tt<NULL>}   &        0      &        Null \\
           \fbox {BS}     &       10      &        Backspace \\
           \fbox {TAB}    &       11      &        Tab \\
           \fbox {LF}     &       12      &        Line Feed \\
           \fbox {VT}     &       13      &        Vertical Tab \\
           \fbox {FF}     &       14      &        Form Feed \\
           \fbox {CR}     &       15      &        Carriage Return \\
           \fbox {ESCAPE} or \$ & 33      &        ESCape or Altmode \\
           \fbox {CTRL/x} &       -       &        Control-x \\
           \fbox {space}  &      40       &        Space \\
           \fbox {DELETE} &     177       &        Delete or Rubout \\
           \fbox {DELIM} or \escape &   -       &        (See below) \\ \hline
\end{tabular}

\medskip

     \fbox {DELIM} is a character used to signify the end  of  text  strings
     and  TECO commands typed at the console.  (TECO presumes that you
     may need to deal with carriage return and line feed  as  ordinary
     characters  in  ASCII  text, so another character must be used as
     TECO's text-string and command-string delimiter.)

     When a command string is  being  executed,  TECO  looks  for  the
     ESCape  character  (octal  033)  as  its  delimiter.   Some newer
     terminals, however, no longer possess an ESCape key.   Late-model
     TECO's  are  capable  of  recognizing  a  surrogate  (some other,
     user-specified) character as signifying an ESCape when  typed  at
     the  console.   Such a character echos as accent grave -- you see
     an \escape character, and TECO receives  an  ESCape  character.   (Note
     that  TECO  programs,  command  files,  and macros cannot use the
     surrogate, since it is translated to ESCape only when you type it
     at  the console.) For details on choosing a surrogate for ESCape,
     see the {\tt EE} flag or the {\tt 8192 ET} bit (section~\ref{Mode Control Flags}).

     Throughout this manual, the term \fbox {DELIM} is used to mean whatever
     character  you type as a text-string or command-string delimiter.
     The \escape character is used throughout to mean whichever character is
     echoed  for  a  keystroke  which passes an ESCape to TECO;  if no
     ESCape surrogate is active, you will see a {\tt \$} instead.

     Control  characters,  \fbox {CTRL/x},  are  produced  by  striking  the
     \fbox {CONTROL} key and a character key simultaneously.

     Throughout this manual, upper case characters  will  be  used  to
     represent TECO commands.

\section* {Preface to the MAY 1985 Edition}

	\addcontentsline{toc}{section}{Preface to the MAY 1985 Edition}

\subsection*{Trading in the ESCape key}

          In the beginning, terminals had ESCape keys.  (Go  back  far
          enough  and  the  device {\tt TT:}  stands for might actually have
          existed on the system, too.) Programs wanting to treat  
	  \fbox {CR}~\&~Co.  as data needed another character to 
	  serve as command delimiter, and ESCape looked available.
        
          Times   change.    Welcome   to   ESCape    sequences,    to
          cursor-control and function keys.  Farewell to \$.

          See the Introduction for the notation used in  this  manual.
          Hello \escape.


\subsection*{Changes to the manual}

          This  edition  of  the  manual  incorporates  new   material
          pertinent  to the enhancements to TECO-11 between Version 36
          and Version 40 (see below).

          Although this manual is still not intended to be a tutorial,
          some ``how to learn'' suggestions (such as use of split-screen
          scrolling) were added, as were indications of how  TECO  can
          be used to build custom-designed editors.

          Numerous smaller changes were  also  made:   clarifications,
          new  index  and  glossary  entries,  additional  explanatory
          material and cross referrals, correction of old  typographic
          errors, and (no doubt) addition of new ones.

	  From Version 36 to Version 40 - affected section numbers

\subsection*{Manual organization/additions}
\begin{itemize} 

          \item	Introduction to Macros (new section), 
		\ref{Introduction to Macros}

          \item	Split-screen scrolling, \ref{Scope Commands}

          \item	``Immediate action commands'' renamed
	          to ``immediate inspection commands'', 
			\ref{Immediate Inspection Commands}

          \item	``Immediate action editing characters'' (new name), 
		\ref{Immediate Action Editing Characters}

          \item	VAX/VMS filespec qualifiers, format/attribute table, 
		\ref{File Record Format}

          \item	Eight-bit ASCII character set table, 
		Appendix \ref{ASCII Character Set}

          \item	Handling for BASIC-PLUS-x source files, 
		Appendix \ref{BASIC-PLUS/BASIC-PLUS-2 Handling}

\subsection[{Significant software changes}]
	{``Significant'' software changes}
                
\begin{itemize} 

          \item	ESCape surrogate - {\tt EE} flag, {\tt 8192 ET} bit, 
		\ref{Mode Control Flags}

          \item	Reverse paging ({\tt -P}, et al, VAX/VMS only), 
		\ref{Page Manipulation Commands}

          \item	Reverse searching ({\tt -N}, et al, VAX/VMS only), 
		\ref{Search Commands}

          \item	Local Q-registers, \ref{Q-registers}

          \item	Local Q-register manipulation, 
		\ref{Q-register Manipulation}

          \item	Immediate ESCape-sequence commands, 
		\ref{Immediate ESCAPE-Sequence Commands}
 
          \item	:{\tt \^{ }T}, read/decode a keystroke, 
		\ref{Special Numeric Values}

          \item	{\tt 32 ED} bit controls immediate ESC-seq commands, 
		\ref{Mode Control Flags}

          \item	Acceptance and handling of 8-bit characters, [throughout]

          \item	Typeout of 8-bit data, and the {\tt 4096 ET} bit, 
		\ref{Mode Control Flags}

          \item	{\tt n:\^{ }T}, one-shot binary-mode character typeout, 
		\ref{Text Type Out Commands}

          \item	TECO HELP facilities on VAX/VMS, 
		\ref{Help}

	\end{itemize}

\subsection[Minor software changes]
	{``Minor'' software changes}

	\begin{itemize}

          \item	{\tt \^{ }W} as immediate mode command (screen re-paint), 
		\ref{Immediate Action Commands}

          \item	\fbox {DELIM} character as immediate inspection command, 
		\ref{Immediate Inspection Commands},
	          \ref{Immediate Action Commands}

	  \item Null tag allowed in computed GOTO, \ref{Branching Commands}

          \item	{\tt nFRtext`} command (replace n characters), 
		\ref{Insertion Commands}

          \item	{\tt m,nFRtext`} command (replace from {\tt m} to {\tt n}), 
		\ref{Insertion Commands}

          \item	{\tt\^{ }E} (form feed flag) can now be user-set, 
		\ref{Special Numeric Values}

          \item	Setting {\tt 1:W} changes width and O/S characteristic, 
		\ref{Scope Commands}

          \item	WRAP/NOWRAP set by 256 ET bit on VAX/VMS, 
		\ref{Mode Control Flags}

          \item	{\tt 128 ED} bit inhibits auto-refresh in split scrolling, 
		\ref{Mode Control Flags}

          \item	Search matching with diacritical marks, 
		\ref{Mode Control Flags}

          \item	New {\tt 0:W} codes for VT102 and GIGI scope types, 
		\ref{Scope Commands}

          \item	VAX/VMS handling of {\tt \^{ }T} (disabled when), 
		\ref{Operating System Character Filters}

	\end{itemize}

\end{itemize}

