
                      MicroEMACS 3.9 Screen Editor

                written by Dave Conroy and Daniel Lawrence
                  un-nroffed and updated by Tony Bamford


        This software is in the public domain and may  be  freely  copied
        and  used by one and all. We would ask that if it is incorporated
        into other software that proper credit be given to its authors.

        MicroEMACS 3.9 is  a  screen  editor  for  programming  and  word
        processing.   It is availible for the IBM-PC and its clones, UNIX
        V7, UNIX BSD4.2, UNIX V5, VMS, the HP150,  the  Wang-PC  and  the
        Commodore  AMIGA.   It requires between 40 to 70K of space to run
        on these machines. Some of  its  capabilities  include:
        
        - Multiple windows on screen at one time

        - Multiple files in the editor at once

        - Limited on screen formating of text

        - User changable command set

        - User written editing macroes

        Compatability across all supported environments  This  manual  is
        designed  as  a  reference manual. All the commands in MicroEMACS
        are  listed,  in   functional   groups,   along   with   detailed
        descriptions of what each commands does.

        MicroEMACS is invoked from the  operating  system  command  level
        with a command of the form:
        
        emacs {options} <filelist>

        where options may be:
	-a	     Process error file, run error.cmd.
	-c	     Turn off signal catching (UNIX).
        -e           all the following files can be edited
        -g<n>        go directly to line <n> of the first file
        +<n>	     go directly to line <n> of the first file
	-k<str>	     Encryption key.
	-m<mode>     Set mode
	-r	     Restricted mode
        -s<string>   go to the end of the first occurance of <string>  in
                     the first file
	-t<tag>	     Seatch for tag tag.
        -v           all the following files are in view mode (read only)
	-x	     eXplain
        @@<sfile>    execute macro file <sfile> instead of  the  standard
                     startup file

        and <filelist> is a list of files to  be  edited.
        
        for  example:
        
             emacs  @@start1.cmd  -g56  test.c  -v head.h def.h
        
        means to  first execute  macro  file start1.cmd  instead  of  the
        standard startup file, emacs.rc and then read in test.c, position
        the cursor to line 56,  and be ready to read in files  head.h and
        def.h  in  view (read-only) mode.  In the simple case, MicroEMACS
        is usually run by typing:
        
       		           emacs <file>
       		           
        where <file> is the name of the file to be edited.

        Most  commands  in  MicroEMACS  are  a  single  keystroke,  or  a
        keystroke  preceded by a command prefix.  Control commands appear
        in the documentation like ^A which means to  depress  the  <Ctrl>
        key  and while holding down it down, type the A character.
        
        Meta  commands appear as M-A  which  means to strike the Meta key
        (<ESC> on most computers) and then after  realeasing it, type the
        "A" character.   Control-X commands  usually appear as ^X-A which
        means to hold  down the control key and type the X character then
        type the A character.
        
        Both  meta  commands  and  control-x  commands   can  be  control
        characters  as well,  for example, ^X-^O  (the delete-blank-lines
        command) means to hold  down  <Ctrl>, type  X,  keep holding down
        <Ctrl> and type the O character.
        
        Many commands in MicroEMACS can be executed a number of times. In
        order to  make one command  repeat  many times, type Meta (<ESC>)
        followed by a number, and then the command. for example:
        
                                    M-12 ^K
                              
        will delete  12 lines starting  at  the  cursor  and  going down.
        Sometimes, the repeat count is used as an argument to the command
        as  in  the set-tab command where the repeat count is used to set
        the spacing of the tab stops.

        The following is a list of all the commands in MicroEMACS. Listed
        is  the  command  name,  the  default (normal) keystrokes used to
        invoke it, and alternative keys for the IBM-PC, and a description
        of what the command does.

             ^Z        <Pg Up>

        Move one screen towards the begining of the file.

             ^V        <Pg Dn>

        Move one screen towards the end of the file.

             M-<       <Home>

        Place the cursor at the begining of the file.

             M->       <End>

        Place the cursor at the end of the file.

            ^F        (6 on the keypad)

        Move the cursor one character to  the  right.   Go  down  to  the
        begining of the next line if the cursor was already at the end of
        the current line.

            ^B        (4 on the keypad)

        Move the cursor one character to the left.  Go to the end of  the
        previous  line  if  the cursor was at the begining of the current
        line.

            M-F       (^6 on the keypad)

        Place the cursor at the begining of the next word.

            M-B       (^4 on the keypad)

        Place the cursor at the begining of the previous word.

            ^A

        Move cursor to the begining of the current line.

            ^E

        Move the cursor to the end of the current line.

            ^N        (2 on the keypad)

        Move the cursor down one line.

            ^P        (8 on the keypad)

        Move the cursor up one line.

            M-G

        Goto a  specific  line in  the  file, ie M-65 M-G (that is ESC 65
        ESC G) would  put the  cursor  on  the 65th  line of the  current
        buffer.

            M-N

        Put the cursor at the first end of paragraph after the cursor.

            M-P

        Put the cursor at the first  begining  of  paragraph  before  the
        cursor.

            ^H        <--

        Delete the character immedietly to the left of  the  cursor.   If
        the  cursor  is  at  the  begining  of a line, this will join the
        current line on the end of the previous one.

            ^D        <Del>

        Delete the character the cursor is on.  If the cursor is  at  the
        end  of  a  line,  the next line is put at the end of the current
        one.

            M-^H      M- <--

        Delete the word before the cursor.

             M-^D

        Delete the word starting at the cursor.

             ^K

        When used with no argument, this command deletes  all  text  from
        the  cursor  to the end of a line.  When used on a blank line, it
        deletes the blank line.  When used with an argument,  it  deletes
        the specified number of lines.

              ^C        <Ins>

        Insert a space before the character the cursor is on.

              <return>

        Insert a newline into the text,  move  the  cursor  down  to  the
        begining  of  the  next physical line, carrying any text that was
        after it with it.

           ^J

        Insert a newline into the text, and indent the new line the  same
        as the previous line.

           ^I        -->

        With no argument, move the cursor to the begining of the next tab
        stop.   With  an  argument  of zero, use real tab characters when
        tabbing.  With a non-zero  argument,  use  spaces  to  tab  every
        argument positions.

           ^X-^O

        Delete all the blank lines before and after  the  current  cursor
        position.

           M-^W

        Delete the paragraph that the cursor is currently in.

           ^W

        Delete all the characters from the cursor to the  mark  set  with
        the set-mark command.

           M-W

        Copy all the characters between the cursor and the mark set  with
        the  set-mark  command into the kill buffer (so they can later be
        yanked elsewhere).

           ^O

        Insert a newline at the cursor, but do not move the cursor.

           ^S

        Search for a string from the current cursor position to  the  end
        of  the  file.   The string is typed on on the bottom line of the
        screen, and terminated with the <ESC> key. Special characters can
        be typed in by preceeding them with a ^V. A single ^V indicates a
        null string.  On successive searches, hitting <ESC> alone  causes
        the last search string to be reused.

           ^X/

        This command is similar to forward-search, but it  processes  the
        search  as  each  character of the input string is typed in. This
        allows the user to only use as many keystrokes as are  needed  to
        uniquely  specify  the  string  being  searched.  Several control
        characters are active while isearching:

           ^S or ^X   Skip to the next occurence of the current string
           ^R         skip to the last occurence of the current string
           ^H         back up to the last match (posibly deleting  the
                      last character on the search string)
           ^G         abort the search, return to start
           <ESC>      end the search, stay here


           ^R

        This command is the same as incremental-search, but it starts  in
        the reverse direction.


           M-^R

        This  command  interactively  replaces  one string  with another.
        The following answers are allowed:

            Y    Make the replacement and continue on to the next string
            N    Don't make the replacement, then continue
            !    Replace the rest of the strings without asking
            ^G   Stop the command
            .    Go back to place the command started
            ?    Get a list of options


           M-U

        Change the following word into upper case.


           M-C

        Capitolize the following word.

           M-L

        Change the following word to lower case.

           ^X-^U

        Change all the alphabetic characters in a marked region to  upper
        case.

           ^X-^L

        Change all the alphabetic characters in a marked region to  lower
        case.


           ^T

        Swap the last and second last characters behind the cursor.

           ^Q	    M-Q

        Insert the next typed character, ignoring the fact that it may be
        a command character.

           M-<SPACE>

        This command is used to delimit the begining of a marked  region.
        Many  commands  are  effective for a region of text.  A region is
        defined as the text between  the  mark  and  the  current  cursor
        position.   To  delete  a section of text, for example, one moves
        the cursor to the begining of the text to be deleted, issues  the
        set-mark command by typing M-<SPACE>, moves the cursor to the end
        of the text to be deleted, and  then  deletes  it  by  using  the
        kill-region (^W) command.  Only one mark can be set in one window
        or one buffer at a time, and MicroEMACS will try  to  remember  a
        mark set in an offscreen buffer when it is called back on screen.

           ^X-^X

        This command moves the cursor to the current marked  position  in
        the  current  window  and moves the mark to where the cursor was.
        This is very usefull in finding where a mark was, or in returning
        to a position previously marked.

           ^W

        This command is used to copy the current region  (as  defined  by
        the current mark and the cursor) into the kill buffer.

           ^Y

        This copies the contents of the kill buffer into the text at  the
        current  cursor  position.   This does not clear the kill buffer,
        and thus may be used to make multiple  copies  of  a  section  of
        text.

           M-W

        This command copies the contents of the current region  into  the
        kill buffer without deleting it from the current buffer.

           ^X-M

        Add a mode to the current buffer

           ^X-^M

        Delete a mode from the current buffer

           M-M

        Add a mode to the global modes which get  inherited  by  any  new
        buffers that are created while editing.

           M-^M

        Delete a mode from the global  mode  list.   This  mode  list  is
        displayed  as  the first line in the output produced by the list-
        buffers command.

        Modes are assigned to all buffers that exist  during  an  editing
        session.   These  modes  effect the way text is inserted, and the
        operation of some commands. Legal modes are:

                         Overwrite Mode

        In this mode, typed characters replace existing characters rather
        than  being  inserted into existing lines.  Newlines still insert
        themselves, but all other characters  will  write  over  existing
        characters  on  the current line being edited.  This mode is very
        usefull for editing charts, figures, and tables.

                         Word Wrap Mode

        In this mode, when the cursor crosses  the  current  fill  column
        (which   defaults   to  72)  it  will,  at  the  next  wordbreak,
        automatically insert a newline, dragging the last word down  with
        it.   This  makes  typing  prose  much  easier  since the newline
        (<RETURN>) only needs to be used between paragraphs.

                         File Viewing Mode

        In this mode, no commands which can change the text are allowed.

                        C Program Editing Mode

        This mode is for editing programs written in the 'C'  programming
        language.   When  the newline is used, the editor will attempt to
        place the cursor at the proper  indentation  level  on  the  next
        line.   Close braces are automatically undented for the user, and
        also pre-processor commands are automatically set flush with  the
        left  margin.  When a close parenthesis or brace is typed, if the
        matching open is on screen, the cursor briefly moves to  it,  and
        then  back.  (Typing  any  key  will  abort  this fence matching,
        executing the next command immediatly)

                         Exact Case Matching on Searching MODE

        Normally  case  is  insignificant  during  the   various   search
        commands.   This  forces all matching to take character case into
        account.

                         Regular expresion pattern matching Mode

        This feature is not yet implimented.  While it may be  set  as  a
        mode, it will have no effect at the moment.  When it is ready, it
        will  cause  all  search  commands  to  accept  various   pattern
        characters to allow regular exspression search and replaces.

           ^X-F

        Sets the column used by WRAP mode and the fill-paragraph command.

           Mn-<TAB>

        Given a numeric argument, the tab key resets the normal  behavior
        of  the  tab  key.   An  argument  of  zero causes the tab key to
        generate hardware tabs (at each 8 columns).  A non-zero  argument
        will  cause  the  tab  key  to  generate enough spaces to reach a
        culumn of a multiple of the argument given.  This also resets the
        spacing used while in CMODE.

           ^X-=

        This  command  reports  on  the  current  and  total  lines   and
        characters  of the current buffer.  It also gives the hexidecimal
        code of the character currently under the cursor.

           ^X-2

        If possible, this command splits the current window into two near
        equal  windows,  each  displaying  the  buffer  displayed  by the
        original window. A numeric argument of 1 forces the upper  window
        to  be  the  new  current window, and an argument of 2 forces the
        lower window to be the new current window.

           ^X-0

        this command attempts to delete the  current  window,  retrieving
        the lines for use in the window above or below it.

           ^X-1

        All other windows are  deleted  by  this  command.   The  current
        window  becomes  the  only  window,  using  the  entire availible
        screen.

           ^X-O

        Make the next window down the current window.  With an  argument,
        this makes the nth window from the top current.

           ^X-P

        Make the next window up the current window.   With  an  argument,
        this makes tghe nth window from the bottom the current window.

           M-^V

        Scroll the next window down a page.

           M-^Z

        Scroll the next window up a page.

           ^X-^

        Enlarge the current window by the argument number of lines (1  by
        default).

           ^X-^Z

        Shrink the current window by the argument number of lines  (1  by
        default).

           ^X-W

        Change the size of the current window  to  the  number  of  lines
        specified by the argument, if possible.

           ^X-^N

        Move the window into the current buffer down by one line.

           ^X-^P

        Move the window into the current buffer up by one line.

           M-^L

        Redraw the current window with the current line in the middle  of
        the window, of with an argument, with the current line on the nth
        line of the current window.

           ^L

        Clear the screen and  redraw  the  entire  display.   Usefull  on
        timesharing  systems  where messages and other things can garbage
        the display.

           ^X-B

        Switch to using another buffer in the current window.  MicroEMACS
        will prompt you for the name of the buffer to use.

           ^X-X

        Switch to using the next buffer in the buffer list in the current
        window.

           M-^N

        Change the name of the current buffer.

           ^X-K

        Dispose of an undisplayed buffer in the editor  and  reclaim  the
        space. This does not delete the file the buffer was read from.

           ^X-^B

        Split the current window and in one half bring up a list  of  all
        the  buffers currently existing in the editor.  The active modes,
        change flag, and active flag for each buffer is  also  displayed.
        (The  change  flag is an * if the buffer has been changed and not
        written out.  the active flag is not an * if the  file  had  been
        specified on the command line, but has not been read in yet since
        nothing has switched to that buffer.)

           ^X-^F

        Find the named file. If it is already  in  a  buffer,  make  that
        buffer  active in the current window, otherwise attemt tocreate a
        new buffer and read the file into it.

           ^X-^R

        Read the named file into  the  current  buffer  (overwriting  the
        previous  contents  of  the current buffer. If the change flag is
        set, a confirmation will be asked).

           ^X-^I

        Insert the named file into the current position  of  the  current
        buffer.

           ^X-^V

        Like find-file, this command either finds the file in  a  buffer,
        or  creates a new buffer and reads the file in. In addition, this
        leaves that buffer in VIEW mode.

           ^X-^S

        If the contents of the current buffer have been changed, write it
        back to the file it was read from.

           ^X-^W

        Write the contents of the current file to the  named  file,  this
        also  changed the file name associated with the current buffer to
        the new file name.

           ^X-N

        Change the name associated with the current buffer  to  the  file
        name given.

           M-Z

        Write out all changed buffers to the files they  were  read  from
        and exit the editor.

           ^X-!

        Send one command to  execute  to  the  operating  system  command
        processor, or shell.  Upon completion, MicroEMACS will wait for a
        keystroke to redraw the screen.

           ^X-@

        Execute one operating  system  command  and  pipe  the  resulting
        output into a buffer by the name of "command".

          ^X-#

        Execute one operating system command, using the contents  of  the
        current buffer as input, and sending the results back to the same
        buffer, replacing the original text.

           ^X-C

        Push up to a new command processor or shell.   Upon  exiting  the
        shell, MicroEMACS will redraw its screen and continue editing.

           ^X-^C

        Exit MicroEMACS back to the operating system.  If there  are  any
        unwritten,  changed  buffers,  the  editor  will promt to discard
        changes.

           M-K

        This command takes one of the named commands and binds  it  to  a
        key.   From  then  on,  whenever  that  key  is struck, the bound
        command is executed.

           M-^K

        This unbinds a command from a key.

           ^X-?

        This command will allow you to type a key and it will then report
        the name of the command bound to that key.

           M-X

        This command will prompt  you  for  the  name  of  a  command  to
        execute.  Typing <SPACE> part way thought will tell the editor to
        attempt to complete the name on its own.  If it then beeps, there
        is no such command to complete. You will have to type <return> to
        execute  the command,  this gives  you the chance to interrupt if
        the expansion you got was halt-and-set-fire-to-machine.

           UNBOUND        M-X describe-bindings

        This command splits the current window, and in one of the windows
        makes  a  list  of all the named commands, and the keys currently
        bound to them.

        Commands can also be executed as command  scripts.   This  allows
        comands  and  their arguments to be stored in files and executed.
        The general form of a command script line  is:
        
           <optional repeat count> {command-name} <optional arguments>


           UNBOUND        M-X execute-buffer

        Executes script lines in the named buffer.  If the buffer is  off
        screen  and  an error occurs during execution, the cursor will be
        left on the line causing the error.

           UNBOUND        M-X execute-file

        Executes script lines from a file.  This is  the  normal  way  to
        execute a special script.

           UNBOUND        M-X

        Clears the message line during script execution.  This is usefull
        so  as not to leave a confusion message from the last commands in
        a script.

           M-~

        Remove the change flag from the current  buffer.   This  is  very
        usefull in scripts where you are creating help windows, and don't
        want MicroEMACS to complain about not saving them to a file.

           UNBOUND        M-X insert-string

        Insert a string into the current  buffer.   This  allows  you  to
        build  up text within a buffer without reading it in from a file.
        Some special characters are allowed, as follows:

         ~n   newline
         ~t   tab
         ~b   backspace
         ~f   formfeed

        Also availible is one keyboard macro, which allows you to  record
        a number of commands as they are executed and play them back.

           ^X (

        Start recording keyboard macro

           ^X )

        Stop recording keyboard macro

           ^X E

        Execute  keyboard  macro.  Keyboard  macros  are  one of the most
        powerful  features  of emacs,  and  it  is  well  worth  becoming
        familiar with them.

           UNBOUND        M-X store-macro

        This command is used to store script lines in a hiffen buffer  by
        the  name of "[Macro nn]" where <nn> is a number from 1 to 40 and
        coresponds to the argument given this command.  All script  lines
        then  encountered will be stored in this buffer rather than being
        executed.  A script line consisting of  only  "[end]"  tells  the
        editor  that  the  macro  is complete, and stops recording script
        lines in the buffer.

           UNBOUND        [shift-<F1> thru shift-<F10>]

        This is the command to execute a script  stored  in  one  of  the
        hidden  macro  buffers.  On the IBM-PC the first ten of these are
        bound to shift-<F1> thru shift-<F10>.
