ARCHIVED: In Emacs, how do I select a region of text?

This content has been archived, and is no longer maintained by Indiana University. Information here may no longer be accurate, and links may no longer be available or reliable.

In Emacs, a region is an area of text that has been selected. You can apply various commands, such as cutting and copying, to the text within the region.

To select a region, first you set a mark at one end of the text you want to select, then you move the cursor to the other end. The region is all of the text from the mark to the cursor. To set the mark, you may either press C-SPC or C-@, or enter M-x set-mark-command. (For more information on how to enter these commands in Emacs, see How keystrokes are denoted in Emacs)

The text in the region wraps from left to right, around the margins; if instead you wish to select a rectangular area, without wrapping, see ARCHIVED: How do I use Emacs to cut and paste a rectangular region (columns or fields) of text?

Alternatively, if you are running Emacs in its own window (and not within an "xterm" window) as part of an X Window session, you can select the region simply by using the mouse. Click the mouse's left button at the start of the area to be selected, and drag the mouse to the end of the area. The region you selected should be highlighted.

At Indiana University, for personal or departmental Linux or Unix systems support, see Get help for Linux or Unix at IU.

This is document aiuf in the Knowledge Base.
Last modified on 2018-01-18 13:12:59.