left up right

Regions

Sometimes it is convient to mark a portion of text for processing. This is done by setting a mark in the text buffer. All the text between the mark and the current cursor location (called the point) is known as the region.

Depending on the display capabilities of your terminal and what options are set in your .emacs file, the region may be highlighted.

Setting the Region

A region is set by creating a mark and moving the cursor.
    C-SPC    Set the mark
    C-@      (synonym for C-SPC)

Once the mark is set, just move the cursor to create a region. The region is all text between the mark and the cursor.

A region may also be create by using the mouse. Just click and drag to create the region. The mark is placed where the mouse is clicked and the current cursor location follows the mouse. Double-click and drag will constrain the region to word boundaries. Triple-click and drag will constrain the region to lines.

Note: Earlier versions of emacs have subtle differences in the way the mouse was handled. Just be aware.

Cutting and Pasting

Probably the most useful commands on the region are cutting and pasting.
    C-W     Kill the current region.
    M-W     Save the region in the kill buffer
            (without actually killing it)
Use the yank command (C-Y) to retrieve text.

Other Interesting Region Commands

    C-X C-X    Swap positions of point and mark.
    M-|        Run an external command on the region.
               (e.g. "M=| wc -w RET" will count words in the region)
                 

left up right
Author: Jim Weirich / jweirich@one.net
Last modified: Mon Oct 4 22:44:43 EDT 1999
Network Provider: One Net Communications