Previous Next Chapter

MEmacs

MEmacs (MicroEmacs), which is similar to the UNIX-based Emacs editor, is a screen-oriented editor in which you can edit multiple files at the same time. MEmacs performs all operations on memory-resident text, requiring that entire text files be able to fit into memory at once.

Line length, generally 80 characters long, is limited to the right edge of the screen. You can enter characters beyond the limit, however, they are not displayed. To see these characters, break the line or delete some of the displayed characters. A dollar sign ($) at the right edge of the screen indicates that there are characters beyond what is displayed.

The format for the MEmacs command is the following:

MEMACS [<filename>] [GOTO <n>] [OPT W]

The <filename> argument is optional.

The GOTO <n> option specifies the line on which the cursor is to appear when the file is opened.

Specifying OPT W opens MEmacs in a Workbench window rather than on its own screen, which saves memory.

Starting MEmacs

MEmacs can be run from either the Workbench or the Shell. From the Workbench, double-click on the MEmacs icon in the Tools window of the Extras disk. If you have a hard disk, the Tools drawer is in your Workbench window.

From the Shell, enter:

MEmacs <filename>

where <filename> specifies the file to read into MEmacs. If a file with that name does not previously exist, a new file is created when you save your work.

MEmacs Commands

The line at the bottom of the MEmacs screen identifies either the current file name or the name of the current buffer if no file name is specified. Figure 4-5 illustrates the MEmacs opening screen .

Figure 4-5. MEmacs Opening Screen

Several buffers can be in use at the same time and one or more can be displayed on the screen simultaneously. Menu options switch between them. At all times, the screen displays what is actually in the buffer.

MEMacs has two conditions of operation:

Normal

When you enter and manipulate text directly in the file without special functions.

Command

When you enter a command through a menu selection or the keyboard shortcut for it. In the command condition, the cursor jumps to the bottom line of the display and waits for you to supply additional information following the prompt. You cannot return to the normal condition until you satisfy or cancel the command by pressing Return.

In the MEmacs normal condition, you can:

When using MEmacs, you should be familiar with the following special terms:

Buffer

A memory area that MEmacs controls. There is always at least one buffer used by MEmacs containing zero or more text characters.

Dot

The current cursor position.

Mark

A specified cursor position. (Each buffer has its own dot and mark.) The Set-mark menu item marks the current cursor position (described on page 4-33). You can move forward or backward in the file, adding or deleting text. To return to the marked place, select the Swap-dot&mark menu item (described on page 4-36).

You can also set a mark to indicate the beginning of a block of text that you want to duplicate, move, or delete. The block encompasses all the characters starting with the mark and continuing to the current cursor position.

Kill

Kill commands remove text from the screen to save in a kill buffer. This text can be retrieved and inserted into your document by using the Yank command. Issuing successive Kill commands (without selecting Yank in between) adds each block of the text to the existing text in the kill buffer. If you select Yank, the next block of killed text otherwise the current block.

Window

MEmacs screens can be split into multiple layers for editing and displaying more than one buffer or two or more portions of the same buffer. Each layer is a MEmacs window.

Modified Buffers

Buffers are marked as modified when any changes are made. The modified status is removed when the buffer is saved.

To see modified buffers, use the List-buffers command (described on page 4-33); modified buffers are identified with an asterisk (*). If you exit MEmacs without saving any changes, a prompt tells you that modified buffers exist and asks if you really want to quit.

Menu Commands

MEmacs has the following menus:

Project

Contains system and file-oriented items.

Edit

Contains buffer editing commands.

Window

Controls the characteristics of the MEmacs windows.

Move

Controls the placement of the cursor.

Line

Controls line-oriented operations.

Word

Controls word-oriented operations.

Search

Controls search and search/replace options.

Extras

Controls the numerical value of arguments and lets you execute a series of operations as though it were a single special command.

Figure 4-6 illustrates the MEmacs expanded menu bar.

Figure 4-6. MEmacs Expanded Menus

Top Previous Next Chapter