|
|
coherent
me Command me
MicroEMACS screen editor
mmee [-ee _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 <ccoonnttrrooll> 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 <ccttrrll-WW> 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
<ccttrrll-@>.
***** 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 <ccttrrll-XX>?. At
the bottom of the screen will appear the prompt
COHERENT Lexicon Page 2
me Command me
Topic:
Type ffooppeenn. 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 ffooppeenn. Simply
move the cursor until it is positioned over one of the letters in
ffooppeenn, then type <eesscc>?. MicroEMACS will open its help window,
and show the same information it did above.
To erase the help window, type <ccttrrll-XX>11.
***** 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 *****
<ccttrrll-AA>
Move to start of line.
<ccttrrll-BB>
(Back) Move backward by characters.
<eesscc>BB Move backward by words.
<ccttrrll-EE>
(End) Move to end of line.
<ccttrrll-FF>
(Forward) Move forward by characters.
<eesscc>FF (Forward) Move forward by words.
COHERENT Lexicon Page 3
me Command me
<eesscc>GG Go to an absolute line number in a file. Same as <ccttrrll-
XX>GG.
<ccttrrll-NN>
(Next) Move to next line.
<ccttrrll-PP>
(Previous) Move to previous line.
<ccttrrll-VV>
Move forward by pages.
<eesscc>VV Move backward by pages.
<ccttrrll-XX>=
Print the current position.
<ccttrrll-XX>GG
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 <eesscc>GG.
<ccttrrll-XX>[
Go to matching C delimiter. For example, if the cursor
is positioned under the character `{', then typing <ccttrrll-
XX>[ moves the cursor to the next `}'. Likewise, if the
cursor is positioned under the character }, then typing
<ccttrrll-XX>[ moves the cursor to the first preceding `{'.
MicroEMACS recognizes the delimiters [, ], {, }, (, ),
/*, and */.
<ccttrrll-XX>]
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 */.
<eesscc>! 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.
<eesscc>< Move to the beginning of the current buffer.
<eesscc>> Move to the end of the current buffer.
***** Killing and Deleting *****
<ccttrrll-DD>
(Delete) Delete next character.
COHERENT Lexicon Page 4
me Command me
<eesscc>DD Kill the next word.
<ccttrrll-HH>
If no argument, delete previous character. Otherwise,
kill argument previous characters.
<ccttrrll-KK>
(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).
<ccttrrll-WW>
Kill text from current position to mark.
<ccttrrll-XX><ccttrrll-OO>
Kill blank lines at current position.
<ccttrrll-YY>
(Yank back) Copy the kill buffer into text at the current
position; set current position to the end of the new
text.
<eesscc><ccttrrll-HH>
Kill the previous word.
<eesscc><DDEELL>
Kill the previous word.
<DDEELL> If no argument, delete the previous character. Other-
wise, kill argument previous characters.
***** Windows *****
<ccttrrll-XX>11
Display only the current window.
<ccttrrll-XX>22
Split the current window into two windows. This command
is usually followed by <ctrl-X>B or <ctrl-X><ctrl-V>.
<ccttrrll-XX>NN
(Next) Move to next window.
<ccttrrll-XX>PP
(Previous) Move to previous window.
<ccttrrll-XX>ZZ
Enlarge the current window by argument lines.
<ccttrrll-XX><ccttrrll-NN>
Move text in current window down by argument lines.
COHERENT Lexicon Page 5
me Command me
<ccttrrll-XX><ccttrrll-PP>
Move text in current window up by argument lines.
<ccttrrll-XX><ccttrrll-ZZ>
Shrink current window by argument lines.
***** Buffers *****
<ccttrrll-XX>BB
(Buffer) Prompt for a buffer name, and display the buffer
in the current window.
<ccttrrll-XX>KK
(Kill) Prompt for a buffer name and delete it.
<ccttrrll-XX><ccttrrll-BB>
Display a window showing the change flag, size, buffer
name, and file name of each buffer.
<ccttrrll-XX><ccttrrll-FF>
(File name) Prompt for a file name for current buffer.
<ccttrrll-XX><ccttrrll-RR>
(Read) Prompt for a file name, delete current buffer, and
read the file.
<ccttrrll-XX><ccttrrll-VV>
(Visit) Prompt for a file name and display the file in
the current window.
***** Saving Text and Exiting *****
<ccttrrll-XX><ccttrrll-CC>
Exit without saving text.
<ccttrrll-XX><ccttrrll-SS>
(Save) Save current buffer to the associated file.
<ccttrrll-XX><ccttrrll-WW>
(Write) Prompt for a file name and write the current
buffer to it.
<ccttrrll-ZZ>
Save current buffer to associated file and exit.
***** Compilation Error Handling *****
<ccttrrll-XX>>
Move to next error.
<ccttrrll-XX><
Move to previous error.
COHERENT Lexicon Page 6
me Command me
***** Search and Replace *****
<ccttrrll-RR>
(Reverse) Incremental search backward; a pattern is
sought as each character is typed.
<eesscc>RR (Reverse) Search toward the beginning of the file. Waits
for entire pattern before search begins.
<ccttrrll-SS>
(Search) Incremental search forward; a pattern is sought
as each character is typed.
<eesscc>SS (Search) Search toward the end of the file. Waits for
entire pattern before search begins.
<eesscc>% Search and replace. Prompt for two strings; then search
for the first string and replace it with the second.
<eesscc>/ Search for next occurrence of a string entered with the
<eesscc>SS or <eesscc>RR commands; this remembers whether the
previous search had been forward or backward.
<eesscc>@ Toggle case sensitivity for searches. By default, sear-
ches are case insensitive.
***** Keyboard Macros *****
<ccttrrll-XX>(
Begin a macro definition. MicroEMACS collects everything
typed until the next <ccttrrll-XX>) for subsequent repeated
execution. <ctrl-G> breaks the definition.
<ccttrrll-XX>)
End a macro definition.
<ccttrrll-XX>EE
(Execute) Execute the keyboard macro.
<ccttrrll-XX>MM
Bind current macro to a name.
***** Change Case of Text *****
<eesscc>CC (Capitalize) Capitalize the next word.
<ccttrrll-XX><ccttrrll-LL>
(Lower) Convert all text from current position to mark
into lower case.
COHERENT Lexicon Page 7
me Command me
<eesscc>LL (Lower) Convert the next word to lower case.
<ccttrrll-XX><ccttrrll-UU>
(Upper) Convert all text from current position to mark
into upper case.
<eesscc>UU (Upper) Convert the next word to upper case.
***** White Space *****
<ccttrrll-II>
Insert a tab.
<ccttrrll-JJ>
Insert a new line and indent to current level. This is
often used in C programs to preserve the current level of
indentation.
<ccttrrll-MM>
(Return) If the following line is not empty, insert a new
line; if empty, move to next line.
<ccttrrll-OO>
Open a blank line; that is, insert newline after the cur-
rent position.
<ttaabb> 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 *****
<ccttrrll-CC>
Suspend MicroEMACS and execute a subshell. Typing <ccttrrll-
DD> returns you to MicroEMACS and allows you to resume
editing.
<ccttrrll-XX>!
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 *****
<ccttrrll-@>
Set mark at current position.
<eesscc>. Set mark at current position.
COHERENT Lexicon Page 8
me Command me
<ccttrrll><ssppaaccee>
Set mark at current position.
***** Help Window *****
<ccttrrll-XX>?
Prompt for word for which information is needed.
<eesscc>? Search for word over which cursor is positioned.
<eesscc>22 Erase help window.
***** Miscellaneous *****
<ccttrrll-GG>
Abort a command.
<ccttrrll-LL>
Redraw the screen.
<ccttrrll-QQ>
(Quote) Insert the next character into text; used to in-
sert control characters.
<eesscc>QQ (Quote) Insert the next control character into the text.
Same as <ctrl-Q>.
<ccttrrll-TT>
Transpose the characters before and after the current
position.
<ccttrrll-UU>
Specify a numeric argument, as described above.
<ccttrrll-UU><ccttrrll-XX><ccttrrll-CC>
Abort editing and re-compilation. Use this command to
abort editing and return to COHERENT when you are using
the -AA option to the cccc command.
<ccttrrll-XX>HH
Use word-wrap on a region.
<ccttrrll-XX>FF
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.
<ccttrrll-XX><ccttrrll-XX>
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
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.