1 MED

        Med,  short for mined (pronounced mi'ned), is a screen editor,
     that  displays  a portion of a user's file on the screen, and any
     changes  the  user makes on the screen go into the file.  Mined's
     greatest  advantage  over  other  screen editors is the ease with
     which it allows the user to manipulate multiple files in the same
     editing session on a conventional (non-workstation) terminal.

2 Conventions

        This  manual  will  use the following conventions: all command
     and  option  names  will  be  enclosed  in <> pairs, and the name
     inside  will  only appear in upper case when the item is actually
     being  defined  (this  is designed to make searching through this
     manual  for  a  particular  item easy).  If an option can take on
     only  a limited set of values then these values will be displayed
     in upper case.

        Control  characters  will  often be displayed by prefixing the
     corresponding  upper case character with `^', that is `^C' refers
     to control-C.

        In  a  few  cases  brackets (`[' `]') will be used to indicate
     optional  items,  and  ellipses  (`...') to indicate an arbitrary
     repetition.

2 Starting

        Mined may be invoked by typing,

        mined [[file][%[num]] ...] [_] [-qualifiers ...] <return>

     ,  that  is,  typing  `mined'  and  optionally  following it with
     various  arguments.  An argument with a filename will cause mined
     to  read in that filename, and start editing it, if more than one
     filename is given (separated by spaces), then the first file will
     be  the one mined starts editing, the second file will become the
     alternate  file  (which maybe obtained by pressing <use> from the
     main  file),  any  other  files  can  be  read in by the sequence
     <enter><use>.  Wildcards are permitted on the command line.

        If  a  number  follows  the filename, then when the user first
     edits  that  file  mined will position the cursor on that line of
     the  file (if no number is specified the cursor will be placed on
     the  first line).  Since it is often useful to move to the end of
     the  file,  the  number  0 is treated as meaning the last line of
     whatever  file  mined is currently editing.  The line number must
     be separated from the filename by a `%'.

        If mined is given no filename arguments it will try to read in
     the  last  file  edited by the user, and position him at the same
     place  in that file.  If it is desirable to edit the same file as
     last time, but also read in a bunch of other files an argument of
     `%'  may  be  used  to specify the previous file, and `%number' a
     specific  line  number  in  that file.  If the second argument is
     either  a  `%'  or `%number' then the last alternate file will be
     read  in.   If  mined is unable to find any files to edit then it
     will enter help mode (see the <help> command).

        If one of the files that mined is to edit does not exist, then
     mined  will  create  it, and warn the user that it is new (on the
     bottom line of the screen).  If this was actually a mistake, then
     as  long  as nothing is typed into this file it will vanish after
     leaving mined.

        An  argument  of  `_'  will cause mined to switch the main and
     alternate  files.  If `_' is the only argument, then the old main
     and alternate files will be read in, but the new main will be the
     old alternate, and vice versa.

        The  qualifier  arguments  are  usually  unnecessary,  and are
     discussed under the section on qualifiers.

2 Leaving

        There  are  two  main ways to leave mined: the <exit> command,
     the  <interrupt>  (^C  on  most  terminals)  command typed twice.
     Typing  <exit> will normally save all the files that the user has
     changed,  and  then  return  to  the shell (or DCL), this is what
     should  normally be used.  The sequence <enter>abort<exit> may be
     used  to  exit  if the user has performed some horrible damage to
     one  of the files he is editing and does not save any files.  See
     the  section  on  the <exit> command for more information.  There
     are  various  other  arguments  that  an  <exit> may take to help
     specify  which files to save and which to ignore, see the section
     on  the <exit> command for more information.  Two interrupts will
     leave the editor in the fastest possible way, saving nothing, and
     making  no  record  of  what files were used in the session.  For
     some caveats on interrupts see that section.

        It  is  also  possible  to  leave  mined  temporarily  with an
     interactive  shell.   Pressing <enter><do> will cause mined to go
     to  sleep, and start up another process running the shell (DCL on
     VMS),  which  is  the  program that normally interprets commands.
     From  here  the  user  may  execute  commands, run programs, etc.
     Typing

        logoff <return> (on VMS)        ^D or logout <return> on UN*X

     will  exit  and  remove  the subprocess and then return to mined.
     Typing

        atm <return>    (on VMS)        (no equivalent on UN*X since
                                         shells are so fast)

     will   exit  the  subprocess  but  will  retain  it  for  further
     <enter><do>  sequences.  This is particularly useful if you "pop"
     back  and  forth  from  the editor to DCL on VMS frequently.  The
     <enter><do>  sequence will not save any files, so the user should
     do  that  beforehand.   The sequence <enter><save> may be used to
     save  all the files that have changed in this session.  Returning
     to  mined  from a subshell is faster that starting up mined again
     (since the files need not be read in again).


2 Basic_editing

        This  section should provide an elementary overview of editing
     with  mined.   The  commands  of mined will vary from terminal to
     terminal  so  no  actual  character  sequences  are  given  here.
     Commands  are  indicated in the following by enclosing them in <>
     pairs  (later on options will also be enclosed in <> so be wary),
     to  find  out what sequences go with what command ask someone, or
     if you are brave enter help mode.

        To  enter  (or  overwrite)  text,  position  the cursor at the
     proper  place  in  the  file,  and  type.   To  insert text press
     <insrtmd>,  type,  and  press  <insrtmd>  again  (to  get back to
     overwrite  mode).   To  erase  the last character typed press the
     <backs>  command,  to  erase  the  last word type <backword>.  To
     start a new line press <return>.

        The cursor may be positioned by using the arrow keys to do the
     obvious,  the  <tab>  key  to  move to the next tab stop (usually
     represented by a `T' at the top of the screen), <backtab> to move
     to the previous tab stop and a return to move to the start of the
     next line.

        The  part  of  the file displayed on the screen may be changed
     with  <+page>  <-page>,  <+lines>, <-lines>, <right>, <left>.  To
     move  a  full  page  forward  (toward  the end of the file) press
     <+page>,  to  move  a full page backward (toward the start of the
     file) press <-page>.  To move a few lines forward press <+lines>,
     to  move  a  few  lines  backward press <-lines> (a return at the
     bottom  line  will  also move forward).  If a line is longer than
     can  be  displayed on the screen, pressing <right> will shift the
     display  to  the  right  (to  view more of the line), <left> will
     shift  it  to  the  left,  and  a  return will return to the left
     margin.

        To  insert  a  blank line press <open>, to delete a line press
     <close>,  to  get back the last line deleted press <restore>.  To
     pick  up the current line (save it somewhere without deleting it)
     so  it can be put into the file at random places press <pick>, to
     put  a  copy of the line picked up into the file press <put>.  To
     delete  the character under the cursor press <delchar>, to delete
     the word after the cursor press <delword>.

        Most  of the commands listed above can take a numeric argument
     indicating  how  many  whatevers  are  to  be  done.  To give the
     command  an  argument press <enter> the argument and the command.
     For example to insert four blank lines press,

        <enter>4<open>

     .   To exit the editor press <exit> (this will save all the files
     that  have  been changed.  To exit without saving any files press
     <enter>a<exit>.   To  save the current file press <save>.  To use
     another  file  press <enter> the file name and <use>, to create a
     new file go through the same sequence.

        To  search  (forward)  for a string type <enter> search string
     <+search>,  to search backwards use <-search>.  If no argument is
     given  to  a search then the last argument will be used.  To do a
     search  and  replace  (search for this string and replace it with
     this string) type,

        <enter> search string <arg> replace string <+search>

     .  A backward replace is similarly handled.

        To  get help press the <help> command.  This may seem circular
     since  it seems that you cannot get help until you know how (know
     the  commands)  at which point help is unnecessary; however, when
     the  editor starts running it displays the character sequence for
     the  help command on the bottom line of the screen (this sequence
     will  usually  have  funny blobs in it, these blobs indicate that
     the  following  character  is  a control character).  Typing this
     sequence will usually put you in a brief help file devoted to the
     terminal  you  are  on, which will give what the commands are for
     that  terminal.  If there is no such file for your terminal, then
     you will be forced to look at this monstrosity (which as you know
     is useless), however, do not despair.  Pressing the <use> command
     (Now  if you don't know what this is you are in trouble) puts you
     in  the  table  of  commands  the  editor keeps internally; it is
     rather cryptic but may be better than nothing.

        If  you do not like the way mined behaves, you will often find
     that there is an option built in that will make mined work better
     (from  your  point of view).  A description of what options do is
     found  in  the  section  options, the description of each command
     should  also  state  how  that  command  is  affected  by mined's
     options.   Options  and commands may all be changed by going into
     the  help  list,  and editing them to take on the desired values;
     once  this has been done correctly you will probably want to save
     what you have done (so that you don't have to change options each
     time  you  enter mined), this may be done by pressing <save> when
     in  the  help  list.   For  a  better  description see the <help>
     command.

2 Error_recovery

        Everyone  makes  mistakes.  Mined has a number of ways to help
     prevent mistakes from being fatal.

        The most obvious problem is deleting something that should not
     have  been  deleted.  Almost all commands that delete things (not
     the  ones  that  delete  characters  (since  they are easy to get
     back),  but  every  other  one)  will  put  the text deleted in a
     special  buffer, called the restore buffer, text may be retreived
     from  here by the <restore> command.  Only the last thing deleted
     will  be saved in the restore buffer, but there is a special file
     called  `#'  which  contains  all  the  text that has been in the
     restore  buffer.   The user may examine this file (<enter>#<use>)
     find  the  text he deleted, pick it up (with the <pick> command),
     go back to his original file (with <use>), and insert it where it
     should  be  with  the  <put>  command.   Note  a  rather peculiar
     feature;  text is not put in the # file until it has been removed
     from  the restore buffer, so the last line deleted is not in this
     file.

        If  the  user discovers that he has totally destroyed the file
     he  is  editing, he can restore it to the condition it was in the
     last    time    it    got    saved   by   <enter>$reload(   $file
     )<evaluate><enter>,  which  will read the file back off the disk,
     and get rid of the copy the editor had.

        If  the  user  discovers that he has totally destroyed all the
     files   he   is   editing,   then   he  can  use  an  abort  exit
     (<enter>a<exit>), to leave mined without saving any files.  If it
     is too late, and he has already saved some files (thus destroying
     them),   mined  may  have  made  backup  copies  of  these  files
     (depending  on the <backup> option), which will contain the state
     of the file when editing started.

        Even  assuming  that the user has behaved perfectly, there are
     still  two  other  sources  of  errors,  the  computer, and mined
     itself.   The  computer  may  run  out  of  disk space, when this
     happens  mined will detect it and inform the user that he may not
     save files (if the user is trying to exit at the time, mined will
     return  to editing, and inform him that there was no disk space).
     When this happens the user has several choices: he can ignore it,
     and  hope  the  problem  will go away (that is continue trying to
     save),  he  can  attempt  to  save  on a different file structure
     (disk) that might have more space, or he can start an interactive
     shell (<enter><do>), and see if he can find any files to remove.

        If the computer goes down, or if mined crashes (or if the user
     is  "gandalfed"),  then  mined  may have kept a record of all the
     commands  typed  in, except for the last few, and this record may
     be used for recovery (see the section on recovery).

2 Screen_display

        The  screen  is usually divided into several windows, of which
     the  biggest  is  the  file being edited.  There is also a window
     down  on  the bottom line displaying status information (the name
     of  the  current  file,  the  current  line,  etc.).   As editing
     progresses the screen can be divided into more windows, each with
     its  own  files  (or  even several with the same file).  Normally
     each window containing a file is surrounded by a box (to separate
     them  from  other  windows).   Each  border of the box around the
     window  currently  being  edited can convey some information.  If
     there is a number in the upper left corner of the window then the
     file  has been shifted over; the number indicates first column of
     it  that  is  visible.  The top border will often display several
     little  tick marks (perhaps `T's); these indicate where tab stops
     have  been  set.   The  left border can indicate whether there is
     text  on  the  line,  and if so whether the file is shifted over.
     The  right  border  can indicate whether there is any text out to
     the  right.   The bottom border is useless.  Any of these borders
     may  be  turned  off,  in which case the lines or columns used to
     display them will be available for normal editing.

        The  user  can  set what is to be displayed on the status line
     (with  the  <status_line> option), or even leave it invisible (in
     which  case  it  will  be used for normal editing when possible).
     Whenever  mined  feels  that  the  user  needs  to be informed of
     something  (search  failure,  that  it is saving a file, etc.) it
     will  display a message on this line.  Whenever the user needs to
     type  an  argument to a command, it will also be displayed on the
     bottom line.

2 Filenames

        Mined  will  accept a network nodename, access control string,
     and  disk in the standard format (optionally with colons replaced
     by tilde).  If a logical name is given followed by either a colon
     or  a tilde, and no nodenames have been found at that point, then
     the  logical  name  will be translated.  A standard DEC directory
     list  may  follow;  in  fact,  an  expression  like [FOO][BAR] is
     accepted  and  becomes  [FOO.BAR].   This is very useful since it
     means  that  a  logical name may contain a subdirectory list, and
     then further subdirectory information may be given later.  A path
     spec  may also be given in the unix style or even in a mixture of
     the  two.   If  a path spec begins with `/' then the logical name
     `SYS$UNIX:'  will  be translated and prepended to the rest of the
     path  spec.  If the first two characters are `~/' then the user's
     home   directory  (`SYS$LOGIN:')  is  translated  and  prepended,
     `~mined/'  prepends the mined home directory, and on some systems
     `~username/' will prepend that user's home directory.  If none of
     these   apply   then   the   current   directory   is  prepended.
     Subdirectories  may  be  specified  by seperating directory names
     with  `/';  there  are  also  two special directory names `.' and
     `..';  `.'  is  a  noop,  `..'  means  go  up  one  level  in the
     subdirectory  tree.   Thus  if  SYS$UNIX = DR0:, SYS$DISK = DB1:,
     SOURCE  =  SYS$UNIX:[USR.CMD.SOURCE], the users home directory is
     DB1:[USR.TXR29970],    and   the   current   path   is   set   to
     DB1:[USR.TXR29970.FOOBAR] then:

        /sysexe/loginout.exe      = DR0:[SYSEXE]LOGINOUT.EXE
        SYS$DISK~usr/bin/ls       = DB1:[USR.BIN]LS
        SOURCE~../egrep.c         = DR0:[USR.CMD]EGREP.C
        ~/foobar/bigfile          = DB1:[USR.TXR29970.FOOBAR]BIGFILE
        spam                      = DB1:[USR.TXR29970.FOOBAR]SPAM
        spamsourc/spam.for        =
                          DB1:[USR.TXR29970.FOOBAR.SPAMSOURC]SPAM.FOR

        [usr]txr29970/foobar/spam = DB1:[USR.TXR29970.FOOBAR]SPAM
        timevx~~user~gww29971/foo = TIMEVX::USER:[GWW29971]FOO

     .  In many programs that use RMS, filenames that happen to be the
     same  as logical names are always treated as logical names.  This
     will  not  happen  in mined, logical names are only translated if
     they are followed by a colon or a tilde.

        If  an  access  control string is given without a password (ie
     with  just  a  username) then mined will prompt for the password;
     the  password  will  not be echoed, and will not be placed in the
     keystroke  file.  The password may be edited while being typed in
     with RUBOUT, or ^H to delete the last character, ^U to delete the
     entire  entry,  ^W  to  delete back to the last space, and may be
     terminated with either RETURN or LINEFEED.

        If  no directory, device, or node specification is included in
     a  filename,  then  mined  will  search for the file on a list of
     directories  called MPATH (which may be set from the environment,
     command line, or the function $mpath).

2 Wildcards

        Mined  accepts  a unique set of wildcards that is a mixture of
     the  unix  and  vms  standards.   A  `?' may be used to match any
     single  character  (it  may be used inside a version number), the
     curly  brace  characters  `{}'  may  be  used to enclose a set of
     characters  one  of  which  must  match,  a  `*'  may  be used to
     represent  an  arbitrary  number of characters inside a directory
     name,   a  filename.extension,  or  a  version  number.   If  the
     characters  `...'  are  found where a directory is expected, then
     they refer to all directories below that point in the tree.

        These wildcards may be specified on the command line, or as an
     argument to the $startwild function.


2 Qualifiers

        A  qualifier  is a command line argument beginning with either
     `-'  or  `+';  they  are  used  to  set  various  flags in mined.
     Qualifiers  may  be specified in any mix of upper and lower case,
     and  may  be  abbreviated as long as the specification is unique.
     The argument of a qualifier is started by a `:' or an `=' and its
     meaning is dependent on the qualifier.  Valid qualifiers are:

        -medfile=file       Specify an med file
        -cap=file           Specify the termcap
        -home=file          Specify the home directory
        -minedhome=dir      Directory containing default .med files
        -term=arg           Specify a terminal type (for use in termcap)
        -help               Enter help mode.
        -tempfile=file      Specify a file to save editing status
        -keystroke=file     Specify a file to save user keystrokes
        -shell=file         Interactive shell to be run by <enter><do>
        -comini=file        Specify a macro to be done at start up
        -tranini=file       Specify a translated macro to be done at start up
        -recover=file       Specify a file to be used to recover a session
        +search=arg         Search forward for arg in main file
        -search=arg         Search backward for arg in main file
        -mpath=arg          Set the search path
        -sleep              Mined may be restarted.

2 Environment

        If mined cannot find information anywhere else it will attempt
     to   read   the   following  items  from  the  environment.   The
     environment  is a set of global variables that the shell sends to
     all  its  subprocesses,  thus an environment variable need be set
     only  once.   Instead  of  having to use the -term qualifier each
     time  mined starts, the user need only set the TERM variable when
     he  logs  in.   Under VMS the environment is simulated by logical
     names (formed by prepending a `$' to the variable name), thus the
     logical  name  $TERM  will  be  used for the environment variable
     TERM.  The user may set this variable by typing,

        $ ASSIGN terminal_type $TERM

     ,  where  the  "terminal_type"  should be a name contained in the
     TERMCAP.;   file.    The   accepted  logical  name  (environment)
     variables are:

        $TERM                The terminal type.
        $TERMCAP             The termcap (file).
        $HOME                The home directory.
        $MINEDHOME           The directroy containing .med files.
        $MEDFILE             An med file.
        $SHELL               Interactive shell.
        $TEMPFILE            A temp file.
        $KEYSTROKE           A keystroke file.
        $COMINI              A macro to be done at start up
        $TRANINI             A translated macro
        $MPATH               Set the search path

     .   In  addition  to the above, mined will also read the chain of
     logical       names      $SPL_DICTIONARY,      $SPL_DICTIONARY_1,
     $SPL_DICTIONARY_2, and so on.  It will search the process logical
     name  table  for  such  a chain (stopping when one of the logical
     names  fails  to  translate),  then the group table, and then the
     system.   Each name that translates is treated as a path spec for
     a  dictionary  to  be  loaded into the spelling corrector, if the
     file  does  not  exist  mined will not complain (thus it would be
     reasonable    to    have    a    system    wide    logical   name
     $SPL_DICTIONARY=SYS$LOGIN:mined.dct,  giving  each  user  his own
     dictionary  that  is  automagicly  read in, if it is present, and
     ignoring it if it is not.

2 Character_format

        When  mined displays a character it will usually display it as
     itself;  however,  there  are exceptions.  All control characters
     are  displayed  as a special blob followed by the character being
     controlled  (thus  a  control-A  might  appear  as []A), a rubout
     character  is displayed as two blobs.  These blobs are treated as
     though  they  were normal characters by most commands (thus it is
     possible  to search for the next blob, to delete a blob and leave
     the  controlled character in its uncontrolled state, etc.), since
     there  is  no  key  on  most  terminals labelled blob, there is a
     special command <quote> to generate this character.

        When  mined reads in a file it converts all control characters
     to  their  blobbed  equivalent  with  the  following  exceptions:
     control-J  will  be used to terminate a line, and control-I (tab)
     may  (depending  on  <input_tabs>)  be  converted  into  multiple
     spaces.   These  conversions  do not happen when mined is editing
     text,  so  the  user  can insert a control-J into the middle of a
     line  if he wants.  When the file is read back in it will be used
     to  break a line.  When saving a file, all blobbed characters are
     converted into the obvious control character, and multiple spaces
     may be converted into tabs (depending on <entab_blanks>).

        Parity characters are not distinguished from normal characters
     on  the display but the parity bit will be retained when inside a
     file  (thus  reading in a file and saving it will not change it).
     These  characters have a special meaning inside translated macros
     (they  represent  commands).  Parity characters may be added with
     the  $addchar  function to <evaluate>.  Searching will ignore the
     parity  bit,  parity  characters are not allowed inside a command
     character sequence, nor on the enter line (in these cases the bit
     will  be stripped off).  A parity control-J or control-I will not
     be treated as a newline or a tab.

2 Changing_text

        The  most necessary part of editing is entering text, in mined
     this  is  easy, any printing characters typed by the user will be
     put  in  the  current  file where the cursor is pointing, and the
     cursor  will  move  over  one  space  to  make  room for the next
     character.  Mined will either overwrite what was under the cursor
     before,  or  move the rest of the line one space to the right and
     insert the new character (if there is no text after the cursor on
     the  current  line these two modes are equivalent).  The user may
     toggle  between  insert  and  overwrite  modes  by  the <insrtmd>
     command.

        The  user  may also request that mined fill or justify text as
     it is typed in.  When filling multiple spaces are removed (unless
     they  follow  a  period or some other character that terminates a
     sentence  (determined  by  the  <double_space> option), or unless
     they  are  leading  spaces  (indentation)).   When the user types
     beyond  a certain point on the line (determined by the <fill_col>
     option) mined will move to the next line, usually taking the word
     being  typed  along  with the cursor.  This word will be moved to
     the  next  line,  and indented by the same amount as the previous
     line.   If  the  user  is  typing  at  the  end  of  a  paragraph
     (determined  by  the  options <paragraph>, and <break_paragraph>)
     then  new lines will be added, otherwise the cursor will be moved
     to the appropriate place on the next line (which will be refilled
     to  make room for any new words).  When justifying, the line will
     be  filled  first,  and  then  justified.   The  last  line  of a
     paragraph  is  never  justified,  only filled.  Mined is somewhat
     smart  about control characters, it knows that control-H takes up
     -1  spaces, and it assumes that all other control characters take
     no  room;  thus  unfillable  spaces  may  be  inserted with space
     <quote>  H space (this will look ugly in mined, but it will print
     out  properly).   Normally mined does none of this processing and
     leaves  the  text  as  entered,  this is controlled by the <mode>
     option.

        Some people like to pretend they are on a typewriter where the
     bell  rings  whenever they type close enough to the right margin;
     this  may  be  done  in  mined  by  setting the <beep_pos> option
     appropriately.  Usually this flag is set to NEVER (never ring the
     bell),  because  mined  has  better ways of doing this: either by
     allowing  mined  to  break  the  line automaticly in auto-fill or
     auto-just  modes,  or  by allowing mined to shift the screen over
     whenever  a  character is typed on the right margin (<char_shift>
     option).

        One  rather  useful  feature  when  programming (especially in
     LISP)  is  automatic  parenthesis  matching  (determined  by  the
     <matching_paren> and <match_time> options).  If this is set, then
     whenever  a  close  parenthesis  (determined  by  the <paren_end>
     option) is typed a matching open parenthesis is searched for, and
     the  cursor  is  moved  briefly  to the open paren.  If the close
     parenthesis  is of a different type from the open parenthesis (or
     if  no  open parenthesis is found) then the user may ask mined to
     beep    to    indicate   this   mismatch   (determined   by   the
     <mismatch_paren> option).

2 Messages

        Mined  sometimes  feels the need of giving the user a message,
     this  may  occur  because  of an error (search failure, disk full
     when  saving,  etc.)  or  because  the user asks for information.
     Most  messages  will  fit  onto one line of the screen, and these
     will  be  displayed  on  the  bottom  line  of  the screen, error
     messages  will  stay  on that line for <error_stay> commands, and
     informative  messages  for  one  command (typing in text does not
     affect the message).

        If  the  message  turns  out  to be longer than one line, then
     mined will take over part of the screen to display the text.  The
     message  will  be  typed  out  beginning  on the line beneath the
     current  one, if this message takes more than just one screenfull
     then mined will pause, and display `--- More---' at the bottom of
     the  screen.   To  get more text the user should type a space, to
     restart  the message type a <backs>, to abort (get out of message
     mode) type any other command (this command will not be executed).
     When  mined  reaches  the  end  of a message a space will have no
     effect,  a  <backs>  will  type  the  whole  thing out again, and
     anything else will return to normal command level.

        When  in message mode, all input comes from the terminal, none
     will be read out of macros.

2 Commands

        The following is a brief description of the commands:

        Normal editing seesion commands:

        ENTER        Start an argument sequence ( for another command).
        RECALL       Recall the last noncursor-motion argument.
        ARG          Enter a second argument to a command.
        BACKS        Delete the character before the cursor.
        BACKWORD     Delete the word before the cursor.
        DELCHAR      Delete the character after the  cursor.
        DELWORD      Delete the word beginning at the cursor.
        QUOTE        Allow the insertion of a control char.
        INSRTMD      Toggle insert mode.
        LEFT         Move the cursor one space left.
        RIGHT        Move the cursor one space right.
        UP           Move the cursor one line up.
        DOWN         Move the cursor one line down.
        TAB          Move the cursor to the next tabstop.
        BACKTAB      Move the cursor to the preceding tabstop.
        RETURN       Move to start of next line.
        INSERT_RETURN Insert a newline and move to next line.
        HOME         Move to upper left corner of screen.
        +PAGE        Move one page toward the end of the file.
        -PAGE        Move one page toward the start of the file.
        +LINES       Move a few lines toward the end of the file.
        -LINES       Move a few lines toward the start.
        RSHIFT       Shift the screen a few spaces right.
        LSHIFT       Shift the screen a few spaces left.
        GOTO         Goto specific line.
        MARK         Set/goto mark.
        REFRESH      Refresh the screen.
        +SEARCH      Search for a string toward the end of the file.
        -SEARCH      Search toward the start of the file.
        +REGULAR     Search for a regular expression toward the
                     end of the file.
        -REGULAR     Search toward the start of the file.
        OPEN         Insert a blank line.
        CLOSE        Delete a line, and save it.
        RESTORE      Put down last thing deleted.
        PICK         Pick up text (without deleting) and put in buffer.
        APPEND       Pick up text and append to the buffer.
        PUT          Put down the text.
        STORE        Put text into a buffer.
        EXIT         Exit from the editor, saving all changed files.
        USE          Edit another file.
        SAVE         Save this file.
        WIND         Edit another file in its own window.
        CHWIND       Change windows.
        FILL         Fill or justify the file.
        DO           Execute a program to process a portion of the file.
        HELP         Enter help mode.
        STATUS       Examine the status of the files edited.
        SET          Set the flags for the current file.
        SRTAB        Set/Reset a tabstop.
        INTER        The interrupt character.
        SIGNAL_STATUS Information interrupt.

        Editing session macro and evaluation commands:

        ENTER_COM    Enter a mined command in the file.
        TRANSLATE    Translate the file to or from command format.
        EXECUTE      Execute the file as a mined macro.
        EVALUATE     Use the contents of the named buffer as an argument.
        DO_EVAL      Evaluate an expression and ignore the results.
        WHILE        Start a repeat sequence.
        IF           Conditionally execute commands.
        ELSE         Conditionally execute commands.
        END          End a repeat sequence (and start executing).
        STOP_REPEAT  Abort an input stream.
        MACRO_RETURN Return from a macro or a user defined command.
        MSG          Display a message.
        INPUT        Get text from a user.
        BRK          Enter the macro debugger

3 <ENTER>

        The  enter  command  is  used  to  enter  an argument(s) for a
     command, which may consist of cursor motion or normal characters.
     An  argument  containing  normal  characters may also include the
     <quote>  character; it may be edited using the <backs> command to
     delete characters and <backword> to delete words.  Typing <ENTER>
     again  will  always  return  to  normal  mode.   A  cursor motion
     argument  consists of several cursor motion commands, and is used
     to  define  a  set  of lines, or a rectangle over which the final
     command is to take effect (Cursor motion may be started by one of
     the  following  commands <left>, <right>, <up>, <down>, <return>,
     <tab>,  <backtab>, <home>, <+page>, <-page>, (and perhaps various
     user  defined  commands) and may be continued by any of the above
     or  <rshift>,  <lshift>,  <goto>, <+lines>, <-lines>, <+search>,
     <-search>,  <+regular>,  <-regular>,  <mark>,  (these  have other
     meanings if used directly after an <ENTER>)).

        When  <ENTER>  is typed a blob appears on the screen where the
     cursor  was,  and  a prompt appears on the bottom line.  The user
     should  type  his argument, and then enter the command.  The blob
     and prompt will disappear, and the command will be executed.

3 Text_arguments

        Many  commands  need to specify a lump of text (to be deleted,
     picked  up,  etc.);  all  of  these  commands will accept several
     different  ways  of  specifying  the  desired  text.   There  are
     essentially two different types of arguments, cursor defined (the
     movement of the cursor defines the text) and numeric (a specified
     number  of  words,  or paragraphs, etc.).  These arguments may be
     used three ways: as a number of lines, as a rectangle of text, or
     as  text  starting from one location and going to another.  Often
     mined  will use the type of the argument to determine how to pick
     it up, for instance a sentence specification should pick up text,
     a  line  specification  lines; however, cursor motion (and double
     mode  specifications) are treated differently.  If <curmotion> is
     set  for  WRAP,  then  the  text  beginning at the initial cursor
     position (where <enter> was pressed) to the final cursor position
     will be dealt with.  If this option is set to RECTANGLE and there
     is  no horizontal separation between the initial and final cursor
     positions then the text used is all the lines from the initial to
     the  final  line (inclusive).  If there is horizontal separation,
     the  text  is  the  delineated rectangle beginning at the initial
     line  and terminating at the final line (inclusive) and beginning
     at  the  leftmost  horizontal position, and terminating one space
     before the rightmost position.

        A      numeric      specifier      is      of     the     form
     [number][mode][,][number][mode].   If  the full form is used then
     one  number mode pair is used as a horizontal, and the other as a
     vertical  separation  to  define a box as above (which depends on
     the  <curmotion> option as the cursor motion box does).  The mode
     specifies  the type of thing to use, and the number specifies the
     number  of  those  things to deal with.  If the number is omitted
     then  1  is  assumed,  if  the  mode is omitted then `l' is often
     assumed (<delchar> assumes `c' and <delword> which uses `w', etc.
     ),  if  both are omitted then 1 of the default mode will be used.
     Valid modes are:

        c         characters
        w         words
        s         sentences
        e         s-expressions (vaguely)
        l         lines
        b         paragraphs
        p         pages
        f         files
        n         white space (non-printing)

     .   A character specifier defines a number of characters (this is
     limited  to  one  line), a line is fairly obvious, a paragraph is
     delimitted   by   blank  lines,  indentation  (depending  on  the
     <paragraph>  option)  or  by  a  line  beginning  with one of the
     characters in <break_paragraph>; a page by a line starting with a
     formfeed  (^L), a file specifies the rest of the file.  A word is
     delimitted  by  the  end  of  the current line, a space, a tab, a
     comma,  a  semicolon,  a period, an exclamation point, a question
     mark,  a quote character, parentheses, brackets, and curly braces
     (these  may  be  changed  with the <word_end> option, beware that
     decimal points in numbers are treated as periods).  A sentence is
     delimitted   by  a  blank  line,  or  a  period,  question  mark,
     exclamation  point  (these  may  be  changed with <double_space>)
     followed  by  either  a  space  or  the  end  of the line.  An s-
     expression  is either a word, a comment, a parenthetical element,
     a  quoted string or a single character that does not start any of
     these.   The  number  may  be  either  positive  or negative, and
     indicates the direction of the specification.

3 <RECALL>

        The  <RECALL>  command  is  used  to  recover from mistakes in
     <enter>ed  arguments.   Typing  <RECALL>  causes the editor to go
     into  enter  mode,  and  display  the  last argument; this may be
     edited   in  the  normal  fashion.   Cursor  motion  may  not  be
     recovered, and nulls the argument.

3 <ARG>

        This  command  is used to pass several arguments to a command;
     if  used  after  an  <enter>  (or <recall> or <evaluate>) it will
     start  a  second argument (or nth) argument, if used elsewhere it
     will  behave  like  an  <enter>.   <ARG>  may  separate two typed
     arguments,  in  which  case  the  <backs>  command may be used to
     correct  the  first argument; if <ARG> seperates a cursor defined
     argument  from  a  typed argument, there is no way to go back and
     revise the first argument.

3 <BACKS>

        The  <BACKS> command is used to delete a character in front of
     the cursor.  It moves the cursor back one position, if this would
     move  the  cursor off the screen, the screen is left shifted (the
     reverse of typing a character on the right margin), if the cursor
     is  on  column  one  then the <backs_type> option will be used to
     determine behavior.  If insert mode is on then the preceding char
     (the  one  on top of which mined has just placed the cursor) will
     be deleted and the rest of the line moved over to take its place,
     in  overwrite  mode  this character will be converted to a space.
     <BACKS>  does  not set the restore buffer, any characters deleted
     are lost.  <BACKS> may not be given an argument (if used after an
     enter  it will delete the last character in the entered argument,
     and will die on cursor motion).

3 <BACKWORD>

        The  <BACKWORD> command is used to delete the word in front of
     the  cursor.   It  moves  the cursor back to the beginning of the
     word, if this would move the cursor off the screen, the screen is
     left  shifted  (the  reverse  of  typing a character on the right
     margin),  if  there  is  no  word  in  front of the cursor on the
     current  line  and  the  <word> option is on WRAP then the cursor
     will  move  back  over  several  lines  until  it  finds  a word,
     otherwise  (<word>  is  set  to  LINE) it will stick where it is.
     When  in  insert  mode  any  lines and characters passed over are
     deleted, in overwrite mode the lines are left, and the characters
     are converted to spaces.  <BACKWORD> may not be given an argument
     (if  used  after  an  enter  it  will delete the last word in the
     entered  argument,  and  will  die  on  cursor motion).  Any word
     removed  (except  from the enter line) will be put in the restore
     (!) buffer.

3 <DELCHAR>

        The  <DELCHAR>  command will (by default) delete the character
     on  which the cursor is positioned.  <DELCHAR> will accept a text
     specifier  as  an  argument  (see  the subsection TEXT ARGUMENTS)
     where the default mode is character.  <enter><DELCHAR> deletes to
     the  end of the current line.  <DELCHAR> does not set the restore
     buffer, any text deleted with this command is lost.

3 <DELWORD>

        The  <DELWORD> command will (by default) delete a word.  Where
     a  word  starts at the cursor, includes any leading spaces, tabs,
     and  marks of punctuation, and contains any text up until the the
     next  word delimitter.  <DELWORD> will accept a text specifier as
     an argument (see the subsection TEXT ARGUMENTS) where the default
     mode  is  word.   If  <word>  is  set to WRAP, and more words are
     specified  than  are  on  the current line, words will be deleted
     from  following lines.  <enter><DELWORD> moves the cursor back to
     a  word delimitter, and does a normal <DELWORD> there (that is it
     deletes  all  of  the  word  the  cursor is sitting on.  Any text
     deleted is put in the restore (!) buffer.

3 <QUOTE>

        The  <QUOTE> command is used to insert control characters in a
     file.   When  saving  a  file  (or executing a program) a <QUOTE>
     character  followed by another character generates the control of
     the  following  character.  That is <QUOTE>A generates control-A,
     etc.   The sequence <QUOTE><QUOTE> is a special case, and means a
     rubout  character.   When  reading  in a file (or the output of a
     program) control characters and rubouts will be translated to the
     corresponding  <QUOTE>  sequences  with the following exceptions:
     newline (control-J) characters are used to delimit lines, and tab
     (control-I)  characters  may be converted to the proper number of
     spaces  (assuming  tabstops  every 8 characters).  When inserting
     text  putting a <QUOTE>I or <QUOTE>J in the middle of a file will
     not  have  any special meaning.  A <QUOTE> character behaves just
     like  a  normal  character  except  that for display purposes any
     character  following  is  converted  to  the range of @ through _
     inclusive.   <QUOTE>  characters may be used as arguments to some
     commands.

3 <INSRTMD>

        The  <INSRTMD> command is used to toggle whether the editor is
     in  insert or overwrite mode.  In overwrite mode characters typed
     overwrite  those  on  the screen, in insert mode characters typed
     cause  the rest of the line to be moved over to make room for the
     new  arrivals.   <INSRTMD> also changes the effect of <backs> and
     <backword>,  in  overwrite  mode  these  move back and change the
     indicated  character(s)  to a space(s), in insert mode these move
     back and delete the text.  <enter><INSRTMD> will turn insert mode
     on, <enter><arg><INSRTMD> will turn it off, any other argument is
     illegal.

3 <LEFT>

        The  <LEFT>  command  moves the cursor one space left, if this
     would  cause  the cursor to move off the edge of the screen, then
     either  the cursor will appear at the right margin, or the screen
     will  be  shifted  (depending on <hor_curmotion> option).  <LEFT>
     will accept an integer as an argument, and will perform that many
     <LEFT>s,  the  integer  may  be negative, in which case that many
     rights  are performed.  The integer may also be followed by a `w'
     (`s',  `e'),  in which case the cursor moves over that many words
     (sentences,  expressions).   As  a special case the argument ^ is
     accepted,  and  moves the cursor to the first column with text on
     it  (or to column one, if either there is no text on the line, or
     <trailing_blanks>  is  set  to  SAVE),  if  the column is off the
     screen, then the screen will be shifted to make it visible.  This
     maybe used inside of, or to start cursor motion.

3 <RIGHT>

        The  <RIGHT> command moves the cursor one space right, if this
     would  cause  the cursor to move off the edge of the screen, then
     either  the  cursor will appear at the left margin, or the screen
     will  be shifted over to make room for it (depending on the value
     of  <hor_curmotion>).   <RIGHT>  will  accept  an  integer  as an
     argument, and will perform that many <RIGHT>s, the integer may be
     negative,  in  which  case  that  many  lefts are performed.  The
     integer  may also be followed by a `w' (`s', `e'), and the cursor
     moves  over  that  many  words  (sentences,  expressions).   As a
     special  case  the  argument  $ is accepted, and moves the cursor
     immediately  after  the last column that has any text in it (this
     does  not include trailing spaces unless <trailing_blanks> is set
     to SAVE).  If this column is off the screen, then the screen will
     be  shifted  so  that  this column appears near the middle of the
     screen.  This maybe used inside of, or to start cursor motion.

3 <TAB>

        The  <TAB>  command  moves the cursor to the next tab stop.  A
     <TAB>  from  the  right  margin moves to the first tabstop on the
     screen.   A  <TAB>  that  would  place the cursor off the screen,
     either  moves  it  to  the  right  margin,  or  shifts the screen
     (depending  on  the value of <hor_curmotion>).  <TAB> will accept
     an  integer  as an argument, and performs that many <TAB>s.  This
     maybe used inside of, or to start cursor motion.

3 <BACKTAB>

        The  <BACKTAB>  command  moves the cursor to the preceding tab
     stop.   A  <BACKTAB>  from  the  left margin will either move the
     cursor  to  the last tabstop on the screen or shift the screen to
     find   a   preceding   tab   stop  (depending  on  the  value  of
     <hor_curmotion>).  Any other <BACKTAB> that would move the cursor
     off  the  screen,  will either position it on the left margin, or
     shift  the  screen  (depending  on the value of <hor_curmotion>).
     <BACKTAB>  will  accept  an  integer as an argument, and performs
     that  many  <BACKTAB>s.   This  maybe used inside of, or to start
     cursor motion.

3 <UP>

        The  <UP>  command  moves the cursor one line up on the screen
     (toward  the  start  of the file).  If this would move the cursor
     off  the  top  of the screen, either it appears at the bottom, or
     the   screen   is   scrolled   (depending   on   the   value   of
     <ver_curmotion>).   <UP>  will  accept  an  integer argument, and
     performs that many <UP>s.  This maybe used inside of, or to start
     cursor motion.

3 <DOWN>

        The  <DOWN>  command moves the cursor one line down the screen
     (toward  the end of the file).  If this would move the cursor off
     the  bottom  of the screen, then either it appears at the top, or
     the   screen   is   scrolled   (depending   on   the   value   of
     <ver_curmotion>).   <DOWN>  will  accept an integer argument, and
     performs  that  many  <DOWN>s.   This maybe used inside of, or to
     start cursor motion.

3 <RETURN>

        The  <RETURN> command moves the cursor to the beginning of the
     next line.  If the cursor is on the last line of the screen, then
     a  <RETURN>  will  cause  the  screen  to be scrolled (the amount
     determined  by  <return_scroll>).  The horizontal position of the
     cursor is determined by the <return_type> option.  The cursor may
     be  placed  on  the left margin, or in column one, or move to the
     first  non-space  character  (unless  the line is blank, in which
     case  the  indentation  of  the  previous  line  will  be  used).
     <RETURN>  takes  a  positive  integer  argument  to  say how many
     returns  to  do,  or  a  fraction of the screen.  This maybe used
     inside of, or to start cursor motion.

3 <INSERT_RETURN>

        This  command  splits the current line at the cursor position,
     and  creates  a  new  line beginning with the character under the
     cursor.   the  cursor  is then positioned at the start of the new
     line (if this entails shifting or scrolling the screen it will be
     handled  as in <return>).  If <return_type> is on INDENT then the
     new  line  will be indented the same amount as the previous line.
     <INSERT_RETURN> takes a positive integer argument to say how many
     newlines to insert.

3 <HOME>

        The  <HOME>  command moves the cursor to the upper left corner
     of  the screen.  It will not accept an argument.  This maybe used
     inside of, or to start cursor motion.

3 <+PAGE>

        The  <+PAGE> command moves one page toward the end of the file
     (a  page  is  defined  to  be  the number of lines in the current
     window).   It takes an argument specifying the number of pages to
     move.  This maybe used inside of, or to start cursor motion.

3 <-PAGE>

        The  <-PAGE>  command  moves  one page toward the start of the
     file  (a page is defined to be the number of lines in the current
     window).   It takes an argument specifying the number of pages to
     move.   This  command will not move before the start of the file,
     an  attempt  to  do  so will stop at the start of the file.  This
     maybe used inside of, or to start cursor motion.

3 <+LINES>

        The  <+LINES>  command  moves about one third of the number of
     lines  in  a  page  toward  the  end  of  the file (determined by
     <vert_scroll>).   It  takes  an argument specifying the number of
     lines  to  move, or a screen fraction.  <enter><+LINES> moves the
     current  line  to the top of the screen.  <+LINES> may be used in
     cursor motion (but not to start cursor motion).

3 <-LINES>

        The  <-LINES>  command  moves about one third of the number of
     lines  in  a  page  toward  the  start of the file (determined by
     <vert_scroll>).   It  takes  an argument specifying the number of
     lines  to move, or a screen fraction.  This command will not move
     before  the  start  of the file, an attempt to do so will stop at
     the start of the file.  <enter><-LINES> moves the current line to
     the  bottom of the screen.  <-LINES> may be used in cursor motion
     (but not to start cursor motion).

3 <RSHIFT>

        The <RSHIFT> command shifts the screen over so that long lines
     may  be  read.   By default it shifts the screen two tab stops to
     the right (determined by the <hor_shift> option), if the space of
     two  tab stops is larger than the window width then one fourth of
     the  width  plus  1  is  used.   <RSHIFT>  will accept an integer
     argument  specifying  the  number of columns to shift, an integer
     followed  by `t' specifying the number of tabstops to shift, or a
     screen fraction.  <enter><RSHIFT> makes the current column become
     the  left  margin  of the screen.  <RSHIFT> may be used inside of
     (but not to start) cursor motion.

3 <LSHIFT>

        The  <LSHIFT>  command  shifts  the  screen  left  so that the
     beginning  of  long  lines may be read.  By default it shifts the
     screen  two  tab stops to the left (determined by the <hor_shift>
     option),  if  the space of two tab stops is larger than the width
     then  one  fourth  of  the window width plus 1 is used.  <LSHIFT>
     will  accept an integer argument specifying the number of columns
     to  shift,  an  integer  followed by `t' specifying the number of
     tabstops,  or  a  screen  fraction.   <enter><LSHIFT>  makes  the
     current  column become the right margin of the screen (if that is
     possible).   <LSHIFT>  may  be  used inside of (but not to start)
     cursor motion.

3 <GOTO>

        The  <GOTO>  moves  to  a specific line in the file.  A <GOTO>
     without  an  argument  moves  to  the  start  of  the  file.   An
     <enter><GOTO>  moves  to  the  end  of the file.  A <GOTO> with a
     signed  argument moves that many lines forward or backward in the
     file.   A  <GOTO>  with  an argument of 0 moves to the end of the
     file.   A  <GOTO>  followed  by  some other integer moves to that
     line.   <GOTO>  may  be  used  in cursor motion (but not to start
     cursor motion).

        If  the  line  gone  to is on the screen, no scrolling will be
     done,  otherwise  the position of the new line (on the screen) is
     determined  by  <goto_position>.   The horizontal position of the
     cursor is always determined by <hor_position>.

3 <MARK>

        Every  file  instance  contains a mark, initially this mark is
     set  at  the end of the file.  The <MARK> command allows the user
     to  go to the mark, and to set the mark.  <MARK> will goto to the
     mark.   <enter><MARK>  will  set  the  mark  to the current line.
     <enter><arg><MARK>  will  set  the  mark to the current line, and
     move  to  the  old mark.  <MARK> with a numeric argument will set
     the  mark on that line.  <MARK> may be used in cursor motion (but
     not to start cursor motion).

        The cursor is positioned as in <goto>

3 <REFRESH>

        The  <REFRESH>  command  is  used  to  retype  the screen.  If
     someone  has sent a message, or if (heaven forbid) the editor did
     not update the screen properly, or if the screen has just decided
     to  disappear  of its own accord this command will bring it back.
     If <REFRESH> is used immediately after an <enter> it will refresh
     the current line, if <REFRESH> is given an argument of <arg> then
     it  will  update  the  screen  without  clearing it (this is only
     useful in macros), if used with any other argument, it behaves as
     it  normally does, and clears the screen (but leaves the argument
     intact).

3 <+SEARCH>

         The <+SEARCH> command searches toward the end of the file for
     a  string.   If it is given an argument, it will search for that,
     otherwise  it  will  use  the  last  string searched for.  As the
     search  occurs a message will appear on the bottom specifying the
     direction  of  search,  and  the  search  string.   If the search
     succeeds   the   cursor  will  be  moved  to  the  matching  text
     (scrolling, and shifting the screen if necessary).  If the search
     fails  the  cursor  will  remain  where  it  was,  and  a message
     indicating   failure   will   appear  on  the  bottom  line.   In
     significant  case mode, a backslash will cause a letter following
     to  match  in  either  case.   In  case insignificant mode (where
     letters  match  in  either case), a backslash will force an exact
     match.   An  <interrupt>  may  be  used  to  abort a search (when
     <terminal>  is  set  to COOKED).  <+SEARCH> may be used in cursor
     motion  (but  not  to start cursor motion).  For more information
     see the subsection on REPLACE.

3 <-SEARCH>

        The  <-SEARCH>  command  searches toward the start of the file
     for  a  string.   If  it is given an argument, it will search for
     that, otherwise it will use the last string searched for.  As the
     search  occurs a message will appear on the bottom specifying the
     direction  of  search,  and  the  search  string.   If the search
     succeeds   the   cursor  will  be  moved  to  the  matching  text
     (scrolling, and shifting the screen if necessary).  If the search
     fails  the  cursor  will  remain  where  it  was,  and  a message
     indicating   failure   will   appear  on  the  bottom  line.   In
     significant  case mode, a backslash will cause a letter following
     to  match  in  either  case.   In  case insignificant mode (where
     letters  match  in  either case), a backslash will force an exact
     match.   An  <interrupt>  may  be  used  to  abort  a  search (if
     <terminal>  is  set  COOKED).   <-SEARCH>  may  be used in cursor
     motion  (but  not  to start cursor motion).  For more information
     see the following section.

4 Replace

        Replacing text is part of the search commands.  These commands
     actually take two arguments (separated by the <arg> command), the
     first  of  these  being  the  search string, the second a replace
     string.   A  search  with  no  arguments  will  perform  the last
     search/replace  (that is if the last search/replace was a replace
     then  a  replace is done, otherwise a simple search is done).  If
     the last search/replace command was a search then <enter><search>
     is  a  normal  search,  if it were a replace then <enter><search>
     will  attempt  to  undo  the  last replace command (by moving one
     character  in the opposite direction of the search, and reversing
     the search and replace arguments.  If <enter>arg<search> is typed
     then  arg  will be searched for.  If <enter>arg1<arg>arg2<search>
     is typed then arg1 will be searched for and replaced by arg2.  If
     <enter>arg1<arg><search> is typed then then arg1 will be searched
     for  and  replaced  by  nothing.   If <enter><arg>arg2<search> is
     typed  then  it will search for the last search text, and replace
     it by arg2.

3 <+REGULAR>

        <+REGULAR>   is   very  like  <+search>  except  that  various
     characters  are  treated specially.  This command takes a regular
     expression  (defined  below),  and  searches  for  it.  A replace
     string may be specified as with search.

        If  no  argument  is  given  to  <REGULAR>  it will search for
     whatever  the  last  <search>  or  <REGULAR>  searched  for.   An
     <enter><REGULAR>  will  undo  the last <search>, or <REGULAR>.  A
     <search>  with  no  argument  that follows a successful <REGULAR>
     will  match  whatever the <REGULAR> found (a replace will replace
     with  whatever  the  <REGULAR>  replaced  with).   If  a <search>
     follows  an  unsuccessful  <REGULAR>  it  will act on the literal
     argument of the <REGULAR>.

3 <-REGULAR>

        <-REGULAR>   is   very  like  <-search>  except  that  various
     characters  are  treated specially.  This command takes a regular
     expression  (defined  below),  and  searches  for  it.  A replace
     string may be specified as with search.

4 Regular_expressions

        The search string may be a regular expression of the following
     form:

        any character without special meaning matches itself.

        ^  matches the beginning of a line if it is positioned so that
           it can, otherwise it matches itself.

        $  matches  the  end  of a line if it is positioned so that it
           can, otherwise it matches itself.

        \ddd matches the octal character specified by ddd.

        \letter matches the letter in either case.

        \char matches that character exactly.

        [string]  matches  any  of  the  characters  specified  by the
           string.   If  the string begins with `^' then it will match
           characters not specified by the second half.  The string is
           treated  as a list of specifications of which there are two
           sorts:  a  single character spec is either a character or a
           backslash  sequence, a range spec consists of two character
           specs  separated  by `-'.  An `^' found anywhere other than
           the  first position is a character spec, a `-' found in the
           first  position  or after a range spec is a character spec,
           and a `]' found in the first position or after a range spec
           is a character spec.

        The  concatenation  of  two  regular  expressions  matches a a
           string,  the  first part of which matches the first regular
           expression,  and the second part matches the second regular
           expression.

        ex1|ex2 will match a string that matches either ex1 or ex2.

        ex1&ex2 will match a string that matches both ex1 and ex2.

        ex?  matches zero or one instances of ex.

        ex* matches zero or more instances of ex.

        ex+ matches at least one and maybe more instances of ex.

        ex{num1:num2}  matches  num1 to num2 instances of ex.  If num1
           is  omitted  0 is used, if num2 is omitted infinity is used
           if :num2 is omitted num1 is used.

        (ex) matches ex.

        ~ex  matches  a  string  which does not match ex.  This almost
           certainly  does  not  mean  what  you  think  it  does; for
           instance  the  null string is something that does not match
           almost  anything.   Thus ~(spam) will appear to match spam,
           since  it is actually matching the null string (or the `s',
           or  the `sp', or the `spa'), which is the same as spam.  To
           get  this operator to do what you want, you should probably
           use  it in conjunction with the intersection operator, thus
           (~(spam))&(....)  will  match  any  four character sequence
           that is not `spam'.

        <ch  starts  remembering  text  in  register  ch.   (ch is one
           character)

        >ch stops remembering text.

        `<'  and `>' have the highest priority, next `?' `*' `+' `{}',
           then `~', then concatenation, and lastly alternation.  This
           order may be altered using `()' as usual.

        The  replace  string  recognizes three metacharacters, `&' `$'
     and  `\'.   If  an `&' is used, then the text matching the search
     string will be inserted at that point.  `\ddd' produces the octal
     character character ddd, and `\char' produces that character.  If
     `$ch' is used then the text in register ch will be inserted.

        If  a  register is used that has never been set, then the null
     string is inserted.  If a register is not terminated then the end
     of  the  string  found is used to terminate it.  If a register is
     started more than once, then the first start will be used, and if
     it  is  terminated  more  than  once the last termination will be
     used.

        If  when  a  match  is  found it is the longest possible match
     starting from where the match was found.  Thus,

        <enter>Fo{2:4}. <arg>spam<+regular>

     on  the  input  "Foooor"  will  produce  "spam", not "spamor", or
     "spamr".   If this yields an ambiguous parsing for the registers,
     then  a  parse  will  be  chosen  at  random, and nothing will be
     stated, for instance,

        <enter>foo<abar|f<aoobar <arg>$a<+regular>

     might produce either "bar" or "oobar" on input "foobar".

        Like   every   thing  else  in  mined,  these  characters  are
     changeable,  and  may  even  be  turned  off (when a character is
     turned  off  it  loses its special meaning unless preceded by the
     quoting character (normally `\')).  A character may be changed by
     entering  help mode (see the <help> command) moving to the end of
     the  line  containing  the  desired  character, and typing in the
     replacement.   A  character may be toggled between on and off, by
     moving to the front of the line and pressing `~'.  The characters
     appear in the help list with the following names:

        <quote>        This  is  the  character  used  to  quote other chars
                       normally to hide special meanings.
        <bunch>        This starts a bunch (also called  a  character  class)
                       something like [a-zA-D] under unix.
        <close_bunch>  This terminates a bunch.
        <invert>       This causes a bunch to acquire the opposite meaning it
                       otherwise  would  have,  thus  [^a]  would  match  any
                       character but a.
        <through>      This is the character used  inside  of  a  bunch  that
                       indicates a range of characters.
        <kleene>       This  is  the  kleene  star  operator   (zero-infinity
                       occurrences of the preceding regular expression).
        <occur>        This means the  preceding  regular  expression  occurs
                       zero or one times.
        <some>         This means the preceding regular expression occurs  at
                       least once.
        <eol>          This matches the end of a line.
        <sol>          This matches the start of a line.
        <all>          This matches any character.
        <intersect>    This forces both the regular expression to  the  right
                       and the one to the left to match.
        <alternative>  This forces either the regular expression on the left,
                       or the one on the right to match.
        <not>          This forces the following regular  expression  not  to
                       match.
        <left_paren>   This is the obvious grouping symbol.
        <right_paren>  As is this.
        <count>        This is used to indicate that  the  preceding  regular
                       expression can occur n-m times.
        <close_count>  This is used to terminate the above.
        <continue>     This is used inside of the above to start  the  second
                       argument.
        <pick>         This is used to start putting text into a register.
        <close_pick>   This is used to stop putting text into the register.
        <register>     This is used to get text out of the register  (it  can
                       only be used in the replace string).
        <everything>   This is used to get the entire match  in  the  replace
                       string.

3 <OPEN>

        The  <OPEN>  command  inserts  a  blank  line in the file.  An
     <OPEN> with no argument inserts one blank line before the current
     line,  an  <OPEN>  will  accept  a  text argument and inserts the
     specified  amount  before  the  current  line  (or at the current
     cursor  position).   An <enter> followed immediately by an <OPEN>
     divides  the  current  line  in  two  at  the  cursor  (inserts a
     newline).

3 <CLOSE>

        The  <CLOSE>  command deletes a line from the file.  A <CLOSE>
     with  no argument deletes the current line, a <CLOSE> will accept
     a  text  argument and deletes the text starting with current line
     (or   cursor   position   for  rectangles)  An  <enter>  followed
     immediately  by  a  <CLOSE> joins the current line with the next,
     and  deletes  any text of the current line after the cursor.  Any
     text deleted will be saved in the restore (!) buffer.

3 <RESTORE>

        The  <RESTORE>  command  is  used  to  retrieve  the text last
     deleted  (text  deleted  with  <backs>  or  <delchar>  may not be
     restored).   This  has  two  purposes:  it  helps  guard  against
     mistakes,  and  it  allows  text  to  be  moved from one place to
     another with ease.  A simple <RESTORE> with no arguments restores
     the text at the current position, text removed with a rectangular
     close  is  restored  in  a rectangle beginning at the cursor, and
     moving  over any text that was already there, text closed in line
     mode  is  restored  by  inserting  those lines before the current
     line,  while text deleted in wrap mode will be inserted beginning
     at  the cursor and moving the remainder of the line to the end of
     the  restored  text.   <RESTORE>  will  take an integer argument,
     specifying  the  number  of  restores  to  do, and it will accept
     linear  cursor  motion  to  the  same effect.  Rectangular cursor
     motion  may  be used if the item in the buffer is a rectangle, in
     this  case  the  buffer is expanded (duplicated) horizontally the
     number   of  times  specified  by  the  horizontal  size  of  the
     rectangle,  and  vertically  by  the  vertical  size, and is then
     inserted.  Note that all text that has been in the restore buffer
     will reappear in the # buffer.

3 <PICK>

        The  <PICK>  command remembers a line from the file.  A <PICK>
     with  a  text  argument  picks up the specified text.  An <enter>
     followed  by  a  <PICK>  picks up whatever is left on the current
     line.

        <PICK>  may  be used to store text into any file or buffer; if
     <PICK>  is given a second argument (or an invalid first argument)
     it  will  be  treated  as  the  name of a file or buffer, (if the
     buffer did not exist it will be created).

3 <APPEND>

        The  <APPEND>  command takes arguments exactly like the <pick>
     command,  except  all  text is appended to be buffer, rather than
     overwriting.   Curious things will happen when a rectangular area
     is appended to other text.

3 <PUT>

        The  <PUT>  command  is used to retrieve the text last picked.
     This  allows  text  to  be  copied  from one place to another.  A
     simple  <PUT>  with  no arguments inserts the text at the current
     position,  text  picked  with a rectangular pick is inserted in a
     rectangle  beginning at the cursor, and moving over any text that
     was  already  there,  text picked in line mode is inserted before
     the current line, while text picked in wrap mode will be inserted
     beginning  at  the cursor and moving the remainder of the line to
     the  end  of  the  restored  text.   <PUT>  will  take an integer
     argument, specifying the number of puts to do, and it will accept
     linear  cursor  motion  to  the  same effect.  Rectangular cursor
     motion  may  be used if the item in the buffer is a rectangle, in
     this  case  the  buffer is expanded (duplicated) horizontally the
     number   of  times  specified  by  the  horizontal  size  of  the
     rectangle,  and  vertically  by  the  vertical  size, and is then
     inserted.

        <PUT>  may also be used to get text out of any file or buffer,
     if  a  second  argument  (or a first argument that is invalid) is
     given  to  <PUT>  then  that argument will be treated as naming a
     buffer  or  file.   If  this  buffer  name is followed by an open
     parenthesis   (`('),   an   expression   (see   the   section  on
     expressions),  and  a  close parenthesis (`)') then the indicated
     line in that buffer will be put.

3 <STORE>

        The  <STORE> command takes text on the enter line, and puts it
     in  a  buffer.   If nothing is given to <STORE> it complains.  If
     only  text is given then <STORE> inserts this text in the current
     window  at  the  cursor.  If text and a buffer are given then the
     buffer will have the text prepended as a new line.  If the buffer
     name   is  followed  by  an  open  parenthesis  expression  close
     parenthesis  then  that  line of the buffer will be replaced (not
     inserted).

3 <EXIT>

        The  <EXIT> command is used to leave the editor, in the normal
     case  all files changed will be saved on exit.  Several arguments
     are  accepted by <EXIT>, the first is `save' which is the default
     case,  and  saves  all  changed files.  The next is `abort' which
     exits  without  saving  any  files,  and the last are `every' and
     `list'  which  list  all  files (all changed files) and allow the
     user  to specify whether to save them or not.  The file name will
     appear on the bottom line followed by a default value (usually y)
     and  a  question  mark,  the user may respond with `y', `n', `e',
     `=',  or a return.  A `y' will save the file, an `n' will not, an
     `e'  will  abort  the  exit process, and edit that file, a return
     will  perform  the  default action, and an `=' allows the user to
     rename,   and   save   the   file.   If  the  editor  detects  an
     unrecoverable  internal  error  it will initiate the exit command
     itself.   If a changed file cannot be saved (see above) then exit
     will  return  to  command mode, and allow the user to recover his
     work.

3 <USE>

        The  <USE>  command  is one way of allowing the user to edit a
     different file.  If a <USE> is pressed with no argument, then the
     alternate  file (or the special file) for the current window will
     be  edited,  and  the file currently being edited becomes the new
     alternate.   If  <enter><USE>  is  pressed, then the next file of
     those  specified on the command line will be edited.  That is, if
     mined were entered with:

        mined foo bar spam *.med <return>

     and  the first file is being edited, the typing <enter><USE> will
     edit  bar,  after  bar  spam will be used, after spam all the med
     files on the current directory.

        If <USE> is given a file name argument, then that file will be
     read  in, and the current file becomes the new alternate (the old
     alternate will not be available after this).  If <USE> is given a
     filename  and  a  line number (separated by <arg>) then that file
     will be edited with the cursor on the indicated line.  If a <USE>
     is  requested  on  a  file that has already been edited, then the
     edited  version  will  be  used (This is not quite true, the file
     foobar  and  foobar;  are  treated  as  different files since the
     editor  will  does  not  deal well with version numbers.  and the
     cursor  will  be placed on the line it was on before.  If a <USE>
     is  requested  on  a  file  that does not exist, the user will be
     warned  that  the  file  is  new  and  the  editor will create an
     internal  version  of this file, if nothing is typed in this file
     it  will  not  be created on exit.  If a user does not have write
     access  to  a  file that is <USE>d the file will not be marked as
     saveable  (so  this  file  will  not  be  saved  on exit, even if
     modified).

        If  a  file  does  not  contain any directory information (nor
     device/nodenames) then when mined searches for the file it may be
     told  to  search  on  several  directories  rather  than just the
     current  one  (in keeping with the idea of dsk: on twenex, or the
     library  search  path  on  tops-10).   To do this the user should
     define  a  logical  name  $MPATH to be a list of device:directory
     specs  separated  by  spaces  (all  devices must be disks, and no
     nodenames  are  allowed).   If mined cannot find a file on any of
     the  directories it will attempt to create it on the first one in
     the search path.

        A file may be read in without tab conversion, by giving a null
     first argument, that is

        <enter><arg>foobar<USE>

     will read in foobar and leave any tabs in it as tabs.

        Filenames  beginning  with  '~', are treated in the fashion of
     berserkly file specs.  That is ~/foo is the instance of foo found
     on  the  user's  home directory, ~gwwcc022/foo is the instance of
     foo found on gwwcc022's login directory.  On systems which do not
     have  a  unix  style password file, the later form will not work.
     As  a  special  kludge ~mined/ refers to the directory that mined
     searches  for  its help file (and .med files).  This works on all
     systems.

        This  command  will  also  change the current local options to
     match those of the new file.

3 <SAVE>

        The  <SAVE>  command  is used to save the current file.  If no
     argument  is given, then the file will be saved under the current
     name.   If  one  argument  is  given, then the file will be saved
     under  that  name.   If  two  arguments  are  given (separated by
     <arg>),  then  the  first  will be interpreted as a text argument
     (which  defaults  to paragraphs if no mode is specified), and the
     second  as  a  file  name.   For example: <SAVE> saves all of the
     current  file  with the current name.  <enter>foo<SAVE> saves all
     of  the current file under the name of foo.  <enter>6l<arg><SAVE>
     saves  the next 6 lines of the file under the current name.  When
     a file is saved, all trailing blanks may be removed (depending on
     the  value  of  the <trailing_blanks> option), all leading blanks
     may  be  converted  to  the appropriate number of tabs and spaces
     (assuming   8   character   tabs,   depending  on  the  value  of
     <entab_blanks>),  and  all  quote  sequences are converted to the
     appropriate   control   characters  (a  trailing  quote  with  no
     character  after  it  is converted to a rubout).  If a save fails
     (the  user does not have write access to the file, directory does
     not  exist,  or  there  is no space on the disk) an error will be
     indicated  on the bottom line.  <enter><SAVE> may be used to save
     all the changed files.

        On VMS if an explicit version number is given, then mined will
     try  to  save  onto that version (by opening the file, truncating
     it,  and  writing), if this fails mined will then try to create a
     version of the file with a version number that is one bigger than
     the  biggest one currently on disk, if this also fails mined will
     give up.

3 <WIND>

        The <WIND> command is another way of editing a different file.
     This  command  allows the user to partition his screen so that he
     is  looking  at  several  files  at  once.   Windows  can only be
     rectangles, and a new window can only be created in such a way as
     to  leave all current windows rectangles.  To create a window the
     cursor  should  be  moved  to  a  position on one of the margins,
     pressing  <enter>filename<WIND>  will  cause  a  line to be drawn
     across  the  screen  from  this  margin  to the opposite one, the
     bottom  (or right) half of the screen will become the new window,
     and  the  text of the specified file will appear within.  As with
     the  <use>  command,  a line number may be specified (as a second
     argument).   Pressing  <enter><WIND>  will remove the last window
     created.   Pressing  just  <WIND> (no argument) will retrieve the
     last  window  destroyed.   To change windows the command <chwind>
     should be used.

        A file may be read in without tab conversion, by giving a null
     first argument, that is

        <enter><arg>foobar<WIND>

     will read in foobar and leave any tabs in it as tabs.

        This  command  will  also  change the current local options to
     match those of the new file.

3 <CHWIND>

        The  <CHWIND> command can be used to change from one window to
     another.   Pressing  <CHWIND>  without an argument will cause the
     current  window  to move to the next window created (or the first
     window  if  the  current  window  is the last one created).  If a
     numeric  argument  is  specified  then the current window will be
     changed  to  the  window specified; changing to window n moves to
     the  nth  window created.  Thus changing to window 1 moves to the
     main window, and if there are m windows on the screen changing to
     window m moves to the last one created.

        This  command  will  also  change the current local options to
     match those of the new file.

3 <SPELL>

        This  command  may be used to correct spelling of a portion of
     the  user's  file.   If  it  is  given  with no argument then the
     current  line  is corrected, if given a text argument it will use
     the specified text (with a default being a paragraph).  Otherwise
     if  the first character of the argument is a `!' then the rest of
     the  argument is treated as a filename and the current dictionary
     is  saved,  if  the  first  character  is  a `*' then the rest is
     treated  as  a  filename,  which  is  read in and merged with the
     current  dictionary,  if  the  first character is an `=' then the
     rest  of  the  argument is treated as a word to be entered in the
     dictionary.   A line in a dictionary file is either a single word
     or  two  words  specified  by a space, in the first case the word
     will be treated as a correctly spelled word, and in the second as
     a  misspelled  word  that  is always converted into the following
     word.   See the section on environment, and on <spell_prompt> for
     more information on dictionaries.

        If  a  misspelled  word is found mined will position a blob on
     the  misspelling,  and  then  display a line at the bottom of the
     screen like:

        Spell optionally --> <No Suggestions> (? for help)

                  or,

        Spell arbitrary --> arbitrary 1/2 (? for help)

     .   In the first case mined thinks the word is misspelled, but it
     doesn't  have  any guesses as to what it might be.  In the second
     case mined thinks the word is misspelled and has 2 suggestions of
     what  it  might be, the first of which is `arbitrary.' Responding
     with  a  `?'  causes  mined  to  give  a brief description of the
     possible  responses,  an  `r'  or  a <return> will cause mined to
     leave the word as it is, an `e' will retain the word and enter it
     in  the  dictionary, an `a' (or <exit> or <interrupt>) will abort
     the  correction  and  return  to normal command mode, an `i' will
     allow  the user to enter a word of his own to replace the current
     one  (mined  will  prompt  whether  to  enter  this  word  in the
     dictionary),  a  response  of `c' will cause mined to replace the
     misspelling  with  the current suggestion a 'u' will also replace
     with  mined's  suggestion but mined will save this correction and
     continue  to  make  it  in  the future without asking the user, a
     response  of  `>' or a space will cause mined to display the next
     suggestion,   a   response  of  `<'  will  display  the  previous
     suggestion,  a <refresh> will refresh the display, and a `d' will
     delete  the current word and proceed, a `b' will move back to the
     previous  word  it  asked  about,  and  '^'  will allow arbitrary
     editing  to  the  file (go into a recursive editing mode in which
     normal  editing  may  be done, but from which a <exit> returns to
     <SPELL>  mode  rather  than  exiting  (if  the  user is editing a
     different file when he <exit>s <SPELL> will be aborted)).

3 <FILL>

        This  command may be used to fill, justify, or center a potion
     of  the  current  file.   The  first  argument is a standard text
     argument,  with  a  default  size  of  one  paragraph, the second
     argument  is either fill, justify or center indicating what is to
     be  done  to  the  text,  if  the second argument is omitted, the
     current  value  of the <mode> option will be used (unless this is
     AS_ENTERED in which case the text will be justified).

        The algorithm used is quite stupid, no attempt is made to back
     up,  if  difficulties  are  encountered,  no  attempt  is made to
     hyphenate  words.   When  filling  mined  will look at one entire
     paragraph, converts all newlines to spaces, and removes spaces so
     that  there  will be only one space between any two words (unless
     the  preceding  word  is  terminated  by one of the characters in
     <double_space>  in  which  case there will be at least 2 spaces).
     When  this  is  done,  lines  will be recreated with the original
     indentation.   Justified  text is first filled, and then multiple
     spaces are inserted where appropriate.

        If the text to fill is defined by a rectangle, then the length
     of  the  rectangle specifies the number of lines to fill, and the
     width   of   the  rectangle  determines  a  temporary  value  for
     <fill_col>.

        Note  that  when  words  are referred to above, it means items
     separated by spaces, not by the characters in <word_end>.

3 <DO>

        The <DO> command executes a program.  Part of the current file
     will  be  passed  as  input to the program, and all of its output
     (unless redirected) will be inserted in the file.  If no argument
     is  specified  the  last  argument  will be used.  A <DO> command
     consists  of  an  optional  text  argument  (which  defaults to 1
     paragraph   if   not  specified)  followed  by  a  program  (with
     arguments)  which  will  be  interpreted  by the shell.  The text
     argument  (if present) should be followed by the <arg> command to
     delimit it from the program specification.  For example:

        <enter>1p<arg>nroff -me<DO>

     would  send  the rest of this page to nroff to be formatted using
     the  me  macros,  and the results would then replace the previous
     text.   The  text  used  as input by the program can be retrieved
     with  the  restore  command.

        To  enter  DCL  commands  and  have  them return output into a
     window (file) issue the following:

        <enter>$ DCL_COMMAND_HERE <DO>

     .   Note  that  you  can  only have output come to you or you can
     redirect   input  into  the  command,  but  you  can't  issue  an
     "interactive"  DCL  command  such  as EDIT or PHONE in this mode.
     Use the case below for for such commands.

        <enter><DO>  is  a special case, and runs an interactive shell
     (as  specified by the SHELL environment variable).  Spawn will be
     done  instead  of  normal  subprocess  creation  (ie  symbols and
     logical  names  will be retained).  To obtain a DCL shell without
     symbols shell should be defined as 'sys$sysroot:[sysexe]loginout'
     or something equivalent.

3 <HELP>

        The  <HELP>  command  causes  helpful  text  to  appear in the
     current  window.   The  helpful  text normally consists of a help
     file for the terminal (looked for on the directory from which the
     med  file  was  taken, if /usr/minedhome/la.med is used as an med
     file then /usr/minedhome/la.hlp is used as a help file), or if no
     such  file  is  found,  then the standard doc file (this) will be
     used.  The alternate file will contain a list of commands and the
     character  sequences  needed  to generate them.  An <enter><HELP>
     may be used to obtain just the command list.

        In the help list, the character sequences for the commands are
     displayed  literally  (so if some of the commands are represented
     by  special  function keys this will not be noted).  When in help
     mode  pressing  <HELP>  again will return to normal mode.  Change
     window  will  return to normal mode as long as the user is not in
     the help window, returning to a help window returns to help mode.

        The  <HELP>  command  list  may  also  be  used  to change the
     command,  option and box sequences, and to create an med file for
     the  current  terminal.   To  change an item the cursor should be
     moved  to  that  item, and the new value should be typed in (Note
     that for bars, if the new value commences with a `.' then an init
     will  be  done;  to allow for a leading `.' any leading backslash
     (but  no  other)  will  be  stripped off (Kludge).  There are two
     methods  for  changing  commands:  the  command  may  be  entered
     literally,  or the command may be entered using quote characters.
     In  the  first  case,  the command should be delimitted by nulls,
     while  in the second the command should be typed in normally, and
     terminated   by   a  <return>  or  <insert_return>  (<backs>  and
     <backword>  can be used for editing).  In both cases an interrupt
     will abort the change.  Options may be redefined by typing in the
     new  value, those which have a list of values may also be changed
     by  moving the cursor to them, and typing `~', `>', or `>'.  Com-
     mands  and  strings may be undefined by moving to them and typing
     `~'.   An med file may be created by pressing <save>.  By default
     the  file  will  be  on  the  current  directory  with  the  name
     (term).med  where  term  is  the  value  if  the TERM environment
     variable.

        Note  that  when  in the help window, the current file's local
     options  will  be edited, and any med file produced will indicate
     that  the  current  local  options should be global.  To edit the
     global options type <enter><arg><HELP>.

        The  help  file  may  also  be  used  to create a user defined
     command  (see  that  section).  By pressing an <open> when in the
     help  window, a new line will appear at the bottom of the current
     text, and the cursor will be moved there.  This line will contain
     various  fields  (command  name, character sequence to invoke it,
     set  of  command  flags, and a help message), any of these may be
     set  or  reset  by moving the cursor to the appropriate field and
     typing.

        A  brief description of each item may be obtained by moving to
     that item and pressing `?'.

3 <STATUS>

        The <STATUS> command gives a list of all the windows currently
     used  and  the files in them (main file, followed by line number,
     alternate  file,  line  number,  and  whether this window is in a
     special state).  This list is followed by a list of all the files
     that  have been read in by the user in this editing session, with
     their  names,  the  version  number,  the length of the file, the
     settings  of  all  the  flags  for  that  file, and the file pro-
     tection.  Some files are normally invisible to the status display
     (things  like macros) <enter><STATUS> will force even these files
     to  appear.  When in status mode pressing <STATUS> again or <use>
     returns  to  normal  mode; moving the cursor to a filename in the
     file  list,  and typing <enter><use> will edit that file.  Moving
     the  cursor  to a filename in that list, and typing <enter><save>
     will save that file.

        The  <STATUS> command may also be used to change the status of
     the  editor.  The names of files, and whether they are read_only,
     changed,  etc.   may be changed.  The user should move the cursor
     to the item he wishes to change and start typing (for a file name
     type  the new name, and follow it with return.  For a flag type a
     ~  to  toggle  the status of the flag).  For a protection type in
     the  new protection, etc.  Changing the status merely affects the
     editor  and  its  actions, it does not in any way affect the file
     itself;  thus  marking  a  file  readonly  does  not  change  the
     protection,  nor  does  changing the name of the file do a rename
     (however  if  the file is subsequently saved the new name will be
     used), changing the file protection only affects the file when it
     is saved.

        The  status  display  also  contains  the  values  of  various
     variables  that  might  be useful for the user to know, and under
     some systems information about memory usage.

3 <SET>

        The  <SET>  command  is used to set various parameters for the
     current  file.   The  format  is  <enter>  arguments  <SET>.   An
     argument  is  either  `=filename'  in  which  case  the window is
     renamed, or is one of the strings `changed', `new', `modifiable',
     `save',  `command',  `backedup',  `rectangle', `text', `file', or
     `visible'  optionally  preceded by a `~' (Arguments are separated
     by the <arg> command).  If the argument is preceded by a `~' then
     that  flag  in the current file is turned off, otherwise the flag
     is turned on.  Thus,

        <enter>~save<SET>

     would  cause the save bit of the current file to be reset.  For a
     complete description of the flags see the flags section.

        An  argument may also be <item>=value or <item>~, in the first
     case  that  item will be set to the proper value, the second case
     only applies to commands, and other string valued items where the
     entry is made undefined.  Thus,

        <enter><SET>=<quote><quote><SET>

     will set the <SET> command to be a rubout.

        Options  may  be  set  in  a  fashion similar to commands (see
     above),  but options may also be made local.  An argument <item>^
     will  make  that  option be local, and give it the current global
     value, if the item is already local nothing happens.  An argument
     <item>v  may  be used to get rid of the local option, and restore
     the global value, if the option is not local this is an error.

        The  last  type  of argument that <SET> takes is a kludge that
     allows  you  to  save  the current mined setup into an .med file.
     The  format  is  !filename,  and  the  setup  is saved under that
     filename  (if  no  file  name  is  specified,  then  the  file is
     terminal_type.med).

3 <SRTAB>

        The  <SRTAB> command is used to set and reset tabstops.  Up to
     500 irregularly spaced tabs may be specified, and after that tabs
     may  be  set  every n columns out to infinity.  The editor starts
     each  file  with tabs every 8 spaces.  To set tabs every n spaces
     the  user should type <enter>n<SRTAB>.  Pressing <SRTAB> will set
     a  tab  at a specific spot, pressing <enter><SRTAB> will remove a
     tab.

        Pressing  <enter> filename <SRTAB> will use that file as a tab
     file  and  read  it to set the tab stops.  When this is done, the
     first  line of the file is read, and tab stops will be set at all
     non  blank characters on that line, all previous user defined tab
     stops are removed but the tab multiple is retained.

3 <INTER>

        The  <INTER>  command  may  be  used  to  abort  <do> or macro
     execution,  searching,  and  file  loading.   At command level an
     <INTER>  will  forget  any  characters  input  that have not been
     examined,  and  a second interrupt following the first (without a
     complete  command  in between the two) will terminate the editor.
     In  RAW  mode  interrupts  may  not be used to abort anything, in
     RESET_RAW mode only programs and macros may be aborted.

3 <SIGNAL_STATUS>

        This  command  generates an interrupt which mined catches, and
     displays some indication of what state it is in.  This command is
     not   fully   implemented,   during  file  input/output,  program
     execution,  and  searching,  it will indicate what line it is on;
     otherwise  it  just  says Alive (at least it shows the machine is
     up).   On  VMS  systems  this  is  only implemented if no <inter>
     command is defined.

3 <ENTER_COM>

        This command is used to insert a command in a file.  Syntax is
     <ENTER_COM>some   command,  thus  <ENTER_COM><enter>  inserts  an
     <enter>  in the file.  The command will be displayed by inserting
     a  special  blob in front of the command name as displayed in the
     help   file.   This  command  is  only  useful  for  <while>  and
     <execute>.   If <ENTER_COM> is given a positive integer argument,
     it will insert the command that many times.

        If  <enter><ENTER_COM>  is  typed  then  mined  will no longer
     interpret  your  commands,  instead  they  will be entered in the
     current  window.   This mode may be exitted by the <end> command.
     <backs>,   <backword>,  and  <return>  commands  behave  as  they
     normally   do   (so   some  limited  editing  is  possible),  and
     <ENTER_COM>  may be used to quote these special commands (that is
     to  insert  a  <return> type <ENTER_COM><return> rather than just
     <return>).

3 <TRANSLATE>

        <TRANSLATE>  this  command  is  used to convert between a file
     containing commands in the above format to commands in the parity
     format.   (this will be done automaticly by the <execute> command
     if  necessary,  but use of this command will speed up macro start
     up).  If no argument is given the translation will be done on the
     current  file,  otherwise  it will be done on the specified file.
     <enter><arg><TRANSLATE> may be used to reverse this process.

3 <EXECUTE>

        This  command  is used to execute the given buffer.  Normally,
     if  an  error  occurs,  or  the user interrupts, then all buffers
     being  executed  will  be  aborted.  <enter><arg><EXECUTE> may be
     used  so  that  if this is a nested <EXECUTE> and an error occurs
     then the enclosing <EXECUTE> will not be aborted.

        Parameters  may be passed to a macro by specifying them before
     the  macro name, separated from each other, and the name by <arg>
     (at the moment only the first parameter may be cursor motion, and
     it will be interpolated as #c,#l (the equivalent rectangular text
     argument).  Thus the sequence,

          <enter>1<arg><arg>spam<arg>foobar<EXECUTE>

     will pass 1, null argument, "spam" to the macro foobar.

        If  the  specified  buffer  has not been read into mined, then
     mined  will  check to see if it is a user defined command, and if
     it is will attempt to execute the library associated with it.  If
     the  buffer  still  does not exist, mined will attempt to read it
     off the disk (and will assume it to be translated).

3 <EVALUATE>

        Take the argument, an expression evaluate it, leave the editor
     with  the result on the enter line.  If the argument is split (ie
     an argument command has been done) then only the last argument on
     the line will be expanded, the others will be left alone.

3 <DO_EVAL>

        Take the argument, an expression evaluate it and ignore it.

3 <WHILE>

        The  <WHILE>  command may be used to implement a while loop, a
     for loop, or a forever loop.  The command may take two arguments,
     the  first  being  a  condition,  and  the  second  a count.  The
     condition indicates whether to continue the loop, it is evaluated
     each  time  through  the  loop, and as long as it is non-zero the
     loop may continue (if this argument is not supplied it is assumed
     to be always 1).  The second argument gives the maximum number of
     times  the  loop  may  be executed, this argument is evaluated at
     start  up  and  that value will be used thereafter, if nothing is
     specified  a  count  of infinity is assumed.  A while loop may be
     obtained  by  specifying  only  the first argument, a for loop by
     setting  the  first  argument  to be 1, and a forever loop by not
     giving  any  argument.   If there are at least two arguments, and
     the first is null (<enter><arg>condition<WHILE>), then the second
     argument  will  be treated as the condition, and the third as the
     count.   Normally  if  an error occurs inside the <WHILE> then it
     will  be  aborted  as  will  any <WHILE>s, <IF>s, and macros that
     contain  it;  however,  if  the first argument is null (as above)
     then errors will only cause the end of the current while loop.

        If  the user types a <WHILE> command at command level, he will
     be  prompted for a sequence of commands to repeat.  This sequence
     may  be  edited by: the <backs> (or <backword>) command to delete
     the  last command entered, and the <enter com> command to enter a
     <enter com>, a <backs>, a <backword>, or an <end> command.  If no
     commands  are given to be repeated, then the last <WHILE> will be
     executed.

3 <IF>

        The  <IF>  command  takes  an argument which it evaluates to a
     number.   It  then prompts the user for a `then part'.  This part
     is  a  list  of commands and is entered as above.  If the numeric
     argument  is  non-zero  the  `then  part' will be executed.  Like
     <while>  and  <execute>,  if  a  null  first  argument  is  given
     (<enter><arg>number<IF>)  then  the surrounding macro will not be
     terminated  if  the  then  part gets an error (the then part will
     always be terminated).

3 <ELSE>

        This  command  must follow an <if>, it will prompt for text as
     <while>,  and  <if> do, and will execute the text if the previous
     <if>  failed.   If an argument is given to an <ELSE> then it will
     be  evaluated,  and if it ends up non-zero (and the previous <if>
     failed)  the text will be executed (another <ELSE> may follow one
     of  this  nature).   As  usual  a null first argument is an error
     trap.

3 <END>

        This  command  is  used  to  terminate  entry  of  commands in
     <while>,  <if>,  and  <else>.   In a <while> the <END> starts the
     execution of the repeated item.

3 <STOP_REPEAT>

        The  <STOP_REPEAT>  command aborts all command streams down to
     the  last repeat stream, and aborts that.  If a positive argument
     is  given,  it will abort that many repeat streams; if a negative
     argument  is  given it will abort that many streams.  A stream is
     one  of  the following: a list of commands in a <while>, <if>, or
     <else>, or the execution of a buffer.

        This  command will never abort the editor (unless something is
     wrong); the only way to exit is with the <exit>.

3 <MACRO_RETURN>

        Will  abort  all  execution streams down to the top macro, and
     abort  that.   If given a value then that will be returned on the
     enter line to whatever invoked the macro.

3 <MSG>

        Can  be  used  by  a macro to display a message.  If given two
     arguments,  then the first should be an integer.  If this integer
     is  positive  then the macro will be aborted.  The absolute value
     of  this  integer is used as a time to display the message before
     continuing.   If there is only one argument, a pause of 1 will be
     assumed.  The second argument (or the first if the were only one)
     is the message, this will be evaluated first

3 <INPUT>

        Can  be  used  in a macro to get a line of text from the user.
     The  first  argument  is  treated as a buffer name into which the
     text  is  put.  If there is another argument it will be evaluated
     and  used  as  a  prompt  string.   Input  may be terminated by a
     <return>  which  is  successful,  and an <enter> which leaves the
     buffer unchanged, any other command will abort.

3 <BRK>

        This command enters the mined macro debugger, normally it will
     show  the macro currently being executed, if given an argument it
     will show that macro.  See the debugger section.

3 User_definable_commands

        Mined  is  not limited to just the commands listed above, most
     of  the fun of mined comes in writing your own commands that will
     do  weird things when needed.  In addition to the execute command
     which is one way of extending the command set, mined allows users
     to  attach a macro buffer to a terminal key sequence so that when
     a  user  types  those  keys,  the  buffer will be executed, or to
     attach  several  key sequences to one command (for instance it is
     often  useful  to  have the arrow keys mean the obvious, and also
     have the standard ADM3A ^J, ^K, ^L do the same thing).

4 User_command_components

        These  commands  come  in two flavors: synonyms and macros.  A
     synonym  is  just  another  way  of executing one of the standard
     mined  commands, it should behave just like the standard command,
     and  when stored in a macro it will be indistinguishable from the
     standard  command.  The other flavour is more interesting, it has
     a  whole  bunch of options for the user to set in addition to the
     character  sequence  that  will  invoke  it.   The first and most
     obvious is the command name.  This is the name of the buffer that
     mined  will  execute  when the command is invoked, it is also the
     name  that  is  stored in untranslated macros.  In a synonym, the
     command  name  field  is  used to indicate of which mined command
     this command is a synonym.

        The  next  item  is  the  library name (this is optional); the
     library  tells  mined  how to load the macro if it is not already
     present,  if  no library is given and the specified buffer is not
     loaded in mined, then mined will attempt to read in the buffer as
     it  would  for  an  <execute> command where the buffer was not in
     core.   The  reason  for  the  library  item is that reading each
     command  off  of  a  disk as a separate file is likely to be time
     consuming  (especially  on  VMS),  and  further  often a group of
     commands  are  related, so that if one is used, another is likely
     to  be  invoked  shortly.  If mined detects that a command is not
     present,  then  it will <execute> the library with an argument of
     the  command name it wants.  A library will only be executed once
     per  command  (it may be executed several times to load different
     commands,  but  only if the library does not load them when it is
     first  executed),  if it does not load the buffer then mined will
     attempt  to  read  it  off of disk, if that fails mined gives up.
     This  field  has  no  meaning  for synonyms but may be set by the
     user.

        The  next  items  are  a  bunch of flags that indicate how the
     command  should  be  used.   These flags tell mined what kinds of
     arguments are legal for that command, and whether the command can
     start  or continue a cursor motion argument.  The following flags
     are available:

        strt_cur        Indicates that this command may start cursor motion.
                        This  means  that  if  this  command  is typed
                        immediately  after  an <enter> then the editor
                        will  be  put  in  cursor motion mode, and the
                        command will be executed.

        in_cur          Indicates that if the editor is in cursor motion mode,
                        then  this command will continue cursor motion.
                        This  does  not  imply,  and  is not implied by
                        strt_cur.

        use_quote       Indicates that the character arguments to this com-
                        mand   may   contain   the   <quote>  command.
                        Otherwise  mined  will flag any such arguments
                        as errors.

        use_arg         Indicates that this command may take either one or two
                        arguments.

        use_args        Indicates  that  this  command may take an arbitrary
                        number  of  arguments.   If  this flag is set,
                        then  the  above flag will be set automaticly,
                        and  if  use_arg  is  reset,  this one will be
                        also.

        use_curmotion   Indicates  that  this  command can use a cursor
                        motion   argument.    This  flag  may  not  be
                        specified with in_cur.

        use_curargs     Indicates  that  this  command  can  use a cursor
                        motion  argument,  followed  by  an  arbitrary
                        number  of  arguments.  This flag is dependent
                        on  use_curmotion,  use_arg,  and use_args; it
                        may not be set with in_cur.

        unwind_env      Indicates after this command has been executed, the
                        environment stack will be unwound to the depth
                        it had before execution.

        In  a  synonym  these  flags  initialized to the flags for the
     mined command, and may not be changed.

        The last item is a help message, this will be typed out if the
     cursor  is  moved  to the item, and a `?' is typed.It may also be
     examined by $apropos.  If a synonym has no help, then the message
     of the synonymous command will be used.

        On  VMS  any  access  control  strings  in the command name or
     library will be typed out in full.

4 Creating_user_defined_commands

        These  commands can be set and changed in the help window.  To
     create  such a command go into the help window, and press <open>;
     this  will  add  a  line  at the end of the window containing the
     beginnings  of  a  user  definable command.  Each field of a user
     command  may  be  changed by moving the cursor to that field, and
     typing.   If  the  name  field  is  set  to be the name of one of
     mined's  built  in  commands  (case is significant here) then the
     command will be a synonym (the name LITERAL is reserved).

4 Using_user_defined_commands

        User  defined commands may be used just like any other command
     by  typing  in the character sequence, arguments may be passed to
     the command via the enter line as usual.

4 Writing_user_defined_commands

        When executing a user defined command is exactly the same as a
     normal  macro,  and  it  should  get at its arguments in the same
     fashion.  The argument returning the macro name ($.0) returns the
     command name of the command.

2 Debugger

        NOT YET IMPLEMENTED


2 Command_options

        Mined  maintains  a  list  of  options  that  define  what its
     commands  do;  each  file  may  have  a  smaller  list which will
     supercede  the  global  options when editing that file.  The list
     maintained  by  a file is referred to as a local option list, and
     the options in it are local options.  When editing both a program
     source  and  the  documentation  that  goes  with it, it might be
     useful  to  have  the program text entered normally, but have the
     documentation  text entered in auto_fill mode; this could be done
     by setting <mode> to be a local option.

        When  a  <use>,  <wind>  or  <chwind>  command is typed in the
     current local options will be removed, and the new ones will take
     effect.   If  a <help> is typed, then the user will be allowed to
     modify  the local options (and if a modified option is not local,
     the  corresponding global one will be changed).  An option may be
     set  as  local  (to this particular file) with the <set> command,
     which will make a local option with the same value as the global.

        Options may be set with the <help> and <set> commands, and may
     be  made  local with the <set> command.  When in the help display
     moving  to  an  option  and typing in a new value will alter that
     value  (many  options  will also allow the user to toggle through
     all the possible settings using `<' and `>'), a brief description
     of  the  option  may be obtained by moving to it, and typing `?'.
     The <set> command may be used to alter an option by typing,

        <enter><option name>=value<set>

     or an option may be made local by typing,

        <enter><option name>^<set>

     .   By  default  both  the <help> and <set> commands refer to the
     current  local  options, it is possible to get the <help> command
     to modify the global options too.

3 <TERMINAL>

        If  <TERMINAL>  is set to RAW then the terminal will be set in
     raw  mode  (passall  under  VMS),  this gives more characters for
     commands, but means that interrupts do not occur.  If this is set
     to  RARE  then  RAW  will  be in effect except when the editor is
     doing  something  that might not terminate (running a program, or
     executing  a  macro).   The  other  choice is COOKED.  This is on
     COOKED by default.

3 <^S/^Q>

        If <^S/^Q> is on then ^S and ^Q will be handled by the monitor
     (to   stop   and  start  output).   Some  terminals  send  ^S  by
     themselves,  so this switch should be on, but there aren't enough
     control  characters for all the commands, so we make it optional.
     If  the  terminal  is  in  RAW (or RARE) mode (see the <terminal>
     option) this option will have no effect.  This is OFF by default.

3 <^T>

        If  <^T>  is  on  then  DCL  is  allowed  to  do its normal ^T
     processing.  This is ON by default.

3 <^Y>

        If  <^Y>  is  on  then  DCL  is  allowed  to  do its normal ^Y
     processing.  This is ON by default.

3 <MULTIPLE_WINDOW>

        If  this is on DELAYED_UPDATE then mined will allow the system
     to  echo most characters, (this will speed up overall performance
     of  the system and hopefully the user process, although the first
     command  after  an  extend  line  of  text  will  be  slow).   In
     IMMEDIATE_UPDATE  mined  echoes  every  character itself.  In the
     first  case multiple windows looking at the same file will not be
     updated  until  a command is typed.  This is on DELAYED_UPDATE by
     default.

3 <MBX_CONVENTIONS>

        May  be  either  DEC or ISC.  If set to ISC, record boundaries
     are  ignored,  and  lines  are terminated by ^J.  If DEC, a record
     boundary  or  a  ^J  is used to terminate a line.  This option is
     useful  when  <do>ing a program, since ISC and DEC style programs
     are  incompatible.   This is set to DEC by default.

3 <RETURN_TYPE>

        Determines  where  to  put  the  cursor  (horizontally) on the
     screen,  may  be  set to MARGIN in which case the cursor moves to
     the  right margin, or UNSHIFT where the cursor is moved to column
     one,  or  INDENT  in which case the cursor will attempt to find a
     reasonable  level  of indentation and put the cursor there.  This
     is set to UNSHIFT by default.

3 <BACKS_TYPE>

        This   option   takes   four   values,  STICK,  PREV_LINE_END,
     CUR_LINE_END, DELETE_CRLF.  This is used to describe the behavior
     of  <backs>  in  column  one.   STICK causes the cursor to stick,
     PREV_LINE_END causes the cursor to cursor to go to the end of the
     preceding  line  (where  exactly is determined by <END_OF_LINE>),
     CUR_LINE_END  goes  to  the  end  of the current line DELETE_CRLF
     joins the two lines.  This is set to PREV_LINE_END by default.

3 <END_OF_LINE>

        When  this  option is set, commands which move to the end of a
     line  (<backs>,  <right>) will position the cursor one beyond the
     end  of  the line (BEYOND), otherwise (LAST) the cursor is set on
     the  last  character  (if <backs_type> is set to DELETE_CRLF then
     <backs>  will  ignore  this  option).   This  is set to BEYOND by
     default.

3 <CASE>

        When  this  option is set (EXACT), searches (and replaces) are
     case  significant,  otherwise  (EITHER)  either case matches, for
     more  information see the search commands.  This is set to EITHER
     by default.

3 <SCREEN_ARGS>

        When  this  switch  is  on,  the  commands  <+page>,  <-page>,
     <+lines>,  <-lines>,  <rshift>, <lshift> remember their arguments
     (SAVE)  (otherwise  (DEFAULT)  the  default  is  used).   Thus if
     <enter>  2  <+page>  was  typed  then  any  subsequent <+page> or
     <-page>  will  default  to  moving  2  pages.   This  default  is
     superseded  whenever  an explicit amount is given.  <SCREEN_ARGS>
     is set to DEFAULT by default.

3 <INPUT_TABS>

        Convert  tabs  read  in  from  a  file to the proper number of
     spaces  (CONVERT),  otherwise  (LEAVE) tabs are left as ^I.  This
     option  may  be  temporarily  be  toggled by the <use> and <wind>
     commands.  This is set to CONVERT by default.

3 <TRAILING_BLANKS>

        If  strip  is  set  then trailing blanks will be stripped from
     each  line  when the file is saved (STRIP), otherwise (SAVE) they
     will  be written out.  This also determines the internal behavior
     of the editor in whether trailing blanks are significant.  This
     is set to STRIP by default.

3 <ENTAB_BLANKS>

        If  entab  is  set  to  LEADING  then  leading  blanks will be
     converted  to tabs when the file is saved.  If this is set to ALL
     then  all  blanks  that can profitably be changed to tabs will be
     changed.  If this is set to UNQUOTED then all spaces that are not
     within quotes can be optimized to tabs.  Quoting is determined by
     looking  at  <text_quote>  to  determine  legal quote characters,
     <strings>  to  determine if quotes can extend over several lines,
     and  <quote_quote>  to  determine  characters  that  cause  quote
     characters  to  be  ignored.   In  UNQUOTED  and ALL modes, mined
     understands  that  returns,  backspaces  and  tabs can affect the
     position  on  a  line,  whereas  it thinks that all other control
     characters do not.  This is on UNQUOTED by default.

3 <BACKUP>

        If  this  option  is  set then mined will produce a backup the
     first time it writes out a file.  On unix systems the backup file
     is  named  `#'  followed by the file name, and on vms systems the
     extension  of  the  file name replaced by `bak'.  By default this
     option  is on under unix and off under vms (There are usually too
     many backups already under VMS).

3 <KEYSTROKE_BUFFER>

        Sets the number of characters after which the keystroke file's
     buffer  will be flushed.  This is most meaningful on VMS systems,
     and  must  be  a power of 2 between 1 and 512 (a value of NONE is
     used  to  indicate  no keystroke file, on any system).  The value
     used  during this editing session is the value that held when the
     keystroke  file  was  opened.   The  smaller  this number is, the
     slower  mined  will  run.   The bigger it is, the less useful the
     keystroke  file  will  be  since  more commands will be lost on a
     crash.  This is on 32 by default.

3 <KEYSTROKE_DIRECTORY>

        Specifies  the directory on which mined will put the keystroke
     file  (if  this is undefined, the keystroke file is placed on the
     user's home directory).  This value is only examined at start up.

3 <TEMPFILE_DIRECTORY>

        Specifies  the directory on which mined will put the temp file
     (if this is undefined, the temp file is placed on the user's home
     directory).   This  value  is only examined at start up.

3 <TERMINAL_NUMBER>

        If  this is on USE then mined will include the terminal number
     in  the  keystroke/temp file names, if it is on IGNORE then mined
     will  not.   By  including  the  terminal number concurrent mined
     sessions  on  different  terminals  will  be  recovered properly,
     otherwise  only  one  session  can  be recovered; leaving out the
     terminal  number has the advantage of creating fewer files.  This
     is on USE by default.

3 <CURMOTION>

        If  this  is  set  WRAP then cursor motion text arguments will
     take  all  text starting at the enter blob, and continuing to the
     current  cursor  position, insead of taking the rectangle defined
     by  this  motion.   <CURMOTION> also affects the behavior of text
     arguments  with  the form (number)c,(number)l in the obvious way.
     This is on RECTANGLE by default.

        If  this  is  set then text arguments that specify a number of
     words  are  allowed to spill over the end of the line to fill out
     the  requisite  number  of  words,  otherwise the end of the line
     would terminate them.  This is on WRAP by default.

3 <WORD_END>

        Specifies the characters that are used to determine the end of
     a word.  The end of a line will always end words.  This is set to
     space, tab, period, comma, semicolon, exclamation point, question
     mark,  single  quote,  double  quote, open and close parentheses,
     brackets and curly braces.

3 <SPELL_MODE>

        If  this  is  set  to  CORRECT, then whenever a space is typed
     after  a  word,  the word is checked for spelling, if an error is
     found it is handled in the save fashion the <spell> command would
     use.  This is on LEAVE by default.

3 <SPELL_PROMPT>

        This may be either IGNORE, PROMPT, or SAVE, if it is IGNORE or
     if  the  user  dictionary has not been modified since it was last
     saved nothing happens.  If it is SAVE and the dictionary has been
     modified, then mined will attempt to save the dictionary when the
     user  presses  <exit>,  mined  first tries to save it as the file
     named  in  $SPL_DICTIONARY:,  if that fails mined will prompt the
     user  for a filename.  If the option is set to PROMPT, then mined
     will  ask  the user (upon <exit>) whether to save the dictionary.
     This is on PROMPT by default.

3 <PARAGRAPH>

        This  option  is  used  to  define  what  mined  will use as a
     paragraph  (in  a  text  argument,  or  when filling).  If set to
     BLANK_LINES  then the only thing that will break a paragraph is a
     blank line (or the end of the file), if set to INDENTATION then a
     paragraph  may  also  be  terminated  by  a  line  with different
     indentation  (this is not much use when writing a program).  When
     INDENTATION  is  set, the first two lines of a paragraph may have
     arbitrary indentation, subsequent lines must be on the same level
     as  the second line, otherwise a new paragraph is begun.  This is
     set to INDENTATION by default.

3 <BREAK_PARAGRAPH>

        Many text formatters use lines beginning with a period to mean
     a  command to the formatter, in such a case it would be extremely
     annoying  to  have  mined  consider such a line to be part of the
     preceding  paragraph.   This  option  allows the user to say that
     lines beginning with any of a set of characters are to be treated
     as  paragraph breaks.  This is set to a period and an open single
     quote by default.

3 <FILL_COL>

        This  option is used in conjunction with the filling routines,
     and  indicates  the  column to which text will be filled (that is
     mined  will try not to create lines longer than than this).  This
     has the value 70 by default.

3 <DOUBLE_SPACE>

        These  are  the  characters  that are allowed to have a double
     space after them when filling (usually sentence terminators).  If
     the  user  does  not  put  a  double  space  after  one  of these
     characters  mined  will  not insert one (unless the character was
     the last thing on a line, and mined has moved it to the middle of
     a  line),  if  the  user  does  put  a  double space after such a
     character  mined  will  leave  it alone.  This contains a period,
     exclamation point, and a question mark by default.

3 <MODE>

        This indicate whether mined is to do filling and justification
     as the user types in characters, or whether the characters are to
     be  left as the user puts them in.  If this is on AS_ENTERED then
     no  text  processing  will  be  done.  If it is on AUTO_FILL then
     lines  will be filled automaticly as characters are typed.  If it
     is  on  AUTO_ADJUST lines are automaticly justified as characters
     are typed.  When in AUTO_FILL or AUTO_ADJUST modes the only lines
     affected  are the current line (sometimes the previous line), and
     any subsequent lines that have words added to or stolen from them
     to  fill  up this one, thus mined will not attempt to justify the
     entire  file  each  time  you add a character (unless that really
     turns  out  to  be  necessary).  This option applies to character
     insertion,  and  the  <quote>, <delchar>, <backs>, and <backword>
     commands  only.   For more information see the fill command.  The
     default value for this option is AS_ENTERED.

3 <FILL_START>

        There  are two ways to handle auto fill and auto justification
     modes,  and  one  is much slower than the other.  If this flag is
     set  to  BEYOND_COL  then filling will not be done until the user
     types  a  character  beyond  the  fill column, if this flag is on
     ALWAYS  then  filling  will  be  done  on each character the user
     types.  This option is on BEYOND_COL by default.

3 <FILL_SPACES>

        Determines  whether  to  LEAVE  multiple  spaces  in text when
     filling,  or  whether to REMOVE them (double spaces will still be
     left after periods, etc.).  This option is on REMOVE by default.

3 <READ_HELP>

        If  this option is set then the help file will be read in on a
     help  command if it is not set then only the command list will be
     displayed  (the  help file may be examined by pressing <use> from
     the command list).  This is set by default.

3 <VERIFY_MEDFILE>

        If this is set, then users will be warned about incorrect sets
     of commands, otherwise they will not be.  This is set by default.

3 <CONFIRM_NEW>

        If this option is set (VERIFY), then whenever the user creates
     a  new  file, the editor will prompt to see if he really wants to
     created  (to  guard  against mistyping) if the user responds with
     <use>  then  the  file  will be created, otherwise (WARN) nothing
     happens.  This is set to WARN by default.

3 <FUN>

        This  option  causes  various amusing things to happen.  It is
     necessary for rabbit mode (rabbit mode is undocumented).

3 <TRAPPED_ERRORS>

        If  this  option  is  on  (SHOW),  then all error messages are
     displayed,  otherwise  (NOSHOW) errors that are trapped inside of
     macros will not be displayed.  This is set to NOSHOW by default.

3 <TAB_SIZE>

        This  option  sets  the default tab multiple (for internal tab
     stops).  This is set to 8 by default.

3 <TAB_FILE>

        This  is  used  to specify a file which initializes tab stops,
     the  first line of the file is read, and any non blank characters
     are  used to set tab stops at the corresponding locations in each
     window.  See <srtab> for a more complete description.  By default
     this is not set.

3 <STATUS_LINE>

        This  flag  allows  the  user  to  determine how much (if any)
     information  he  wants displayed on the bottom line.  If the user
     wants  no  information,  then this line will be used for editing.
     The  line can contain: a name, usually `Mined', the current time,
     some  indication  of  the  system  load (on VMS this is a process
     count  at  the  moment),  random  text  that  the  user  can set,
     notification  of  whether  the  editor is in help or status mode,
     notification  of  whether automatic filling or justification will
     be  done,  whether  this file will be save (if modified) on exit,
     whether this buffer contains translated commands, whether this is
     a  new  file,  whether  the editor is in insert mode, whether the
     editor  is  not in insert mode, the name of the file, the current
     line number, the current size, some indication of how much of the
     file  is  before the current line, the ability to make the bottom
     line  bold  when  in insert mode, and the ability to make it bold
     when  not  in  insert  mode.  This option is set and display in a
     special  way.   When display in the help window it shows the list
     of  things  that  are currently set, an item may be set by typing
     it,  an  item may be reset by typing it followed by a tilde or by
     moving  to  that item and typing a tilde.  Since it would be easy
     to  forget the names of the items, pressing `<' or `>' will allow
     the  user  to  process  through  the  various names.  The various
     options are:

        System:     The contents of the <system> option will be displayed.

        Time:       The  current time of day will be displayed.

        Load:       Some indication  of  the  current  system  load  will
                    be displayed.

        UserMode:   The  contents  of  the  <user_mode>  option will be
                    displayed.

        Special:    Indication will be given when the user is in a help or
                    status window.

        Fill:       Indication  will  be  given  if  the  editor  is  doing
                    automatic filling or justification.

        Save:       Indication  will be given if the current buffer will be
                    saved on exit (if it has been modified at that point).

        Command:    Indication  will  be  given  if  the  current buffer
                    contains translated mined commands.

        New:        Indication will be given if this is a new file.

        Insert:     Indication will be given if the editor is in insert mode.

        OverWrite:  Indication  will  be given if the editor is not in
                    insert mode.

        Name:       The name of the current buffer will be displayed.

        Line:       The  current  line  number  is  displayed  (unless  the
                    <line_number>  flag is set to ignore small changes in the
                    line number.

        Size:       The current size (in lines) of the buffer is displayed.

        Percent:    The  percentage of the file (in lines) that is above
                    the current line is displayed.

        Modified:   A `*' is displayed if this buffer has been modified
                    since it was read in, or last saved.

        BoldInsrt:  If set the bottom line will be in bold mode (stand
                    out mode) whenever the editor is in insert mode.

        BoldOverWrite:  If  set  the  bottom line will be in bold mode
                    (stand  out  mode)  whenever  the editor is not in insert
                    mode.

        Version:    On  vms, this causes the file's version number to be
                    displayed  after  the  file  name  (if  it is not already
                    displayed in the file name).

        Invisible:  This  value  is special, it means that none of the
                    others  are set, and that the status line will be used as
                    an extra line for editing.

        This  is  set  to System, Special, Time, UserMode, Fill, Save,
     Command,  New, Insert, Name, Line, Size, Modified, and Version by
     default.

3 <SYSTEM>

        A string to be displayed as the first item on the status line,
     designed  to  give  the  user  some  clue  as  to  what  will  be
     interpreting  his  commands, should be set to `MINED' except when
     inside  of  a macro that does its own command interpretation (see
     <status_line>).

3 <USER_MODE>

        More  text  to  be  displayed on the status line, this appears
     inside of the mode list (delimitted by `[]').  By default this is
     not set.

3 <DISPLAY_FILES>

        Either  DEC_FORMAT  or  UNIX_FORMAT, determines how file names
     will  be displayed.  This flag does not exist under real unix.
     It is DEC_FORMAT by default.

3 <ERROR_STAY>

        A  number  indicating the number of updates of the bottom line
     it  takes  for  an error message being displayed there to vanish.
     This is set to 17 by default.

3 <BORDER>

        This  option  is used to determine which of the borders of the
     windows are displayed on the screen.  Thus it is possible to have
     only  a  bottom  border,  etc.   The  option  may  be  set to any
     combination of the values `tbrl' for top, bottom, right, left; or
     to  the  special  values none, and full.  A value none means that
     none of the borders are drawn, a value full means they all are, a
     value  of  `ltr'  would draw the left, top, and right borders but
     not the bottom one.  This is set to `T' by default.

3 <EDGE>

        This  option  determines whether the border appears around the
     outside  of  the screen (GILT), or if it is just used to separate
     windows (ABSENT).  This is set to GILT by default.

3 <LINE_NUMBER>

        When  this  option is on any vertical cursor motion causes the
     line  number  at the bottom of the screen to be updated (UPDATE),
     otherwise  (NOTCHANGED)  the line number is updated after about a
     page  of  movement, or after large screen shifts.  This is set to
     UPDATE by default.

3 <HELP_MSG>

        If  this  option  is  set (DISPLAY) then the help message (see
     below)  will  be  displayed  on  the  status  line  at  start up,
     otherwise (INVISIBLE) nothing will be.  This is set to DISPLAY by
     default.

3 <HELP_MESSAGE>

        If  the help message is to be displayed (see above), then this
     option  determines  what is typed out.  Normally the text in this
     option  will  be  displayed, but if this option is undefined then
     mined  will  generate  the message "For help press" and then list
     the  characters that make up the help command.  This is undefined
     by default.

3 <MATCH_TIME>

        Indicates  whether  and  how long the editor should indicate a
     matching  parenthesis.   If  this  is  not  set to NEVER (0) then
     whenever  a  close  parenthesis  if  seen  (as  determined by the
     <paren_end>  option)  the  cursor  may  move to the matching open
     parentheses.   This  flag  determines  what the maximum length of
     time that the cursor will stay there will be (if the user types a
     command,  the  cursor  goes back to where it should be).  This is
     set to 1 second by default.

3 <MATCHING_PAREN>

        This  indicates  how  far  the cursor will move to display the
     matching  open  parenthesis.   If  set  to  SCREEN  then  only  a
     parenthesis  that is actually on the screen will be displayed, if
     set to LINE then an parenthesis on the screen, or any parenthesis
     on the current line (if this would mean shifting the screen, then
     the appropriate part of the line will be displayed briefly on the
     status  line), if set to ALL then any parenthesis anywhere in the
     file  may  be displayed, and the full screen will shift or scroll
     as necessary.  This is set to SCREEN by default.

3 <MISMATCH_PAREN>

        If  no  open parenthesis is found that matches the given close
     parenthesis,  or  if  one  is found but it is not the right type,
     then the editor will beep (if set to BEEP), or do nothing (if set
     to  IGNORE).   In  some cases IGNORE allows certain optimizations
     and  can  be  much faster for mismatch parentheses in huge files.
     This is set to IGNORE by default.

3 <PAREN_START>

        This  is a string containing all the items that are considered
     to start a parenthesis.  This is set to `([{' by default.

3 <PAREN_END>

        This  is  a  string containing the characters that terminate a
     parenthetical  element.  The <mismatch_paren> option determines a
     mismatch  if the close parenthesis is at a different place in the
     end  string  that  the  open parenthesis was in the start string.
     This is set to `)]}' by default.

3 <QUOTE_QUOTE>

        This   is  a  string  containing  characters  that  may  quote
     parentheses  and  text  quotes,  at the moment it causes mined to
     ignore any special meaning for the following character, and treat
     the  lump as something that can be part of a word.  The only know
     use  for this is to handle backslash in C strings properly.  This
     is set to `\' by default.

3 <COMMENT_START>

        This  is  a  string  that is used to start a comment, there is
     only  one  of  these  so languages that have more than one way to
     start  a  comment  are  out of luck.  Any parentheses inside of a
     comment  will  be  ignored  (unless  matching  starts  inside the
     comment).  This is set to `/*' by default.

3 <COMMENT_END>

        This  is  a  string  like the above, if this is undefined then
     comments  are  assumed  to  be terminated by the end of the line.
     The  current  algorithm  for  doing  backwards  motion  involving
     comments assumes that the string in <COMMENT_END> will only occur
     at  the end of a comment, this is fine for C but it does not work
     in  ALGOL  (end  of  line  is  a  special  case  and is handled
     properly).  Mined assumes that comments do not nest.  This is set
     to `*/' by default.

3 <TEXT_QUOTE>

        This  defines  a  set  of characters the start and stop a text
     string,  the  same  character used to start a text string must be
     used  to  stop  it,  most  characters  are  ignored  (thus quoted
     parentheses  will  not  disturb the paren matching abilities).  A
     quote  character  preceded  by  a  character  in <quote_quote> is
     ignored, if <strings> is set to ONE_LINE then strings will not be
     continued  beyond  the  end  of a line.  This value will be exam-
     ined  if  doing an UNQUOTED <save>.  This is set to double quotes
     by default.

3 <STRINGS>

        If  this  is  on ONE_LINE then text strings (see <text_quote>)
     will  not  be  allowed to continue beyond the end of a line, else
     (WRAP) they may.  This is on ONE_LINE be default.

3 <UPDATE_FREQUENCY>

        This  flag  causes  the bottom line of the screen to be update
     every  so  often (which might be useful when displaying the time,
     etc.).   The value of the flag is the frequency of the update (in
     seconds),  if  it  is undesirable that the line should be update,
     the  flag  may  be  set to NEVER.  This is set to 3 minutes (=180
     seconds) by default.

3 <FLUSH_TYPEAHEAD>

        Some people like to have the typeahead buffer flushed after an
     error,  some  do  not.   Setting  this  flag  to ON_ERRORS causes
     typeahead  to  be flushed, setting in to NEVER does not.  This is
     on ON_ERRORS by default.

3 <ENTER_DEBUG>

        This  flag  allows  the  user  to enter mined's macro debugger
     whenever   an  error  occurred  in  a  macro.   The  options  are
     NO_ERRORS,  UNTRAPPED,  and  ALL_ERRORS.   When  set to NO_ERRORS
     mined  will  not  enter  the debugger (unless explicitly asked to
     with  a  <brk>  command),  when on UNTRAPPED mined will enter the
     debugger  whenever  an  untrapped  (one  that would terminate the
     macro)  error  occurs in a macro, when on ALL_ERRORS mined enters
     the  debugger  whenever  an  error occurs in a macro.  This is on
     NO_ERROR by default.

3 <INI_MACRO>

        This  specifies  a  translated macro that is to be executed at
     start up.

3 <BEEP_POS>

        This  is  used for people who like to pretend that they are on
     typewriters, and want to hear beeps when they get near the end of
     the  line.   If <BEEP_POS> is positive then it specifies an exact
     column  on  which  the beep is to occur.  If it is negative or 0,
     then the beep will occur that many columns before the left border
     of  the  window.   If  this is NEVER then beeps will never occur.
     Beeps will only occur when entering characters.

3 <EXTENSIONS>

        This has no meaning as yet.  It is reset by default.

3 <HOR_SHIFT>

        This  option  sets the default amount the terminal will shift,
     this  amount  may  be  specified as a number of spaces, number of
     tabs,  or  fraction of the screen used by the current window.  An
     argument  of  3s sets the default shifting amount to be 3 spaces,
     3t  sets it to be 3 tabstops, 3/4 sets it to be three quarters of
     the horizontal screen size.

3 <HOR_POSITION>

        This  option  sets the horizontal position of the cursor after
     it  gets  moved off the screen by vertical motion.  Arguments are
     as  above  with the addition of Unchanged which leaves the cursor
     in the current column.

3 <HOR_CURMOTION>

        This   option  says  what  the  <left>,  <right>,  <tab>,  and
     <backtab> do when they get to the edge of the screen.  If this is
     WRAP  then  the command will wrap to the other end of the screen,
     it  it  is  anything  else  the  screen  will  be  shifted by the
     indicated amount, and the command will be executed normally.

3 <CHAR_SHIFT>

        This  option  determines  how  far  to shift the screen when a
     character is pressed beyond the right margin.

3 <VERT_SCROLL>

        This  option sets the default amount the terminal will scroll,
     this amount may be specified as a number of lines, or fraction of
     the  screen  used  by the current window.  An argument 3l set the
     default  scrolling  amount to be 3 lines, 3/4 sets it to be three
     quarters of the vertical screen size.

3 <VERT_POSITION>

        This  option sets the vertical position of the cursor after it
     gets  moved  off the screen by vertical motion.  Arguments are as
     above  with  the addition of Unchanged which leaves the cursor in
     the current line of the screen.

3 <VERT_CURMOTION>

        This  option  is similar to <hor_curmotion> above, except that
     it deals with the <up>, and <down> commands.

3 <RET_SCROLL>

        This  option is similar to <vert_curmotion> above, except that
     it deals with the <return> command.

3 <GOTO_POSITION>

        This  option  is similar to <vert_position> above, except that
     it deals with the <goto> command.

3 <SEARCH_POSITION>

        This  option  is similar to <vert_position> above, except that
     it deals with the search commands, and <spell>.

2 Special_buffers

        Currently there is one kind of special buffer in mined, the #,
     $  and  !   buffers.   The  !   buffer is the close buffer, the $
     buffer is the pick buffer, and the # buffer contains all the text
     that  has  been  deleted  from  the  close  buffer,  that is when
     something  is  deleted  it  goes  into  the  close  buffer,  when
     something  else is deleted the first thing is postpended to the #
     buffer.These  buffers  may  be accessed by most of the operations
     that manipulate files, thus <enter>#<use> will bring the # buffer
     into the current window.

2 Start_up_macros

        It  is  sometimes useful to have a particular set off commands
     done  at  start  up,  (macro/user defined command initialization,
     etc.).   In  the standard mined fashion of overdoing things there
     are  several  ways  such  a  file can be specified.  As a trivial
     distinction,  mined  is  prepared  to read the file name from the
     environment  or  from the command line.  Somewhat more important,
     mined  will  accept  a  translated or an untranslated buffer.  An
     untranslated  buffer  contains legible text, and is slightly more
     comprehensible, a translated buffer is faster, and is in the same
     format  as  a  keystroke  file  (so this option could be used for
     recovery except that an error would abort it ).

        The   macro   files  (note  that  both  a  translated  and  an
     untranslated  file  may  be specified) will be read in before any
     other files are read in, and will be executed after the user file
     has  been set up (but before any command line searches are done).
     Thus if the macro wishes not to affect the screen, it should save
     the  cursor position, and start up a new window, diddle around in
     that and then delete it and restore the cursor.

        The  following is an example of a buffer that defines a buffer
     eol  to  go  to  the  end of the current line (presumably this is
     attached  to  a user defined command) and another buffer sol that
     moves to the first non-space character on the line.

        @<enter>$wndenv(eol)@<do_eval>
        @<enter_com>@<enter>$@<enter_com>@<right>
        @<translate>
        @<enter>sol@<pick>@<enter>sol@<use>
        @<close>
        @<enter_com>@<enter>^@<enter_com>@<left>
        @<translate>
        @<enter>$oldenv@<wind>

        @<enter>First we save the current state@<enter>
        @<enter>And create a new state to work in.@<enter>
        @<enter>We initialize the macros,@<enter>
        @<enter>then get rid of the window@<enter>
        @<enter>and restore the state.@<enter>

2 Macros

        A  macro  is  a  way for a user to collect a group of commands
     together  and  have  them executed as one command.  This can save
     typing if the group of commands is executed frequently, or can be
     used to hide incomprehensible (but useful) features of mined from
     novice users.

        Mined has two different ways of invoking macros, the <EXECUTE>
     command,  and  the  <UDO?>  commands.  The <EXECUTE> command just
     does  the  obvious,  it  invokes  the  macro  specified  as an
     argument;  the <UDO?> commands allow the user to define a command
     sequence that will invoke a specific buffer automaticly (that is,
     the  buffer to be executed is defined by the command, rather than
     given as an argument to it).

3 Defining_macros

        A  macro  is  a list of commands stored in a buffer.  There is
     only one way to get a command into a buffer, with the <ENTER_COM>
     command.   This command may be used in two ways, either it allows
     the  user  to  insert  a  single command, or in goes into command
     insert mode.

        To  insert  a  single  command,  press  <ENTER_COM>, it should
     respond with `COMMAND: ' on the bottom line, type any command (or
     even  a  normal  character)  that  command  will  be added at the
     current  cursor position, and the cursor is moved over to the end
     of  the  new  text.   If  insert mode is off, then this text will
     overwrite what was there, if insert mode is on, then this text is
     inserted.   A  command in a buffer is displayed as `command blob'
     followed  by  the  name  of the command as it appears in the help
     window.

        To  enter  command  insert mode press <ENTER><ENTER_COM>, then
     any  command  typed  (with a few exceptions) will be added to the
     file  rather  than  interpreted  (this  mode is also dependant on
     insert  mode in the obvious way).  The exceptions to the commands
     that  are  inserted are <ENTER_COM>, <RETURN>, <BACKS> and <END>.
     The  <ENTER_COM>  command will behave normally (that is it allows
     you  to  insert  one of the commands that have meaning here), the
     <RETURN>  command  does  the  obvious,  <BACKS>  deletes the last
     character  (note  not the last command, just the last character),
     and <END> exits from command insert mode.

        It  is also possible to enter commands by picking up a command
     blob  from  somewhere  (there is no command that just generates a
     command  blob), putting it down where needed, and then typing out
     the  name of the command wanted.  This is not really recommended,
     but it will work.

        It  is  frequently  useful  to  be  able  to  set  up a buffer
     containing  a  macro  that will not be saved when exiting (ie.  a
     temporary  macro  that  is only useful for rather specific work);
     the  <USE> command will not do this, but there is a rather useful
     kludge that will work.  If you type,

          <ENTER>macro_name<PICK><ENTER>macro_name<USE><CLOSE>

     then a new buffer named macro_name will be created which will not
     be saved when exiting (the <PICK> creates such a buffer and puts
     a  line  of junk into it, the <USE> command lets you edit it, and
     the <CLOSE> command gets rid of the line of junk).

3 Translated_macros

        To  make life even more miserable there are actually two forms
     of  macros,  the  first  kind  is the type you see and build, the
     second  kind  is the type mined actually uses and creates itself.
     The  kind  the  user  generates  has  the  advantage  that  it is
     (somewhat)  legible,  the  other  kind  has the advantage that it
     executes  faster,  is  smaller,  and  mined  will  deal  with  it
     correctly in more places.

        The  <TRANSLATE>  command  may  be used to interchange the two
     formats, pressing <TRANSLATE> on a macro in the fully spelled out
     format   will   be   converted   to   the   other  notation,  and
     <ENTER><ARG><TRANSLATE> may be used to go in the other direction.
     When   executing   an   untranslated  macro  mined  automatically
     translates  it before executing it, and then untranslates it when
     done  (thus  an untranslate macro when applied to itself will not
     yield the expected results).

     Mined keeps track of whether a buffer has been translated or not,
     and  assumes  that all files read in from disk (except in special
     cases)  are  untranslated.   Thus  after  reading in a translated
     macro from the disk, the user should type,

          <ENTER>command<SET>

     to  convince  mined  that the buffer actually contains translated
     commands.

        There  are  a few buffers that mined expects to be translated,
     if  TRANINI is specified on the command line (or environment), or
     if  an  <INI_MACRO> is defined in the .med file, or if a -recover
     is  done,  then  all  of  the resultant buffers are assumed to be
     translated.   A  keystroke  file  will  be output as a translated
     macro.

3 Executing_macros

        As  stated  above  there  are two ways of executing macros:any
     macro  may  be executed with the <EXECUTE> command and the macros
     $0-$9  may be executed with the commands <UDO0>-<UDO9>.  To start
     up a macro in buffer `foo' type,

          <ENTER>foo<EXECUTE>

     to start up a macro in buffer `$0' then either,

          <ENTER>$0<EXECUTE>

     or

          <UDO0>

     may be used.

        Macros   may   be   passed  parameters  (see  the  section  on
     Macro_parameters  for  a  description of using these parameners).
     All  parameters should be separated from each other (and from the
     macro   name,   if   present)   by   the   <ARG>   command,  thus,

          <ENTER>1<ARG><ARG>spam<ARG>foobar<EXECUTE>

     will pass 1, null argument, "spam" to the macro foobar, and,

          <ENTER>1<ARG><ARG>spam<ARG><UDO0>

     will  do the same to the macro $1.  Currently a macro will accept
     a  cursor motion argument, but only if that argument is the first
     argument given.

        Macros  will  normally  stop  when the user presses <INTERUPT>
     (and  the  terminal is not in raw mode), or when the macro itself
     gets  an error (ie.  a search failure).  Often it is useful to be
     able  to continue from an error (if you wish to construct a macro
     that  will  replace  all  instances of one string with another in
     several  files,  the obvious thing to do is to keep replacing one
     file  until  the search fails, and then move on to the next one).
     Mined  has  a way of causing a macro to trap an error that occurs
     in  a macro it invokes (but not in itself), if the first argument
     to  a macro is null, then this argument will be stripped off, and
     the  enclosing  macro will not die when the invoked macro gets an
     error.  Assume the buffers `foo' and `bar' contain the macros,

          @<ENTER>@<ARG>bar@<EXECUTE>@<USE> @<ENTER>@<ARG>bar@<EXECUTE>

     and

          @<REPEAT>@<ENTER>#include@<ARG>spam@<SEARCH>@<END>

     respectively,  then  executing `foo' will convert all `#include's
     in  the current file to `spam', and then do the same thing to the
     alternate  file.   The  important  thing to note is that when the
     macro  `bar' runs out of things to search for, it will terminate,
     but  the  macro  `foo'  will  not;  if,  however,  there  were no
     alternate  file  then  the  `foo' macro would terminate after the
     <USE>.

3 Macro_parameters

        Inside  a  macro  the  various parameters to that macro may be
     interpreted by the <EVALUATE> command.  The n'th parameter may be
     examined by,

          @<ENTER>$.n@<EVALUATE>

     and the number of arguments may be determined by,

          @<ENTER>$.@<EVALUATE>

     and the name of the buffer being executed by:

          @<ENTER>$.0@<EVALUATE>

     If a parameter is cursor defined text, then it is interpolated as
     `hor_displacement'c,`vert_displacement'l,   which   is   a  legal
     argument for anything that takes cursor motion.

        For  more  information  see  the  section on <EVALUATE> in the
     main  mined help area.

3 Programming_in_mined

        It  is just barely possible to write programs in mined (Yes it
     can  do  as  much  as your normal turing machine).  Macros can be
     used  as  subroutine  calls  (or  function calls since macros can
     return values).  There is a looping construct, that allows you to
     specify  an  infinite  loop  easily,  and  a  for  loop with more
     difficulty.   There  is an if construct that requires both a then
     clause  containing  an  arbitrarily  long list of commands, and a
     similar  else clause.  Finally there is a means of evaluating and
     assigning variables.

        Probably  the  most  necessary thing when writing a program is
     the  ability to evaluate an expression.  Mined provides a limited
     method  for evaluating expressions, there is a command <EVALUATE>
     that  looks  at the enter line and evaluates it as an expression.
     If  a number is found there it is treated as a number, if an item
     is found in double quotes then it is treated as a string, and the
     quotes  are  removed, if a buffer name is found the first line of
     that  buffer  is  interpretted  if  it  is  a  number a number is
     returned,  otherwise  a string is, if the item is a function then
     it  is  evaluated.  Numbers may be composed with the operators +,
     -,  *, / with the usual meanings, and the relational operators <,
     >,  =,  !=,  >=, <= where a 1 is returned when true, and a 0 when
     false, parentheses are handled normally.  Thus,

          <ENTER> 1+2 = 3 <EVALUATE>

     leaves  a  value  of  1  on the enter line, and if the buffer foo
     contains the line 6

          <ENTER> foo+4 = 2*4 <EVALUATE>

     leaves  a  value  of  0  on  the enter line.  For a more complete
     description  see  the  documentation on the <EVALUATE> command in
     the main help file.

        A  macro  can  return  a value by leaving while in enter mode,
     that is if the last line of the macro is @<ENTER> value then when
     the  macro  exits  mined will be left in enter mode with value on
     the  enter  line.   Obviously <RECALL> and <EVALUATE> may also be
     used.   Note  that this method only works when these are the last
     commands  in  the  macro  (or  if, or repeat), there is no way to
     return a value from the middle of a macro.

        A  macro can go into a loop by the <REPEAT> command, this loop
     repeats  any commmands between the REPEAT> and a subsequent <END>
     command.  Thus,

          <REPEAT><DOWN><END>

     will  produce  lots of <DOWN>'s.  A simple <REPEAT> command is an
     infinite  loop  (this is not actually as limited as it may seem),
     but preceding the <REPEAT> with a numeric argument will limit the
     number of times the loop is executed to that number.  If an error
     ever  occurs  inside of a loop, then the loop will be terminated,
     if  the  terminal  is not in raw mode (see the <TERMINAL> flag or
     the  documentation  on  the unix stty command) then an <INTERUPT>
     will  abort  the  loop,  or  if  one  of  the  commands inside is
     <STOP_REPEAT> then the loop will stop.

        Mined  supports  a  conditional  called <IF> (obviously), this
     takes a numeric argument (which probably must be evaluated by the
     user)  and  if  the  number is non-zero executes the then-clause,
     while  if  the  number is zero executes the else-clause.  <IF> is
     similar  to  <REPEAT>, but it takes two command lists (terminated
     by <END>) rather than one, the first of these is the then-clause,
     the second the else-clause.  Thus,

          <ENTER> $line <= $length <EVALUATE><IF>
            <CLOSE>
          <END>
            <ENTER><GOTO>
          <END>

     will  check if the current line is inside the file, and if it is,
     then will get rid of it, otherwise will goto the end of the file.

        In mined the only variables available to the user are buffers,
     thus  the  equivalent of the assignement statement is the <STORE>
     command  which  takes  2  arguments, a value of some nature and a
     buffer  to  put it in.  Thus a standard assignement command might
     look like,

          <ENTER> $line <EVALUATE><ARG>value<STORE>

     will assign the current line number to the buffer named value.

        A  return  statement  from  a  macro  may  be simulated by the
     sequence:

          <ENTER><STOP_REPEAT>

3 Screen_updating

        Normally  when  executing  a  macro the user will not want the
     screen  updated  (this  would  make the macro very slow), so when
     mined  sees  that  it  is inside a macro (or a loop, or an if) it
     stops  updating  the  screen  until  the last macro has finished.
     Upon  occassion  macros  need  to  present the user with the real
     screen,  mined allows the <REFRESH> to update the screen (even in
     macros).  This command can be used either to clear the screen and
     retype  the whole thing, or just to retyped the changed parts, or
     even  to  refresh  the current line (and nothing more).  A simple
     <REFRESH>  will behave normally, <ENTER><REFRESH> will retype the
     current  line,  and  <ENTER><ARG><REFRESH> will retype what needs
     changing.   Usually  <ENTER><ARG><REFRESH>  is the most efficient
     way  to  update  the  screen,  since  it will check and clear the
     screen if that turns out to be the fastest way to do it.

3 Other_commands

        The following commands are more useful in macros than anywhere
     else:

        <REPEAT>      Start a repeat sequence
        <IF>          Conditionally execute commands
        <END>         End a list of commands (for the above)
        <STOP_REPEAT> Abort an input stream
        <MSG>         Display a message.
        <INPUT>       Get text from a user.
        <TRANSLATE>   Translate the file to or from command format
        <ENTER_COM>   Enter a mined command in the file
        <EVALUATE>    Use the contents of the named buffer as an argument
        <EXECUTE>     Execute the file as a mined macro.
        <UDO0-9>      User definable options

3 Examples

        The following example,

          @<ENTER>$@<RIGHT>

     moves to the end of the current line or,

          @<ENTER>$word@<EVALUATE>@<+SEARCH>

     searches for the word under the cursor or,

          @<ENTER>$.1@<EVALUATE>@<CLOSE> @<ENTER>$.1@<EVALUATE>@<OPEN>

     takes an argument (perhaps cursor defined) and converts that much
     space from whatever it now holds to blanks.

        The following,

          @<ENTER>$hpos@<EVALUATE>@<ARG>%hpos@<STORE>
          @<ENTER>$vpos@<EVALUATE>@<ARG>%vpos@<STORE>
          @<HOME>@<ENTER>5@<DOWN>
          @<ENTER>$0@<PICK>@<ENTER>$0@<WIND>
          @<CLOSE>@<ENTER_COM>@<ENTER>$@<ENTER_COM><RIGHT>
          @<TRANSLATE>
          @<ENTER>$1@<PICK>@<ENTER>$1@<USE>
          @<CLOSE>@<ENTER_COM>@<ENTER>$word
          @<ENTER_COM>@<EVALUATE>@<ENTER_COM>@<+SEARCH>
          @<TRANSLATE>
          @<ENTER>@<WIND>@<HOME>
          @<ENTER>%vpos@<EVALUATE>@<DOWN>
          @<ENTER>%hpos@<EVALUATE>@<RIGHT>

     can  be  used to define the first two macros.  First it saves the
     current state, (what line are we now on, and where are we on that
     line), it creates a window it can work in with out destroying the
     current  file  and  alternate,  it  defines  the two macros to be
     invoked  by  <UDO0> and <UDO1> respectively, and then it restores
     to the old status.

        Finally,

          @<ENTER>$hpos@<EVALUATE>@<ARG>%hpos@<STORE>
          @<ENTER>$vpos@<EVALUATE>@<ARG>%vpos@<STORE>
          @<ENTER>$<rectangle>@<EVALUATE>@<ARG>%rect@<STORE>
          @<ENTER>$concat("<rectangle>=",$<curmotion>)
          @<EVALUATE>@<SET>
          @<ENTER>$.1@<EVALUATE>@<CLOSE>
          @<HOME>@<ENTER>5@<DOWN>@<ENTER>!@<WIND>@<RIGHT>
          @<ENTER>@<ARG>$. > 2@<EVALUATE>@<IF>
          @<ENTER>$.2@<EVALUATE>@<ARG>
          $.3@<EVALUATE>@<-SEARCH>@<END>
          @<-SEARCH>@<END>
          @<LEFT>@<ENTER>@<ARG>@<REPEAT>@<+SEARCH>@<END>
          @<ENTER>@<WIND>@<HOME>
          @<ENTER>%vpos@<EVALUATE>@<DOWN>
          @<ENTER>%hpos@<EVALUATE>@<RIGHT>
          @<ENTER>$concat("<rectangle>=",%rect)
          @<EVALUATE>@<SET>
          @<RESTORE>

     is used to define a bounded replace.  It accepts three arguments:
     a  region  to  do  the replace in, a search string, and a replace
     string  (these  last  two  are  optional).   Since  the region is
     defined by the first argument cursor motion may be used to define
     it.  The macro works by saving the current state as the one above
     did  (with  the  addition  of  saving the state of a rectanglular
     argument,  in  order that cursor motion and `hor_dif'c,`ver_dif'l
     will  define  the  same  text).   Then it deletes the interesting
     text,  and  creates  a  window  looking  at  the close buffer, it
     replaces  all  the instances inside this region (note that it has
     to  be  careful in case there is something to replace at the very
     start),  it  deletes the window, restores the state, and restores
     the (altered) deleted text.

2 File_flags

        Each  file  has a bunch of flags associated with it, these may
     be  changed  in the <status>, or the <set> commands.  These flags
     and their meanings are:

     changed    The file has been changed in this editing session.

     new        The file has been created by this editing session.

     modifiable The incore copy of the file may be changed by the user.

     save       The file will be saved on exit if it has been modified.

     command    The  file  is  to  considered  to have parity characters
                specifies  mined commands (only useful in execute,
                and translate commands).

     backedup   The file has been backed up.

     rectangle  The file is to be inserted as though it had been picked
                with a rectangular pick.

     text       The file is to be inserted as though it had been picked with
                text mode on.

     file       The buffer is considered to be a file, if a buffer is not a
                file  (ie,  the  <pick>  buffer,  `$')  and a user
                exits,  and reenters, then no attempt will be made
                to read in the buffer from disk.

     visible    The buffer will be displayed by a normal <status> command.

2 Expressions

        Mined  has two types of values, strings and numbers.  A number
     can  always  be  converted  into  a  string,  a string (that is a
     number)  will  usually be converted into a number (the exceptions
     being:  if  a  number is explicitly indicated as a string ("123")
     then  it will remain a string, and the results of $tohex, $tooct,
     and  concatenation  are  left as strings (note that the functions
     $num,  ...   may be used to obtain numeric values)).  A string is
     represented  by  a  double  quote  followed  by the string value,
     followed  by another double quote, a quote may be included in the
     string  by  preceding it with a backslash, if fact if a backslash
     is  found  in a string, it will be removed and the next character
     used as part of the string no matter what meaning it may normally
     have.   A  number may be entered in several ways, the most common
     is  a  string  of  decimal  digits,  in which case its meaning is
     obvious;  however,  if the first digit is `0' then strange things
     happen.   A  `0x' indicates that the number is to be treated as a
     hexadecimal  number  (where  0-9,  a-f  are valid digits), if any
     number  follows  the  `0'  then  the number will be assumed to be
     octal.  A character may be entered as a number by including it in
     single quotes (thus 'A' has value 65 (in ascii)).

        If  an item is neither a number nor a string, then it may be a
     buffer name, a function or a macro argument.  If a buffer name is
     found, then the first line of that buffer will be examined, if it
     is a number then mined will use it as a number, if it is anything
     else,  then  mined will treat it as a string (but will not try to
     parse  quotes  or  backslashes  out  of  it).   If  the item is a
     function, then mined will evaluate that function, perhaps reading
     arguments  for it, and if it is an argument mined will return the
     arguments value.  These will be treated the way the line from the
     buffer was, integers will become integers, and anything else will
     be a string.

        Mined  does allow arrays, by using a parenthesissed expression
     after  a  buffer  name  to  indicate  a line in that buffer, thus
     foo(3)  is the third line in the foo buffer.  Buffers, functions,
     arguments  and  parenthesissed expressions may all be followed by
     text  to  indicate a substring; an open curly bracket followed by
     an  expression  followed  by  a  colon  followed by an expression
     followed  by a close curly bracket takes a substring beginning at
     the  first  expression  that  is  as  long as the second.  If the
     second  is omitted, then a length of one is assumed, if the colon
     and  the  second  are omitted then the rest of the string will be
     used.   Beware  that  the  colon must be preceded and followed by
     spaces, otherwise it will become part of a buffer name.

        Integers   may  be  combined  to  form  expressions  with  the
     following  operators:  `-',  `!',  `~' are unary operators, a `-'
     negates  a  value  a `~' bit complements it, and a `!' converts a
     zero  to  a  one and any non-zero number to 0 (these all have the
     highest  precedence).   A  `+', `-', `*' `/' all have the obvious
     meanings  (with  next highest priority), the relational operators
     (`=', `!=', `>', `>=', `<', `<=') will return 1 if the comparison
     is  true,  and  0 if false (these have the next to lowest priori-
     ty),  and  `&', `|' are logical bitwise operators (these have the
     lowest  priority),  Beware  that  a  tilde  must be followed by a
     space, otherwise it will become part of a buffer name.

        Two strings may be concatenated by using the `+' operator, and
     may  be  compared  by  using  the  same  relational  operators as
     integer.

        Any expression may be enclosed in parentheses, either to alter
     the priority of operators, or to use a substring.

        If  the  name  to be expanded begins with `$.' then it will be
     handled as a request for macro parameters.  This is an error if a
     macro is not being executed.  The name `$.' returns the number of
     parameters  available,  `$.0' returns the name of the macro being
     evaluated,  `$.n' returns the n'th parameter (or an error if n is
     too big).  The names `$.#' and `$.$' return all the arguments, or
     all  the  arguments  followed  by  the  buffer name respectively,
     arguments are seperated by <arg>.

        Expressions  may also contain the following functions.  If the
     name  to  be translated is one of the following, then a buffer of
     that name will not be searched for, instead:

        eof         1 if the current line is after the last line in the file,
                    0 otherwise.

        more        1  if  the  current  line is before the last line in the
                    file, 0 otherwise.

        length      The number of lines in the current file (if an argument
                    is given then the number of lines in that buffer).

        bufvers     The version number of current file (if an argument is
                    given then the version number of that buffer).  On
                    unix  systems  or if the buffer does not contain a
                    file 0 will be returned.

        line        The current line number.

        pos         The column of the cursor.

        flag        Takes  one argument, a flag name (see the section flags)
                    and  checks  to  see  if  that  flag  is on in the
                    current file, if so it returns a 1, if not a 0 (if
                    a second argument is given then it will be used as
                    a buffer name).

        vpos        The vertical distance to the home of this window.

        hpos        The horizontal distance to home.

        ok          0 if the last command was a macro, <while> or <if>
                    and that command terminated abnormally, otherwise 1.

        bad         1 if $ok is 0, otherwise 0.

        insert      1 if the editor is in insert mode, 0 otherwise.

        baud        The output baud rate.

        status      1 if the editor is in a status display, 0 otherwise.

        help        1 if the editor is in the help display, 0 otherwise.

        file        The name of the current file.

        null        The name of the null device on this system.

        exists      Takes one argument, and checks to see if a file of that
                    name has been read into the editor.

        canread     Takes one argument, a filename, and checks whether the
                    user can read that file.

        canwrite    Takes  one  argument, a filename, and checks whether
                    the user can write that file.

        filedate    Returns  the  modification  date  of  the file (as a
                    number,  in  unix time format, may be converted to
                    something  reasonable  with  $now or $date), takes
                    one  argument,  the  name  of a file.  If the file
                    does not exist (or may not be read by the user) -1
                    is returned.

        defspec     Takes three arguments, a filename, a directory and an
                    extension.   If  the  filename  does not contain a
                    directory  specification  it  adds  the  specified
                    directory,  if  the  filename  does not include an
                    extension  it  adds  the specified  extension, and
                    returns   the  result.   The  `.'  should  not  be
                    included in the extension.  If either field is the
                    null  string,  then nothing will be added for that
                    field.

        fullfile    Takes  one  argument,  a string, treats it as a file
                    name,  and  expands it as a full pathspec (that is
                    node,  disk,  directory,  filename).   Very little
                    checking  is  done  to  see  if  this  is  a legal
                    filename,  and  no checking is done to see whether
                    the  file  exists,  or whether the user can access
                    it.

        load        Takes one argument, the name of a file and loads it into
                    a mined buffer.  If this buffer already exists a 0
                    is returned, and the file is not read in, if the
                    file  exists  on disk then a 1 is returned, if the
                    file  is  created a 2 is returned, if the file may
                    not be accessed, -1 is returned.

        reload      Similar to above, takes a file name and loads it into a
                    buffer  even if the buffer already exists (ie gets
                    the  original  copy  of  the  file  back).   If no
                    argument  is  given,  the  current  file  will  be
                    reloaded.   Returns  -1,  1,  or  2  as  above; no
                    indication  is given if mined already had a buffer
                    of that name.

        read        Takes one argument, the name of a file, and loads it into
                    the  current buffer, before the line the cursor is
                    on (close to a <use>, <put> combination).  Returns
                    1  if  the  file  were  read  in  successfully,  0
                    otherwise.

        cd          Takes  one argument, a directory, and tries to move
                    thither.  Returns 1 if successful, 0 if not.

        window      Returns  the number of the current window (this is the
                    number <chwind> wants).

        windpar     Returns the number of the parent window (the one from
                    which  the current window was created), if this is
                    the main window -1 will be returned.

        windnum     Returns  the  total number of windows created in this
                    session  (there  is always at least one window,
                    the main one).

        num         Takes  a  single  argument, and converts it into a number
                    following  the  standard  conversion  rules  above
                    (numbers  preceded by 0x are hex, those precede
                    by 0 octal).

        dec         Takes  a  single argument, and converts it into a decimal
                    number.

        oct         Takes  a  single  argument,  and converts it into a octal
                    number.

        hex         Takes  a  single argument, and converts it into a
                    hexadecimal number.

        date        Returns  the date and time as a string (in ctime format,
                    without  the newline).  If an argument is given it
                    will  be  used as the unix time specifier and will
                    be  converted  to  the  date string instead of the
                    current time.

        now         Takes up to two arguments, a number and a time and returns
                    some  part of the specified time.  If there are no
                    arguments,  it returns the current time in unix
                    time  format.   If  the  the  first argument is 1,
                    seconds are returned, if 2 then minutes, if 3 then
                    hours,  if  4 then the day of the month, if 5 then
                    the  month,  if 6 then the year, if 7 then the day
                    of  the  week,  and  if 8 the day of the year.  If
                    there  is a second argument this will be used as a
                    time, otherwise the current time will be used.

        rand        Returns a random integer.

        eg          Returns a string containing the phase of the moon.

        addchar     Takes one argument, a character (number), and puts it
                    on  the screen (this is dependant on insert mode).
                    If  a  control  character  is  given  then  the
                    corresponding  quote  sequence is generated.  This
                    function  allows  the  user  to  insert  a  parity
                    character.

        addfchar    As  above,  except that if the character is a rubout
                    then  only  a quote character is generated (rather
                    than the quote quote sequence of a normal rubout).

        word        The  word  beginning  at the cursor, and going to a word
                    delimitter.

        char        The  character  under the cursor (as an integer), if the
                    cursor  is on a <quote> character 127 is returned,
                    if  it  is  beyond  the  end of the line, 0 is, if
                    beyond the end of the file -1.

        fchar       As  above,  except if the character under the cursor is
                    <quote>  then  the  resulting control character is
                    returned.

        tochar      Takes  one  argument,  a  number, and converts it to a
                    string.

        getchar     Takes  one argument, a number, and waits for the user
                    to  type a character and returns it.  The argument
                    is  an  or  of  flags  to indicate what kind of in
                    input  to  be  done.   An argument of 0 gets the
                    next  character,  control  or  normal;  a  flag  1
                    indicates that control characters are to be inter-
                    preted as commands (that is if the first character
                    read  is  a  control  character,  then  read  more
                    characters   until   a   complete  command  is
                    specified,  and  return the number of that command
                    (this  number is the same number used to represent
                    the  command  in a translated macro), -1 indicates
                    an  unknown  sequence);  a  flag  2 indicates that
                    control   characters  are  to  be  interpreted  as
                    commands  and  then  executed;  a flag of 4 is the
                    same  as  2  except that the <exit> command is not
                    executed,  a  flag  of 8 does not allow any normal
                    characters  to  be inserted in the file, a flag 16
                    does  not allow any commands that change any files
                    to be done, a flag 32 does not allow any windowing
                    commands  to be done, and a flag 64 does not allow
                    any  commands that alter which file we are looking
                    at.

        docom       Takes two arguments, a command and a flag as above. The
                    command  is executed subject to the constraints of
                    the  flag.  Returns 1 if the command was executed,
                    0 if it was not, or if it was not a valid command.

        tonum       Takes  one  argument, a string, and returns the numeric
                    value of the first character.

        tofnum      As  above except if the first character is <quote> the
                    resultant control character is returned.

        tohex       Takes  one argument, a number, and converts it into the
                    hex representation of that number.

        tooct       Takes  one argument, a number, and converts it into the
                    octal representation of that number.

        do          Takes  one  argument,  a  string, and executes it (on unix
                    systems  arguments  will  be  passed  through  the
                    shell),  the  function does not wait.  The created
                    pid is returned.

        alive       Takes  one  argument,  a  pid,  and  checks to see if a
                    process of that name is alive.

        wait        Takes one argument, a pid, and waits for that process to
                    die.

        sysload     Returns  some  indication  of the system load (on VMS
                    this is currently a process count).

        These  functions  are  not  expected  to  be  useful, they are
     included for recovery:

        term        Returns the terminal type of the controlling terminal.

        shell       Returns  the  default shell for an interactive <do>, if
                    given  an  argument,  it  sets  the  shell to that
                    string.

        mpath       Returns  the default search path for reading files with
                    no  directory  specification if given an argument,
                    it sets the path to that string.

        s           Resets the files that mined moves through on <enter><use>
                    so that there are none available.

        a           Adds a file to the above list (at the end).

        u           Forces the alternate file not to exist.

        g           Allow  editing  from  inside a macro, <exit> returns to
                    the macro.

        startwild   Returns the first file that matches the argument (a
                    wild card pattern), subsequent files may be obtain
                    with $nextwild (or $nw).

        nextwild    Returns  the  next file that matches the argument of
                    the last $startwild.

        nw          Returns the next file that matches the argument of the
                    last $startwild.

        comname     Takes one argument, a number, and returns the name of
                    the command with that number.

        comnum      Takes  two arguments, a string, and an optional number
                    and  returns the number corresponding to the named
                    command.If  the  second  argument  is  given  then
                    searching  for the right command begins after that
                    command.   Returns  -1 if there were no command by
                    that name.

        comlib      Takes  one argument, a number, and returns the library
                    of that command.

        comflags    Takes  one argument, a number, and returns the flags
                    of that command.

        comhelp     Takes  one  argument,  a number, and returns the help
                    text for that command.

        invoked     Takes  one  argument,  a number, and returns a string
                    containing  either  "Nothing",  or  a  list of all
                    character   sequences  that  will  invoke  that
                    command (or buffer) seperated by comma space.

        apropos     Takes  up to two arguments, the first is a string for
                    which  mined  will search, and the second where to
                    search.   Mined  tries  to  find  any  of the help
                    strings  that  contain  the first argument, if any
                    are  found  it display them on the screen with the
                    command  name,  the  help  text, and followed by a
                    line  containing  invocation  information.  If the
                    first  argument  is  a  null  string  (or  is  not
                    specified)   mined   will   match   everything  it
                    searches.  The second argument is a bunch of flags
                    with the following meanings:

                      0x1     Include the help message in the inserted text.
                      0x2     Include the command name in the inserted text.
                      0x4     Include invocation info, if the help text is
                              included it will be on a separate line.
                      0x8     Also look for matches by  searching  the
                              command name (in addition to the the help text).
                      0x10    Include only items which do not match the first
                              argument.
                      0x20    Put the matches in the current buffer rather
                              than displaying them on the screen.
                      0x100   Search the command list.
                      0x200   Search the user defined command list.
                      0x400   Search the set of  boolean  options  (those
                              with only two values).
                      0x800   Search  the  set  of  numeric  options
                              (includes options with more than two but
                              predetermined meanings).
                      0x1000  Search the set of string  options.
                      0x2000  Search  the  set  of  positional  specifiers
                              (i.e., things like <char_shift>)
                      0x4000  Search the set of border characters (bars).
                      0x8000  Search the set of magic characters (those used
                              in regular expressions).
                      0x10000 Search the set of status line options.

                    If  the  second  argument  is not specified (or is
                    specified  as  0) then a default of searching both
                    the  standard  and  user defined command list, and
                    displaying  the  command  name, the help text, and
                    the invocation information will be used.  $apropos
                    returns the number of matches it found.

        newcom      Takes  five  arguments,  a  command  name  (string), a
                    character   sequence  to  invoke  it  (string),  a
                    library  (string), a bunch of flags (number) and a
                    help  message  (string),  it returns the number of
                    the created command.

        setcom      Takes  six  arguments, a command number to be set, and
                    the  rest  as  above.   Returns  the number of the
                    command  set, or -1 if there were none such.  This
                    function may only affect user defined commands.

        moveto      Takes two arguments, an x position and a y position and
                    moves  to  that  spot on the screen, if one of the
                    arguments  is out of bounds the edge of the screen
                    is  used.Returns  1  if  all the arguments were in
                    bounds.The  upper left corner of the screen is 1,1
                    x increases to the right, y increases downward.

        xpos        Returns  the  current x position of the cursor (or where
                    the cursor would be if all output were flushed).

        ypos        Returns  the  current y position of the cursor (or where
                    the cursor would be if all output were flushed).

        vsize       The vertical size of the screen (the number of rows).

        hsize       The horizontal size of the screen (the number of columns).

        boldsize    The number of spaces required for the change to bold
                    mode.  If a terminal does not have bold mode, this
                    will return 0.

        clear       Clears the screen (and returns 1).

        clr_line    Clears the rest of this line (and returns 1).

        putchar     Takes  one  argument, a character, and displays it on
                    the  screen  at the current cursor position, the x
                    position will be increased by one (if the terminal
                    were  not  on  the  right margin, where the cursor
                    will either stick or wrap).  If an attempt is made
                    to   output   control   characters  they  will  be
                    converted in a strange way, the only ones the user
                    should be interested in are:

                      1  horizontal bar
                      2  lower left corner
                      3  lower right corner
                      4  pushed left
                      5  pushed right
                      6  quote blob
                      7  tab stop
                      8  upper left corner
                      9  unused line
                      10 upper right corner
                      11 unused window
                      12 vertical bar
                      13 argument blob
                      14 enter blob
                      15 rubout blob
                      18 command blob
                      24 macro counter
                      25 macro nested counter
                         This function returns 1.

        putbin      Outputs  a  character  as  above,  except that control
                    characters will not be converted.  If this is done
                    mined assumes that the screen will be trashed, and
                    that it knows nothing about what is visible.  When
                    mined  is next asked to update the display it will
                    clear  the  screen  and start over.  This function
                    returns 1.

        puttext     Takes   one  argument,  a  string  and  outputs  the
                    characters  in the string as it outputs characters
                    in $putchar.  This function returns 1.

        putline     Outputs  a string as above, except it clears the rest
                    of this line and moves to the next line when done.
                    If the call begins on the last line of the screen,
                    the line will not be printed, instead `---More---'
                    will be displayed at the bottom of the screen, and
                    mined  will  wait for the user to enter a command.
                    A space will cause mined to move to the top of the
                    screen,  and  continue, a <backs> will be ignored,
                    and  any  other command will cause mined to return
                    immediately,   any   further  $putlines  (after  a
                    non-space or <backs>) will also return immediately
                    until  a  $put  is  done.  This function returns 1
                    normally, and 0 if it were aborted.

        put         Flushes the output buffer (also reenables $putline). None
                    of  the above functions will produce output unless
                    this function is called.  This function returns 1.

        beep        Send a control-G (bell) to the user's terminal, and flush
                    the buffer (but does not reenable $putline).  This
                    function returns 1.

        input       Returns 1 if there is input available from the terminal,
                    0 otherwise.

        The  following  functions are designed to allow a macro to use
     mined's  own  display  optimization  routines.   All of them will
     return 1 unless noted:

        dpypos      Position  mined  so  that the next character displayed
                    (dpied)   with   these   functions  goes  to  that
                    location.  Behaves similar to $moveto.

        dpyx        Returns the x position of the logical cursor.

        dpyy        Returns the y position of the logical cursor.

        dpywind     Dpy  one  of  mined's windows, takes one argument and
                    uses  that as a window number.  If 0 is given, the
                    current  window  will  be  updated, if -1 then all
                    windows will be.

        dpychar     Similar  to  $putchar  except  no  characters will be
                    output until a $dpydpy is done.

        dpytext     Similar to $puttext.

        dpyline     Similar to $putline.

        dpydpy      Do  whatever  updating needs to be done, and flush the
                    output buffer.

        optenv      Save  the  current  state  of  all  the flags.  May be
                    restored by $oldenv.

        wndenv      Save  the  current  state  of  the  windows, takes one
                    argument  a buffer name (which will be $created if
                    it  does not exist), builds a window taking up the
                    whole  screen  containing this buffer.  All the
                    old windows vanish.

        $newenv     Save the current state of the flags, and the windows.
                    A combination of the above functions.

        oldenv      Get back an old environment, either options, windows or
                    both.

        strlen      Takes one argument, a string, and returns the length of
                    that string.

        index       Takes  two  or  three  arguments, a string and either a
                    string  or  a  number, and an optional number.  If
                    the  second  argument  is a string then index will
                    search  the  first  string  for an instance of the
                    second,   and  return  the  starting  position  (0
                    based), if the second string is not found, then -1
                    is  returned.  If the second argument is a number,
                    then  it  is  treated  as  a  character,  and that
                    character is searched for.  If a third argument is
                    given  then  searching  begins at that position in
                    the string.

        expand      Takes one argument, evaluates it, uses the result as a
                    buffer  name,  and  takes  the  first line of that
                    buffer.This  might  be  useful if someone actually
                    had  a  buffer  with  an integer name (like 3) and
                    wanted to get the first line of it.

                    As  a  special  kludge  a name of the form $<item>
                    will  be  interpolated as the value of that item
                    in the help window.

     Example:

        <enter>0x43<evaluate>

     leaves the screen with `ENTER: 67' displayed on the bottom line.

        If  the  buffer foo contains the `3' on the first line and 123
     on the second, then,

        <enter>foo<evaluate>

     leaves the screen with `ENTER: 3' displayed on the bottom line.

        <enter>foo(2)<evaluate>

     leaves the screen with `ENTER: 123' displayed on the bottom line.

        <enter>foo(2){2:2}<evaluate>

     leaves the screen with `ENTER: 23' displayed on the bottom line.

        <enter>3<ARG>foo<evaluate>

     leaves the screen with `ENTER: 3(arg)3' displayed on the bottom line.

        <enter>foo+9<evaluate>

     leaves the screen with 12 (=3+9) displayed.

     If we are inside of a macro that was started with

        <enter>foobar<arg>1<arg><arg>spam

     then,

        <enter>$.<evaluate>

     yields 3.

        <enter>$.1<evaluate>

     yields foobar.

        <enter>$.0<evaluate>

     yields spam.

2 Crash_Recovery

        If  the  system  crashes  in the middle of an editing session,
     some  of what was previously done may be recovered if a keystroke
     file   was  generated.   The  keystroke  file  is  usually  named
     /tmp/medk??.iii  where ??  is the number of the terminal you were
     using, and iii are your initials, or ~/medk??.iii where ~/ refers
     to  your login directory.  If you are on a VMS system, then mined
     needs to have read and write privileges to to the keystroke file,
     otherwise  the  file may be in an illegible state.  If you are on
     the same terminal you were on before, you may type,

        mined -recover <return>

     otherwise type,

        mined -recover=`keystroke file' <return>

     .   The editor should then start redoing your last session.  Note
     that  in  the  above  you  should substitute for `keystroke file'
     whatever   filename  contains  your  keystrokes.   If  mined  was
     previously  run with some non-file arguments these should also be
     placed  on  the  command  line,  mined  will  remember  the  file
     arguments and will ignore any new file arguments given.

        This  file may lack up to 512 commands (1024 on Berkeley unix,
     <keyflush>  under VMS) from the end of your session.  When a user
     interrupts  command execution, then that command will be replaced
     by  the  sequence <recall><enter> (which always gets the user out
     of  enter mode).  If the command aborted was a search, this works
     properly;  if  it  were  a  repeat,  certain  commands  that were
     executed may be lost.

        The  recover  qualifier  is  very  like the tranini qualifier,
     except that it does not abort on an error; thus this qualifier is
     dangerous to use to execute a macro.

        Note  that running mined on the same terminal will destroy the
     keystroke file (after it has been used to do the recovery), so if
     you  expect  to  need  several  tries  at the recovery you should
     either: copy the file before running mined or when in mined type,

        <enter>`keystroke file'<use><enter>`new name'<save><use>

2 Initialization

        When  mined  starts  up  it  finds  the terminal type from the
     environment  or  the command line.  The value of term is searched
     for in the termcap file against the names of terminals listed, an
     exact  case  match  must  occur  for a termcap entry to be found.
     Mined  only  pays attention to the following items in termcap:

        al, am,  bc,  bs, bt, CB, cd, ce, cl, cm, co, cr, cs, CW, dc,
        dl, ho, ic,  if,  is, kd, ke, kl, kr, ks, ku, li, nd, nl, ns,
        NB, os, sb, se,  sf,  sg,  SG,  so, sr, ta, tc, te, ti, ug, up,
        WI, XS

     .   The  items CB, CW, NW, SG, WI, and XS are local to mined.  CB
     is  clear box, CW is clear window, NW goes to full screen (from a
     window),  SG  means  garbage  can  appear  on  scrolls, WI sets a
     window, and XS refers to intext standout mode.

        After  reading  termcap,  mined  attempts  to read a med file.
     This  file  must contain information that specifies the character
     sequence  for  every mined command, it may also contain the above
     termcap  items,  and a description of the characters used to draw
     the  box  around  the  screen (these characters are not necessary
     since there are reasonable defaults for the box that apply to all
     terminals).   Mined  requires  clear  screen,  and  one of cursor
     addressing,  or  cursor  up and non-destructive space; if termcap
     does not specify these mined will die.

        In  looking  for  a  med  file  mined  first examines the file
     specified on the command line, or in the environment.  If this is
     not  found  (or  was  not  specified) mined searches: the current
     directory, the user's bin ($HOME/bin), the user's login directory
     ($HOME),  and the default source of med files.  These directories
     are searched for a file named term.med where term may be a two or
     more  character  abbreviation  of  the terminal type.  If none of
     these  exists,  the  file  random.med  is searched on the default
     source.

        The  format  to  the  med file is vaguely similar to a termcap
     line.   But very vaguely, the file is line oriented, so a line is
     used  to delimit specifications, to be consistent with termcap, a
     colon  may  also  be  used; however, the text to the right of the
     colon is treated as a comment.  Thus the following are legal:

     :This is a comment line, the next line is blank and means nothing

     am: This terminal has automargins
     cen=\EOP: The <enter> command is an escape followed by OP
     csq: ^S/^Q are to be interpreted normally
     cts#8: Set default tab multiple to be 8
     csl@: Force editor not to display small line changes

        String,  numeric,  and  boolean  specifications  have the same
     format  as  they  do  in termcap.  The following is a list of the
     command specifiers, with their meanings:

        cen     <enter>      cbs     <backs>      cqu     <quote>
        clt     <left>       crt     <right>      ctb     <tab>
        crb     <backtab>    cup     <up>         cdn     <down>
        ccr     <return>     cho     <home>       cpp     <+page>
        cbp     <-page>      crs     <rshift>     cls     <lshift>
        cus     <use>        crf     <refresh>    cpl     <+lines>
        cbl     <-lines>     cex     <exit>       cgo     <goto>
        cdc     <delchar>    cim     <insrtmd>    cop     <open>
        ccl     <close>      cre     <return>     cpi     <pick>
        cpu     <put>        cps     <+search>    cms     <-search>
        csa     <save>       cwi     <wind>       ccw     <chwind>
        cdo     <do>         csr     <srtab>      cin     <inter>
        chp     <help>       cst     <status>     crp     <replace>
        crc     <recall>     cmk     <mark>       car     <arg>
        cap     <append>     cfi     <fill>       cbw     <backword>
        cso     <store>      cse     <set>        cdw     <delword>
        cpr     <+regular>   cmr     <-regular>   ctp     <stop_repeat>
        cev     <evaluate>   cer     <end_repeat> crp     <while>
        cxc     <execute>    cce     <enter_com>  ctn     <translate>
        cif     <if>         cum     <msg>        cui     <input>
        cbk     <brk>        cle     <else>       cmc     <macro_return>

        The following are a list of options that can be given:

        csq     bool: If set ^S/^Q are handled normally. (OFF)
        csl     bool: Sets updating of the line  number  whenever
                      it changes (otherwise  it  will  be  done
                      every page or so). (UPDATE)
        cas     bool: Exact case match in search (Exact)
        csc     bool: Remember the amount shifted on lines, shifts,
                      pages and use this next time if the  command
                      (or its complement) is typed without an arg.
                      (SAVE)
        cel     bool: When moving to the end of a line,  position the
                      cursor on the last character (if OFF) or beyond
                      the last character if ON. (BEYOND)
        cvt     bool: convert tabs on input. (ON)
        csi     bool: strip trailing blanks on output. (ON)
        cbk     bool: Do backups. (ON for unix, OFF for vms).
        cpf     bool: Cursor motion defines text. (RECTANGLE)
        cfw     bool: Word counts wrap beyond line boundaries. (WRAP)
        ccc     bool: Check commands for consistancy. (ON)
        crh     bool: Read in the help file. (ON)
        ccn     bool: Check whether to create new files. (WARN)
        cdh     bool: Display the help message at startup. (DISPLAY)
        cfu     bool: Fun option!
        ceg     bool: Draw the border on the screen edge. (GILT)
        cpa     bool: Definition of a paragraph. (BLANK_LINES)
        cmm     bool: What to do on mismatch parens. (IGNORE)
        cqs     bool: Whether text strings may be over lines. (ONE_LINE)
        cft     bool: When to flush typeahead. (ON_ERRORS)
        cfs     bool: When to do auto-fill. (BEYOND_COL)
        cto     bool: Use the terminal number in filespecs. (USE)
        cmb     bool: Handle mbx's in ISC fashion (ISC)
        cte     bool: Display errors trapped inside a macro. (NOSHOW)
        cbt     num:  Determines behavior of <backs> at start of line.
        cbo     num:  Determine the type of the border.
        cts     num:  Sets the default tab multiple (8).
        ckf     num:  Sets the number of chars after which the keystroke
                      file is flushed (32).
        crw     num:  Interupt handling.
        cet     num:  convert spaces to tabs on output. (ALL)
        cbd     num:  Determine behavior of the status line (weird)
        cbc     num:  Beep pos. (NEVER)
        cfc     num:  Fill column. (70)
        cmd     num:  Text processing mode. (AS_ENTERED)
        cmp     num:  How far to search for parens. (SCREEN)
        cmt     num:  How long to display a match. (1 second)
        csy     num:  How long errors should be displayed. (17 commands)
        ced     num:  When to enter the debugger. (NO_ERROR)
        cty     num:  Where to put the cursor on <return>. (UNSHIFT)
        cae     num:  How long to wait to exit the editor. (540 seconds)
        ctf     str:  Sets the default file from which tab
                      stops are initialized (none).
        cdt     str:  Gives the directory for default temp
                      files.
        cdk     str:  Gives the directory for default keystroke
                      files.
        cwe     str:  Sets the word end characters.
        cds     str:  Sets the characters that may be followed
                      by a double space.
        cpn     str:  Sets the characters that open a parenthesis.
        cpe     str:  Sets the characters that close a paren.
        cqq     str:  Sets the quote quote characters.
        ccs     str:  Sets the comment start string.
        cme     str:  Sets the comment end string.
        csm     str:  Sets the editor name.
        cud     str:  Sets the user modes.
        ctq     str:  Sets the text quote.
        cpb     str:  Sets the break paragraph characters.
        cxt     str:  Useless.
        cti     str:  Sets a file from which a startup macro
                      is to be read. (none)

        phs     Set action on horizontal shift.
        php     Set position of cursor after horizontal motion.
        phc     Set action of horizontal cursor keys.
        pcs     Set action when character is typed on right margin.
        pvs     Set action on vertical scroll.
        pvp     Set position of cursor after vertical motion.
        pvc     Set action of vertical cursor keys.
        prt     Set action of <return> key.
        pgp     Set position of <goto>.

        mqu       <quote>
        mbu       <bunch>
        mcb       <close_bunch>
        min       <invert>
        mth       <through>
        mkl       <kleene>
        moc       <occur>
        mso       <some>
        mel       <eol>
        msl       <sol>
        mal       <all>
        mit       <intersect>
        mat       <alternative>
        man       <not>
        mgr       <left_paren>
        mcg       <right_paren>
        mlt       <count>
        mcl       <close_count>
        mcn       <continue>
        mpi       <pick>
        mcp       <close_pick>
        mrg       <register>
        maf       <everything>

        If  the command specifications are incomplete, then when mined
     starts  it  may  enter  help  mode  (depending  on  the  value of
     <validate_medfile>),  and  place  the  cursor  on  a  bad command
     (seemingly  chosen  at  random),  the  user may then correct this
     command  himself.   Leaving  and  reentering  help mode (with the
     <help> command), or toggling the <verify_medfile> flag twice will
     move to the next bad command.

        The  box  characters  should  be  specified in almost the same
     format,  however a leading `.' indicates that the character is to
     be  preceded  by an initialization, and followed by a termination
     sequence (if an initial dot is desired it should be quoted with a
     backslash).   The  reason  for  the  sequence  is  that  on  many
     terminals  a special sequence is needed to put the terminal in an
     alternate  character  set  and  typing  this  sequence  for every
     character  is  very  time  consuming, so the init sequence allows
     mined  to  perform  output optimization.  The box specifiers, and
     their  defaults  are  as follows: The term init and term term are
     used to put the terminal in some random funny mode, and to remove
     it  from  this  mode.   Term init is output at start up, and term
     term at termination.  There is no facility to get output from the
     terminal  at  start  up,  and use this to restore the terminal to
     that state when done.

        The  term  init  will  be  typed out at start up (and after an
     interactive  <do>), the term term will be typed out on exit, (and
     before  an  interactive <do>.  Horizontal bar is used to draw the
     horizontal  borders of the window (if this is the current window,
     and that position is not a tab stop), the vertical bar is printed
     out  for vertical borders (if this is the current window, and the
     the  line  next to it is used, and the line has not been pushed).
     The  corners  are  printed  at the corners of the current window.
     Pushed right is printed on the left border of the current window,
     and  indicate that there is text on that line to the left, pushed
     left  is  similar  except it refers to the right margin, and long
     lines.   Unused line is printed on the left border if this is the
     current  window,  and  that  line  is beyond the end of the file.
     Unused  window  is  used to draw all the borders of windows other
     than  the  current  one.   Tab  stops  are printed out on the top
     border  of  the current window at every position where there is a
     tabstop.

        The  quote  blob  is  used  to  indicate  that  the  following
     character  is  a control character (or a rubout), the rubout blob
     is  the  character  that  comes  after  the  quote  blob  if this
     character  is  a  rubout.   The  enter blob appears on the screen
     where the cursor was when enter is typed (this will remain on the
     screen  during  cursor  motion),  the  argument blob is typed out
     whenever the user types the argument command inside of an entered
     argument.   The  macro  and  nested  blobs  are  used only by the
     debugger  to  indicate  the  various  macro counters of currently
     executing macros (and while/if commands).

        Curmotion  start  is printed out at start of cursor motion and
     then  ignored  (it is designed to implement the blinking lines on
     intext  terminal,  but  will  also work for the LED's on VT100s),
     curmotion  end  is  treated similarly.  Insert start is typed out
     when the editor enters insert mode, it is not to set the terminal
     in  insert  mode, it is designed to allow the editor to make some
     indication as to whether it is in insert mode or not (ie maybe to
     turn on the LED's on a VT100, etc.); insert end is similar and is
     typed  out  on exit from insert mode.  Mined assumes that none of
     these items will move the cursor when printed:

        bti  <term init, null string>
        btt  <term term, null string>
        bin  <init sequence, null string>
        bte  <term sequence, null string>
        bhb  <horizontal bar, `-' >        bvb  <vertical bar, `|' >
        bll  <lower left corner, + >       blr  <lower right cor, + >
        bul  <upper left corner, + >       bur  <upper right cor, + >
        bpr  <pushed right, `>' >          bpl  <pushed left, `<' >
        bun  <unused line, ; >             buw  <unused window, . >
        bts  <tab stop, T >

        bqu  <quote blob, ^ >
        brb  <rubout blob, ? >
        brp  <argument blob, @ >
        bbb  <enter blob, # >
        bmc  <macro counter, ^ >
        bnc  <nested counter, @ >

        bcm  <curmotion start, null string>
        bce  <curmotion end, null string>
        bim  <insert start, null string>
        bie  <insert end, null string>

2 VMS_specifics

        The interrupt character is not settable.

        Depending on the installation, RAW may not be settable.

        Unix  environment variables are simulated by logical names, by
     prepending  a  dollar  sign.  So the TERM variable on UNIX is the
     logical $TERM under VMS, etc.  These may be set by

          $ assign adm3a $TERM

        If  the editor is not given a terminal type, then it will do a
     getdev  on  the  terminal, and use the terminal type found there.
     Current  terminal  types  supported are: VT100, VT52, FT1-FT8; if
     the  terminal  is one of these mined will search for that name in
     the termcap file.

        Mined should be defined by a foreign command statement like,

        $ mi*ned :== $sys$edit:med

     which  may  be  included  in  a login.com, or typed to dcl before
     using  mined  (it  is  assumed  that  sys$edit: is a logical name
     assigned to the directory containing mined).  Everything is defined
     correctly in the file med_init.com.

2 Known_bugs

        Status windows are static once produced.

        There appears to be a problem with privileged subprocesses.

        If the user wants a full border, and an invisible status line,
     then  the lower right corner may be blank (to prevent the display
     scrolling).

        If  an  interrupt is given to abort macro/repeat execution, or
     to  abort  reading  in  the help file, then the keystroke may not
     mesh with the previous session.

        If  an  attempt  is  made  to  recover  from a terminal with a
     different  screen  size,  the recovery may not work (since things
     like <+page> are dependent on the screen size).  One way to avoid
     this  is  to force mined to think the terminal is of the old type
     (with -term=whatever on the command line), if this is tried mined
     may  produce  gibberish,  this  should  be  ignored, and the user
     should exit immediately after the recovery has finished.

        If  an  attempt is made to recover after a <save> or a partial
     <exit> the user should have restored the saved files to the state
     they were in before the editor was invoked.

        A  help  list  will  always  display  the current local modes,
     rather than the local modes of the controlling file.

        Mined can (VMS won't) clear the typeahead buffer on RT's.

        When  checking  to see if the user has write access to a file,
     mined  ignores  volume  protections.  When checking a file across
     VMS  DECNET, mined assumes that the user is the owner of the file
     if  the filename contains an access control string; otherwise, it
     assumes  that the user has only world access.  Mined also assumes
     that  the  user  never has BYPASS or SYSPRV (or gets SYSTEM privs
     from its uic) on the other side of the net.

2 Release_notes

        I  have  done  my best to bring mined up to date for use under
     UN*X  based  operating  systems  and  VMS  version  4.0  and  its
     subsequent  releases.   The  version  of  mined  in  use  may  be
     determined by typing,

        <control>N5

     on  most  terminals.   It should give you the current release and
     other pertinent information as described in this help document.

        Mined  no longer requires any shareable images or installation
     other  than  those  deemed necessary by system administrators who
     may  install  it  for  purposes  of  better  image activation and
     resource  utilization.   As  distributed, mined comes with source
     and  object files, libraries, and procedure files for re-linking.
     The  sources  distributed  with mined are in the public domain as
     per  George  Williams'  request  and  are  also NOT to be sold or
     marketed in any way, also as per his request.  The sources can be
     built  on  a  variety  of  systems including VMS, Ultrix-32(m,w),
     Ultrix-11,  4.?BSD  UN*X,  SUN UN*X, System V, and most any other
     UN*X  based  operating  system  that  has  a "fully functional" C
     compiler  and  associated  libraries.

        The editor source proper located in the "meditor" directory is
     fully  complete on any UN*X system.  The additional "utils_" area
     and  "h_files" areas are specific to VMS and are there to provide
     as close of a UN*X library environment under VMS with VAX-11 C as
     possible.   Under VMS the various "*.COM" files are used to build
     and  install mined and the utilities areas on a system.  To build
     and  install  everything on VMS get into the MED.SRC area and run
     the  INSTALL_ALL.COM  file.   Under  UN*X  the  "makefile" in the
     "meditor"  source area is used to build and maintain mined.  Also
     in  the "meditor" area is a "changes" file in which editor source
     code changes should be documented for future generations of mined
     users.   A  similar  file  exists  in  the  "utils_" area for VMS
     specific fixes to the utilities sources.  It should be noted that
     under  VMS mined and the utilities use only the VAX-11 C compiler
     with  their  own  "header"  files  located in the "h_files" area.
     George  Williams  designed  the  editor  around  his  own  native
     environment  and opted NOT to tie into the standard VMS C runtime
     environment.   In  the  utilities  subdirectory "gww" are further
     files  and information on how to make a truly shareable utilities
     library  and  hence  shareable  mined under VMS; however, this is
     really only useful for sites with limited amounts of memory.

        In  several  of the modules located in the "utils_" area there
     are two defined values called "ARGCNT" and "ARG_CNT".  This macro
     no  longer  correctly  functions  under VMS.  I fixed the obvious
     places,  primarily  "spawn",  but  left  several  places where it
     should  still  be fixed.  The best suggestion I have is to remove
     it  entirely  from code that references it and change routines to
     pass  NULL  values  in places that were before now left unfilled.
     Look at the file SPAWN.C in the "exec" directory for an example.

        Further  information on how to specify new or unknown to mined
     terminal   types   may  be  obtained  from  any  site  with  UN*X
     documentation   on  termcap.   Under  VMS  mined  will  correctly
     identify  FT1-FT8 assuming that entries exist in the termcap file
     with those names somewhere in the terminal specification line for
     a given terminal.

        I  suggest that in replacing any old versions of mined in use,
     such  as  in going from 3.X to 4.0 all med files be replaced with
     the  new  template  files  provided  and  then customized for the
     installation.   In fact, to be totally safe, it is best to simply
     delete the old mined and all associated files (or at least rename
     them  to  a  temporary  place) and install all the newly provided
     files  and  executable  in the appropriate places.  Above all, be
     sure   to   read  this  new  help  document  provided  with  this
     distribution  for  further  details  on  things like logical name
     assigments, etc..

        I look forward to hearing of mined "war-stories" and receiving
     bug fixed code from people who find it as useful as I do.  I have
     all  the sources under source control at work and can update them
     and re-distribute them whenever the user community sees the need.
     Enjoy!

                                        Ricky Palmer
                                        Digital Equipment Corp.
                                        MK02-1/H10
                                        Continental Blvd.
                                        Merrimack, NH  03054
                                        (603) 884-8385
                                        December 20, 1985
