A region
is a segment of any text slot, or a segment of a text or
term sequence. The region cut and paste commands are shown in
Table
.
Table: Region Cutting and Pasting
A region is delimited by the editor's term or text cursor and an auxiliary text or term cursor position. Following emacs's terminology, we call the cursor's position the point and the auxiliary cursor position the mark .
The SET-MARK command sets the mark to the current cursor position. and the SWAP-POINT-MARK command can be used to check the mark's position. It doesn't matter whether mark is to the left or the right of point when selecting a region. In what follows, we call the left-most of point and mark the left delimiter, and the right-most, the right delimiter. If a term is used a region delimiter, the term is understood to be included in the region.
Various regions are acceptable: for selecting a text string in a text slot, both delimiters must be text cursor positions. For selecting a segment of a term sequence, both delimiters must be term cursor positions. For selecting a segment of a text sequence, you can use either a text cursor or a term cursor position for each delimiter.
SAVE-REGION saves a region on the save stack. DELETE-REGION deletes the region. The kind of cursor it leaves depends on the kind of region selected. If the region is of a text slot, or a text sequence, DELETE leaves a text cursor at the old position of the region. If the region is of a term sequence, an empty term slot is left in place of the region. CUT-REGION has the same effect as a SAVE-REGION followed by a DELETE-REGION.
The paste commands for regions are the same as the basic paste commands. You can paste with a text cursor in a text slot or text sequence, and a term cursor at any empty term slot. If you paste a sequence into another sequence of the same kind, paste merges the pasted sequence into the sequence being pasted into. In this event, the point is set to be the left-delimiter for the just pasted sequence, and the mark is set to be the right-delimiter. This ensures proper functionality for the PASTE-NEXT operation. Otherwise, if you are pasting into a sequence, the pasted item always is incorporated as a single sequence element, and both the mark and point are set to that element. Note that it doesn't make sense to try to paste a term or a text sequence containing a term into a text slot that is not in a text sequence.