The mark

A mark can be placed in the text of a file being edited for later use. The mark can be used to remember a place in the text or it may be used in its role of defining a `marked range' (or `range of action'). A marked range is defined as the range of text between the cursor and the mark. This range is used for cutting and copying operations and optionally with certain other commands such as search and replace. Each buffer has its own mark.

There are several commands involving the mark directly:

F1 - Put mark.
This command places the mark at the current position of the cursor. If the mark was at a different location before this command is issued, it is removed from that location and all memory of it will be lost.

shift-F1 - Remove the mark.
This is a rarely used command that exists mainly for security reasons. As some commands cannot be executed without the existence of a mark removing the mark may avoid inadvertent use of these commands.

F2 - Exchange the position of the cursor and the mark.
The region between the cursor and the mark is called the marked range or range of action. Some commands have options that will let them operate on this range of action only. The order of the cursor and the mark in the file is unimportant. Some editors will highlight such a range of action. In stedi however the mark is also used as a means to remember a position and it would be very annoying to highlight a quasi random piece of text. The exchange of the positions of the cursor and the mark allows for a quick inspection of the exact boundaries of the marked range.

shift-F2 - Go to mark.
(Not available on systems without an undo key. There shift F2 invokes the undo facility). This command moves the cursor to the position of the mark. With this command the user can go back quickly to a previously defined position in the current buffer.

Here is a list of the commands involving the mark in its role of defining the marked range.

If no mark has been set, these commands will abort with an error message.

Several commands may erase the mark, for the reason that during the execution of the command, the position of the mark may become dubious. A good example is the replacement of a string that contains the mark in it. Also a cut operation will erase the mark. Technically this is not necessary, but it happens frequently that after the cut has been made, the copy key is pressed inadvertently, rather than the paste key. This would result in the loss of the contents of the paste buffer. Without a mark, nothing will happen.

The paste operation places the cursor at the beginning of the pasted region and puts the mark at its end, so a paste operation can be undone by pressing the cut key, as long as the cursor hasn't been moved yet.



Subsections