Content-type: text/html Man page of EM


Section: User Commands (1)
Updated: 4/2/76
Index Return to Main Contents


em - editor for mortals  


em [-epqs] [file]  


Em is a QMC variant of the standard Unix text editor - ed. It includes all of ed, so the documentation for ed is fully applicable to em. Em also has a number of new commands and facilities designed to improve its interaction and increase its usefulness to users at fast vdu terminals (such as the ITT's at QMC).

Em differs from ed in that it normally prefixes command lines with a '>'. For those who prefer silence, if the editor is invoked by any name not having 'm' as its last character, no prompts will appear. Other ways of controlling prompts are described below.

Commands to em may be typed in upper- or lower-case letters.

Em has the following extra commands. They are designed principally for use at any Teletype-compatible terminal operating at speeds of 1200 baud or more.

The 'break' command 'b' turns on automatic line breaks. During subsequent input to the 'open' command (see below), the first space after character position 60 of each line typed will be replaced by a 'newline'. Automatic line breaks are inserted only during input with one of the variants of the 'o' command. They may be suppressed by the command 'b-'. If the current saved filename ends in '.n' or '.r', then 'b' is automatically invoked.
The 'help' command displays a summary of the commands available in em. The summary resides in /usr/share/em/emhelp, and is designed to fill exactly 18 lines of 80 characters.
o/regular expression/
The 'open' command provides an additional level of editing for interactive corrections during input of new lines of text and for alterations to existing lines. The first two forms of the 'o' command operate on an existing line. The line is opened with the cursor positioned at the first occurence of the regular expression if present, otherwise at the start of the line.

The commands 'o+', 'o-' and 'o\' are equivalent to the 'a', 'i' and 'c' commands respectively, except in their use of the control keys listed below, and in that they are not terminated by a line containing a single '.', but by an ESCAPE or ^D. 'o;' is equivalent to 'o+'. In all variants of the 'o' command it is possible to position the cursor within the line, to delete characters, words or portions of the line, and to insert new text at any point, using control keys as follows:


re-display curent line to cursor
move cursor back one word
exit from 'o' mode
display all of current line
delete forwards to end of current line
gives summary of control keys
display next character

 Release margin
re-scan from start of current line
verify spelling of preceding alphabetic string (see "spell(I)")
display next word
delete preceding word
delete preceding character
delete backwards to start of current line
exit with current line unchanged

Other characters (including RETURN) are inserted as typed. In this mode, diagnostic information is provided on ITT terminals in the form of a % when control keys are used inappropriately. When the automatic line break facility is operative, a 'bell' is transmitted to the terminal before each newline is inserted. The newline may be inhibited by the '^R' code.

x/regular expression/replacement/
The exchange command performs exactly the same functions as an equivalent substitute command 's', except that it enables the user to determine interactively whether or not each replacement is to be performed. Each instance of the specified regular expression is displayed, underscored with '^' characters. The user must type '.' RETURN to perform the replacement or just RETURN to omit it.

The " command is equivalent to '.+1,.+17p'.

The % command is equivalent to '.-7,.+7p', except that the value of '.' is unchanged by it, and the current line is separated from its neighbours on the screen by a line of '-'s.

This is equivalent to '.-16,.p'.

Two additional facilities are available under the '!' (escape to UNIX) command. '!!'repeats the last command executed in ! mode. '%' anywhere in a '!' line is replaced by the currently selected filename.


 '>' turns prompting off, '<' turns it on again.

When using 'x' or 's' in em it is possible to obtain a count of the number of replacements performed by postfixing the command with an 'n'. Unsuccessful searches for strings in em are indicated by '??'.






ed(1), ispell(1)  


 Original code by Ken Thompson
 QMC mods Feb. 76, by  George Coulouris
 additional mods by jrh
 More mods by George March 76:
 2012 port Pierre Gaston <pierre.gaston at gmail dot com>



The underscoring in the 'x' command is sometimes incorrect on ITT terminals, especially when the line contains {,},\- or \!. The ", % and & commands should restrict their scope to the dimensions of whatever screen is in use. Tab settings are assumed to be at every eighth character position.




This document was created by man2html, using the manual pages.
Time: 12:26:24 GMT, June 03, 2012