

me                           Command                           me




MicroEMACS screen editor

mmee [-ee _e_r_r_o_r_f_i_l_e] [_f_i_l_e ...]

me is the command for MicroEMACS, the screen editor for COHERENT.
With  MicroEMACS, you  can insert text,  delete text,  move text,
search  for  a string  and  replace it,  and  perform many  other
editing  tasks.   MicroEMACS reads  text  from  files and  writes
edited text  to files; it can  edit several files simultaneously,
while displaying the contents of each file in its own screen win-
dow.

***** Screen Layout *****

If the command me  is used without arguments, MicroEMACS opens an
empty  buffer.  If  used with  one or  more file  name arguments,
MicroEMACS will  open each  of the  files named, and  display its
contents in a window.  If a file cannot be found, MicroEMACS will
assume that you are creating it for the first time, and create an
appropriately named buffer and file descriptor for it.

The last  line of the  screen is used  to print messages  and in-
quiries.  The  rest of the  screen is portioned into  one or more
windows in which text is displayed.  The last line of each window
shows whether the text has  been changed, the name of the buffer,
and the name of the file associated with the window.

MicroEMACS notes its current position.  It is important to remem-
ber that the  current position is always to the  _l_e_f_t of the cur-
sor, and  lies _b_e_t_w_e_e_n two letters, rather than  at one letter or
another.  For example, if  the cursor is positioned at the letter
`k' of  the phrase ``Mark  Williams'', then the  current position
lies _b_e_t_w_e_e_n the letters `r' and `k'.

***** Commands and Text *****

The printable ASCII characters, from  ` ' to `~', can be inserted
at the current position.  Control characters and escape sequences
are recognized as commands, described below.  A control character
can be inserted into the text by prefixing it with <ctrl-Q> (that
is, hold down the <ccoonnttrrooll> key and type the letter `Q').

There are two types  of commands to remove text.  Delete commands
remove text and throw  it away, whereas kill commands remove text
but save it in  the kill buffer.  Successive kill commands append
text to  the previous kill buffer.  Moving  the cursor before you
kill a line  will empty the kill buffer, and  write the line just
killed into it.

Search commands prompt for a search string terminated by <return>
and then  search for it.   Case sensitivity for  searching can be
toggled with  the command <esc>@.   Typing <return> instead  of a
search string tells MicroEMACS to use the previous search string.



COHERENT Lexicon                                           Page 1




me                           Command                           me



Some   commands   manipulate   words  rather   than   characters.
MicroEMACS defines a word as consisting of all alphabetic charac-
ters, plus  `_' and `$'.  Usually, a character  command is a con-
trol character  and the corresponding  word command is  an escape
sequence.  For example,  <ctrl-F> moves forward one character and
<esc>F moves forward one word.

MicroEMACS  can  handle  blocks of  text  as  well as  individual
characters, words, and lines.  MicroEMACS defines a block of text
as all the text that lies  between the _m_a_r_k and the current posi-
tion of the cursor.   For example, typing <ccttrrll-WW> kills all text
from  the mark  to the  current position of  the cursor;  this is
useful when  moving text from one file to  another.  When you in-
voke MicroEMACS,  the mark is  set at the beginning  of the file;
you can reset the mark to the cursor's current position by typing
<ccttrrll-@>.

***** Using MicroEMACS with the Compiler *****

MicroEMACS can  be invoked automatically by  the compiler command
cc to  help you repair all errors  that occur during compilation.
The -A option to cc causes MicroEMACS to be invoked automatically
when an error  occurs.  The compiler error messages are displayed
in one window, the source code in the other, and the cursor is at
the line on which the first error occurred.  When the text is al-
tered, exiting from MicroEMACS automatically recompiles the file.

This cycle  will continue either until  the file compiles without
error, or  until you break the cycle  by typing <ctrl-U> <ctrl-X>
<ctrl-C>.

The option  -e to the me  command allows you to  invoke the error
buffer by hand.  For example, the commands


        cc myprogram.c 2>errorfile
        me -e errorfile myprogram.c


divert the compiler's error messages into errorfile, and then in-
vokes MicroEMACS to let you correct them interactively.

***** The MicroEMACS Help Facility *****

MicroEMACS has  a built-in help  facility.  With it,  you can ask
for information either for a word that you type in, or for a word
over which  the cursor is  positioned.  The MicroEMACS  help file
contains the  bindings for all  library functions and  macros in-
cluded with COHERENT.

For example, consider that you are preparing a C program and want
more information  about the function fopen.   Type <ccttrrll-XX>?.  At
the bottom of the screen will appear the prompt




COHERENT Lexicon                                           Page 2




me                           Command                           me




        Topic:


Type ffooppeenn.  MicroEMACS will search its help file, find its entry
for fopen, then open a window and print the following:


        Open a stream for standard I/O
        #include <stdio.h>
        FILE *fopen (name, type) char *name, *type;


If you wish, you can kill  the information in the help window and
copy it  into your program, to ensure that  you prepare the func-
tion call correctly.

Consider, however,  that you are checking  a program written ear-
lier, and you wish to check the call for a call to ffooppeenn.  Simply
move the cursor until it is positioned over one of the letters in
ffooppeenn, then  type <eesscc>?.  MicroEMACS will  open its help window,
and show the same information it did above.

To erase the help window, type <ccttrrll-XX>11.

***** Options *****

The  following  list gives  the  MicroEMACS  commands.  They  are
grouped by function,  e.g., _M_o_v_i_n_g _t_h_e _c_u_r_s_o_r.  Some commands can
take an _a_r_g_u_m_e_n_t, which specifies  how often the command is to be
executed.  The  default argument is 1.   The command <ctrl-U> in-
troduces an argument.  By  default, it sets the argument to four.
Typing <ctrl-U>  followed by a  number sets the  argument to that
number.  Typing <ctrl-U> followed by one or more <ctrl-U>s multi-
plies the argument by four.

***** Moving the Cursor *****


<ccttrrll-AA>
        Move to start of line.

<ccttrrll-BB>
        (Back) Move backward by characters.

<eesscc>BB  Move backward by words.

<ccttrrll-EE>
        (End) Move to end of line.

<ccttrrll-FF>
        (Forward) Move forward by characters.

<eesscc>FF  (Forward) Move forward by words.



COHERENT Lexicon                                           Page 3




me                           Command                           me



<eesscc>GG  Go to an absolute line  number in a file.  Same as <ccttrrll-
        XX>GG.

<ccttrrll-NN>
        (Next) Move to next line.

<ccttrrll-PP>
        (Previous) Move to previous line.

<ccttrrll-VV>
        Move forward by pages.

<eesscc>VV  Move backward by pages.

<ccttrrll-XX>=
        Print the current position.

<ccttrrll-XX>GG
        Go to  an absolute  line number in  a file.  Can  be used
        with an  argument; otherwise, it  will prompt for  a line
        number.  Same as <eesscc>GG.

<ccttrrll-XX>[
        Go to  matching C delimiter.  For  example, if the cursor
        is positioned under the character `{', then typing <ccttrrll-
        XX>[ moves  the cursor to the next  `}'.  Likewise, if the
        cursor is  positioned under the character  }, then typing
        <ccttrrll-XX>[ moves  the cursor  to the first  preceding `{'.
        MicroEMACS recognizes  the delimiters [,  ], {, },  (, ),
        /*, and */.

<ccttrrll-XX>]
        Toggle  reverse-video display  of matching  C delimiters.
        For example,  if reverse-video displaying  is toggled on,
        then  whenever  the  cursor  is  positioned under  a  `}'
        MicroEMACS  displays the first  preceding '{'  in reverse
        video (should  it be  on the screen).   MicroEMACS recog-
        nizes the delimiters [, ], {, }, (, ), /*, and */.

<eesscc>!  Move the current line to the line within the window given
        by argument;  the position  is in  lines from the  top if
        positive, in  lines from the bottom  if negative, and the
        center of the window if zero.

<eesscc><  Move to the beginning of the current buffer.

<eesscc>>  Move to the end of the current buffer.

***** Killing and Deleting *****


<ccttrrll-DD>
        (Delete) Delete next character.




COHERENT Lexicon                                           Page 4




me                           Command                           me



<eesscc>DD  Kill the next word.

<ccttrrll-HH>
        If  no argument,  delete previous  character.  Otherwise,
        kill argument previous characters.

<ccttrrll-KK>
        (Kill) With  no argument,  kill from current  position to
        end of line; if at the end, kill the newline.  With argu-
        ment set  to one, kill from beginning  of line to current
        position.   Otherwise, kill  argument  lines forward  (if
        positive) or backward (if negative).

<ccttrrll-WW>
        Kill text from current position to mark.

<ccttrrll-XX><ccttrrll-OO>
        Kill blank lines at current position.

<ccttrrll-YY>
        (Yank back) Copy the kill buffer into text at the current
        position;  set current  position to  the  end of  the new
        text.

<eesscc><ccttrrll-HH>
        Kill the previous word.

<eesscc><DDEELL>
        Kill the previous word.

<DDEELL>   If  no argument,  delete the previous  character.  Other-
        wise, kill argument previous characters.

***** Windows *****


<ccttrrll-XX>11
        Display only the current window.

<ccttrrll-XX>22
        Split the current  window into two windows.  This command
        is usually followed by <ctrl-X>B or <ctrl-X><ctrl-V>.

<ccttrrll-XX>NN
        (Next) Move to next window.

<ccttrrll-XX>PP
        (Previous) Move to previous window.

<ccttrrll-XX>ZZ
        Enlarge the current window by argument lines.

<ccttrrll-XX><ccttrrll-NN>
        Move text in current window down by argument lines.



COHERENT Lexicon                                           Page 5




me                           Command                           me



<ccttrrll-XX><ccttrrll-PP>
        Move text in current window up by argument lines.

<ccttrrll-XX><ccttrrll-ZZ>
        Shrink current window by argument lines.

***** Buffers *****


<ccttrrll-XX>BB
        (Buffer) Prompt for a buffer name, and display the buffer
        in the current window.

<ccttrrll-XX>KK
        (Kill) Prompt for a buffer name and delete it.

<ccttrrll-XX><ccttrrll-BB>
        Display a  window showing  the change flag,  size, buffer
        name, and file name of each buffer.

<ccttrrll-XX><ccttrrll-FF>
        (File name) Prompt for a file name for current buffer.

<ccttrrll-XX><ccttrrll-RR>
        (Read) Prompt for a file name, delete current buffer, and
        read the file.

<ccttrrll-XX><ccttrrll-VV>
        (Visit) Prompt  for a file  name and display  the file in
        the current window.

***** Saving Text and Exiting *****


<ccttrrll-XX><ccttrrll-CC>
        Exit without saving text.

<ccttrrll-XX><ccttrrll-SS>
        (Save) Save current buffer to the associated file.

<ccttrrll-XX><ccttrrll-WW>
        (Write)  Prompt for  a file  name  and write  the current
        buffer to it.

<ccttrrll-ZZ>
        Save current buffer to associated file and exit.

***** Compilation Error Handling *****


<ccttrrll-XX>>
        Move to next error.

<ccttrrll-XX><
        Move to previous error.


COHERENT Lexicon                                           Page 6




me                           Command                           me




***** Search and Replace *****


<ccttrrll-RR>
        (Reverse)  Incremental  search  backward;  a  pattern  is
        sought as each character is typed.

<eesscc>RR  (Reverse) Search toward the beginning of the file.  Waits
        for entire pattern before search begins.

<ccttrrll-SS>
        (Search)  Incremental search forward; a pattern is sought
        as each character is typed.

<eesscc>SS  (Search)  Search toward the  end of the  file.  Waits for
        entire pattern before search begins.

<eesscc>%  Search and  replace.  Prompt for two strings; then search
        for the first string and replace it with the second.

<eesscc>/  Search  for next occurrence of a  string entered with the
        <eesscc>SS  or <eesscc>RR  commands; this  remembers  whether the
        previous search had been forward or backward.

<eesscc>@  Toggle case  sensitivity for searches.  By default, sear-
        ches are case insensitive.

***** Keyboard Macros *****


<ccttrrll-XX>(
        Begin a macro definition.  MicroEMACS collects everything
        typed  until the next  <ccttrrll-XX>) for  subsequent repeated
        execution.  <ctrl-G> breaks the definition.

<ccttrrll-XX>)
        End a macro definition.

<ccttrrll-XX>EE
        (Execute) Execute the keyboard macro.

<ccttrrll-XX>MM
        Bind current macro to a name.

***** Change Case of Text *****


<eesscc>CC  (Capitalize) Capitalize the next word.

<ccttrrll-XX><ccttrrll-LL>
        (Lower) Convert  all text  from current position  to mark
        into lower case.




COHERENT Lexicon                                           Page 7




me                           Command                           me



<eesscc>LL  (Lower) Convert the next word to lower case.

<ccttrrll-XX><ccttrrll-UU>
        (Upper) Convert  all text  from current position  to mark
        into upper case.

<eesscc>UU  (Upper) Convert the next word to upper case.

***** White Space *****


<ccttrrll-II>
        Insert a tab.

<ccttrrll-JJ>
        Insert a  new line and indent to  current level.  This is
        often used in C programs to preserve the current level of
        indentation.

<ccttrrll-MM>
        (Return) If the following line is not empty, insert a new
        line; if empty, move to next line.

<ccttrrll-OO>
        Open a blank line; that is, insert newline after the cur-
        rent position.

<ttaabb>   With  argument, set tab fields  at every _a_r_g_u_m_e_n_t charac-
        ters.  An argument  of zero restores the default of eight
        characters.  Setting the  tab to any character other than
        eight causes space characters  to be set in your file in-
        stead of tab characters.

***** Send Commands to Operating System *****


<ccttrrll-CC>
        Suspend MicroEMACS and execute a subshell.  Typing <ccttrrll-
        DD>  returns you  to MicroEMACS and  allows you  to resume
        editing.

<ccttrrll-XX>!
        Prompt for a shell command and execute it.

These commands  recognize the  shell variable SHELL  to determine
the shell to which it should pass the command.

***** Setting the Mark *****


<ccttrrll-@>
        Set mark at current position.

<eesscc>.  Set mark at current position.



COHERENT Lexicon                                           Page 8




me                           Command                           me



<ccttrrll><ssppaaccee>
        Set mark at current position.

***** Help Window *****


<ccttrrll-XX>?
        Prompt for word for which information is needed.

<eesscc>?  Search for word over which cursor is positioned.

<eesscc>22  Erase help window.

***** Miscellaneous *****


<ccttrrll-GG>
        Abort a command.

<ccttrrll-LL>
        Redraw the screen.

<ccttrrll-QQ>
        (Quote) Insert the  next character into text; used to in-
        sert control characters.

<eesscc>QQ  (Quote) Insert  the next control character into the text.
        Same as <ctrl-Q>.

<ccttrrll-TT>
        Transpose  the characters  before and  after  the current
        position.

<ccttrrll-UU>
        Specify a numeric argument, as described above.

<ccttrrll-UU><ccttrrll-XX><ccttrrll-CC>
        Abort  editing and re-compilation.   Use this  command to
        abort editing  and return to COHERENT  when you are using
        the -AA option to the cccc command.

<ccttrrll-XX>HH
        Use word-wrap on a region.

<ccttrrll-XX>FF
        Set word  wrap to _a_r_g_u_m_e_n_t  column.  If argument  is one,
        set word wrap to cursor's current position.

<ccttrrll-XX><ccttrrll-XX>
        Mark the current position, then jump to the previous set-
        ting of  the mark.  This is useful  when moving text from
        one place in a file to another.





COHERENT Lexicon                                           Page 9




me                           Command                           me



***** Diagnostics *****

MicroEMACS  prints  error  messages on  the  bottom  line of  the
screen.   It prints  informational messages  (enclosed  in square
brackets `[' and `]'  to distinguish them from error messages) in
the same place.

MicroEMACS manipulates text in memory rather than in a file.  The
file  on disk  is not  changed  until you  save the  edited text.
MicroEMACS prints  a warning and  prompts you whenever  a command
would cause it to lose changed text.

***** See Also *****

commands, ed, sed

***** Notes *****

Because MicroEMACS keeps text in memory, it does not work for ex-
tremely large files.  It prints an error message if a file is too
large to edit.  If this happens when you first invoke a file, you
should exit from the editor immediately.  Otherwise, your file on
disk  will be  truncated.  If  this happens in  the middle  of an
editing session,  however, delete  text until the  message disap-
pears, then  save your file and exit.  Due  to the way MicroEMACS
works, saving  a file after this error  message has appeared will
take more time than usual.

This  version  of MicroEMACS  does  not  include many  facilities
available in the original EMACS display editor, which was written
by Richard Stallman at M.I.T.  In particular, it does not include
user-defined commands or pattern search commands.

Please note,  too, that MicroEMACS has a  number of features that
could not  be documented due to time  pressure during the produc-
tion of this manual.  We suggest that you consult the source code
for  MicroEMACS, which  is  included with  COHERENT,  for a  full
description of all that MicroEMACS can do.

The  current version  of  MicroEMACS, including  source code,  is
proprietary to Mark Williams Company.  The code may be altered or
otherwise changed  for your personal use, but it  may not be used
for commercial  purposes, and it  may not be  distributed without
prior written consent by Mark Williams Company.

MicroEMACS is  based upon  the public  domain editor by  David G.
Conroy.










COHERENT Lexicon                                          Page 10


