Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-05 - decus/20-0145/ante.doc
There are 2 other files named ante.doc in the archive. Click here to see a list.


                          A Nother Text Editor





     


     


                               Highlights


     


    ANTE is a flexible, general-purpose text editor.  It does not impose

a  particular  structure  on  text  (for  example,  lines)  or require a

particular editing technique  (for  example,  video  editing).    It  is

programmable,  however,  and  may  be  made  to do such things as handle

specially formatted text and perform video editing.  It is based on both

TOPS-10 and TENEX TECO,  combining  features  from  both  versions  (and

running  identically  on  TOPS-10,  TENEX,  and  TOPS-20).   It has been

deliberately kept simple, offering a powerful, symmetric set of commands

rather than a cluttered set of special purpose ones.


    In addition to supporting TECO-style editing, ANTE provides a number

of new features.  The more important ones are described here.


    The most significant new feature is the addition of multiple editing

environments.  This substantially increases editing flexibility -- parts

of a file may be separated and edited independently and then  merged,  a

number  of files may be edited at once and merged, and several files may

be consulted while one is being edited.  This has been  accomplished  by

extending  q-registers with the slight additional machinery necessary to

make each a separate, complete enviroment.  The editing  environment  is
                      A Nother Text Editor, Page 2

changed  via  the  A  command  to  a  given  q-register, after which all

commands operate on the q-register as if it were the  main  text  buffer

(the  main  text  buffer  is  in  fact nothing but a q-register with the

special name "*").  See EP, FA, FP, FQ, FX.


    After a sequence of commands is executed one usually  wants  to  see

the result.  ANTE eliminates the need for ending a command stream with a

typeout  command  by  automatically  performing  one.    The  V  command

implicitly terminates a command stream unless the last  command  in  the

stream  is  a  typeout  command,  in  which  case  the  explicit command

overrides the implicit one.  See FV, FW.


    When editing documents it is useful to have word-oriented  commands.

ANTE  has  a  positioning  command, N, and a delete command, O, that are

word-oriented.  nN moves the position  pointer  (the  TECO  .  value)  n

words, and nO deletes n words.  See ^L, ^N, ^W.


    In  an  effort to avoid the mangling of text with a mistyped command

stream, ANTE scans the stream twice.  On the first pass the  correctness

of  the  stream's  syntax  is  verified,  and  if  an  error is detected

processing is aborted.  If the syntax  is  proper  then  the  stream  is

scanned  again and the commands are executed.  An aborted command stream

may be saved in a q-register with the B command.  See ^F.


    To aid programming, ANTE uses a goto-less block  control  structure.

Blocks,  indicated  by  [  and  ],  define  control scopes (which may be

nested), and are conditionally exited (any number of levels) with the FC

command.  They are closely related to the < > iterator.
                      A Nother Text Editor, Page 3

                         Command Input Controls


^A              delete the last character
^E              print the command stream
^F              delete and save the command stream (two in succession)
^G              delete the command stream (two in succession)
^H              delete the last character
^R              print the current line
^U              delete the current line
^W              delete the last word
^V              insert the next character into the command stream
<rubout>        delete the last character
<escape>        terminate command stream input (two in succession)
^H              equivalent to -LV$$ if first character
<line feed>     equivalent to LV$$ if first character
^L              equivalent to -NV$$ if first character
^N              equivalent to NV$$ if first character


                                Commands


                Values may occur wherever n or m occur.
                Integers in braces are default values.
                Valid Qregs are 0 through 9, A through Z, and *.


                                 Values


<digits>        integer
+<value>{1}     unary sign
-<value>{1}     unary sign
<value>+<value> addition
<value>-<value> subtraction
.               the pointer position
Z               the number of characters in the buffer
:               to the end of the line (equivalent to .UaL-2C.UbQaJ.,Qb)
H               all text (equivalent to 0,Z)
                the value-producing commands Q, W, FN, FO, FTI, FZ, F*, F/, #


                        Characters, Words, Lines


<n>{1}C         move pointer n characters
<n>{1}D         delete n characters
<n>{0}J         jump to the nth character
<n>{1}<,m>K     delete n lines (or from characters n to m)
<n>{1}L         move the pointer n lines
<n>{1}N         move the pointer n words
<n>{1}O         delete n words
<n>{1}<,m>T     print n lines (or from characters n to m)
<n>{1}<,m>V     equivalent to -(n-1)T FTS~$ nT (m is the print mode)
                      A Nother Text Editor, Page 4

                                Strings


I[string]       insert text (<tab> is equivalent)
<n>{1}R[string1][string2]
                replace the nth instance of s1 with s2
                (a null second string simply deletes the first string)
<n>{1}S[string] search n times for the string


                              Q-registers


A[Qreg]         change the editing context to the Qreg (initially Qreg *)
B[Qreg]         save the last command in the Qreg
                (the command is inserted if the Qreg is the one being edited;
                  otherwise the command replaces the Qreg's contents)
G[Qreg]         get the text from the Qreg
<n><,m>M[Qreg]  execute the text in the Qreg (n and m are passed as arguments)
<n>{1}<,m>P[Qreg]
                put n lines into the Qreg (or from characters n to m)
Q[Qreg]         get the value from the Qreg
<n>{0}U[Qreg]   put the value into the Qreg
<n>{1}<,m>X[Qreg]
                equivalent to <n><,m>P <n><,m>K
<n>{1}%[Qreg]   add n to the value in the Qreg


                              Input-Output


EG[string]      write the file, exit and go
EE              exit without writing a file
EN[string]      set the default file name used by EG, ER, EW, EX
EP[Qreg][string]
                put the file into the Qreg
ER[string]      read the file
EV[string]      verify the file's existence (return 0 for success)
EW[string]      write the file
EX[string]      write the file and exit


                               Iteration


<n>{infinity}<  iterate n times
>               end the body of an iteration
<n>{1}[         iterate n times (like < but with default of 1)
]               end the body of an iteration (like >)


                             Other Commands


<n>=            print n
W(B|I|S)        return the specified saved pointer position
                (B: before last search, I: start of insert, S: start of search)
                      A Nother Text Editor, Page 5

FA              return to the Qreg last edited
<n>{10}FB       change the base of numeric input/output
<n>{0}<,m>{1}FC<E|N|G|L>
                if n satisfies the given relation
                then exit m iteration levels
                (E:n=0, N:n#0, G:n>0, L:n<0) (the innermost level is 1)
<n>{1}FD[string]
                delete n instances of the string
                (equivalent to <n><R[string]>)
<n>{1}FE        exit n levels of iteration (equivalent to 0,<n>FCE)
FG[Qreg]        print the text in the Qreg (equivalent to @FTS[Qreg])
FH              halt command execution
<n>{" "}FI      insert n as a character at .
FK[Qreg]        eliminate the contents of the Qreg
FM[Qreg][Qreg]  copy the contents of the first Qreg into the second Qreg
<n>{1}FN[string]
                search (like S) and return value (0 for success)
FO              get the value of the character at .
<n>{1}<,m>FP[Qreg]
                insert n lines into the Qreg (or from characters n to m)
FQ              list the status of all nonempty Qregs
<n>{" "}FR      replace n as the character at .
<n>{1}FS[string1][string2]
                replace n instances of s1 with s2
                (equivalent to <n><R[string1][string2]>)
<n>{0}FTE       set echo mode (1:monitor, 0:every char, -1:efficient)
FTI             input a character from the terminal
<n>{" "}<,m>FTO output n as a character to the terminal (with print mode m)
<n>{0}FTP       set the print mode (-1:direct, 0:terse, 1:verbose)
<n>FTS[string]  output the string to the terminal (with print mode n)
<n>{1000}FU     sleep n milliseconds
FV[string]      set the pointer indicator string used by the V command
<n>{0}FW        set <n> as the window size for the automatically executed V
<n>{1}<,m>FX[Qreg]
                equivalent to <n><,m>FP <n><,m>K
FY[Qreg]        verify the syntax of the commands in the Qreg
FZ[Qreg]        get the Z value from the Qreg
<n,m>F*         multiply n by m
<n,m>F/         divide n by m
#[char]         produce the character's value
?               print commands as they are executed
![string]       comment
;               accept and discard arguments
                      A Nother Text Editor, Page 6

                                 Notes


String arguments:
            They  are normally terminated with an <escape>.  They may be
            delimited instead, in which case the / prefix is used.   The
            command   format   is   /   <command>  <delimiter>  [string]
            <delimiter>, for example /I'a string'.  The  contents  of  a
            Qreg  may  also  be  used  as a string, indicated by @.  The
            command format is @ <command> [Qreg], for example @SX.

Searches:    The default search string (the string argument  to  the  S,
            FD,  and FN commands, and the first string argument to the R
            and FS commands) is the last one given. Except  for  the  FN
            command,   if  a  search  within  an  iteration  fails,  the
            iteration is terminated.  There is one  wildcard  character,
            ^X,  which matches everything.  Note the differences between
            R, FS, and FD.

Qregs:       The * Qreg is the default for primary editing.  A Qreg  may
            hold  text and a value simultaneously.  Note that for the P,
            X, and FM commands the original contents of the target  Qreg
            are  lost,  for  the  FP  and  FX commands the given text is
            inserted into the target's original contents, and for the EP
            command the input text is appended to the target's contents.

File names:  Each Qreg has a default file name. It is set  to  the  last
            file  name  given to the last ER, EW, or EN command executed
            in that Qreg.  If the EN command is given  a  null  argument
            the  default  is removed.  Note that the EP command does not
            change the default.

Terminal print modes:
            In direct mode (-1) all control characters are sent  to  the
            terminal  without  translation.    In  terse  mode  (0) some
            control characters are output  directly  and  the  rest  are
            converted  to  printing  characters  preceded  by  "^".   In
            verbose mode (1) some control characters are  sent  as  text
            strings  (<cr>, <lf>, <escape>, <rubout>) and the rest as in
            terse.

Terminal echo modes:
            In monitor  mode  (1)  all  characters  are  echoed  by  the
            monitor.  In character mode (0) they are all echoed by ANTE.
            In  efficient mode (-1) those that require special treatment
            are echoed by ANTE, while  all  others  are  echoed  by  the
            monitor.

Integers:    Integers that begin with 0 are always octal.

Invoking the editor:
            In  general  the command line invoking ANTE can be in one of
            four forms:  CREATE <filename>  creates  a  new  file;  EDIT
            <filename>  edits  an  exisiting file; R ANTE ;<filename> is
            equivalent to EDIT; and  R  ANTE  !<filename>  executes  the
            given file as a macro.