# kill-region(2)

[Home] [Commands] [Variables] [Macro-Dev] [Glossary]

## NAME

kill-region - Delete all characters in the marked region

## SYNOPSIS

n kill-region (C-w)

## DESCRIPTION

kill-region deletes all characters from the cursor to the mark set with the set-mark(2) command. The characters removed are copied into the kill buffer and may be extracted using yank(2). If a numeric argument of `0` is given the command has no effect. If a negative argument is given the characters are not placed in the kill buffer, therefore the text is effectively lost (this does not effect the undo(2) operation).

The mark position may be ahead or behind the current cursor position.

Where the region contains a narrowed region, defined by narrow-buffer(2), then kill-region deletes all text contained within the narrow, this text is added to the kill buffer.

## USAGE

To move text from one place to another:

- Move to the beginning of the text you want to move.
- Set the mark there with the set-mark (esc space) command.
- Move the point (cursor) to the end of the text.
- Use the kill-region command to delete the region you just defined. The text will be saved in the kill buffer.
- Move the point to the place you want the text to appear.
- Use the yank (C-y) command to copy the text from the kill buffer to the current point.

Repeat the last two steps to insert further copies of the same text.

## NOTES

If a region is accidentally removed then yank the text back immediately or use undo(2).

Windowing systems such as X-Windows and Microsoft Windows utilize a global windowing kill buffer allowing data to be moved between windowing applications (cut buffer and clipboard, respectively). Within these environments MicroEmacs 2009 automatically interacts with the windowing systems kill buffer, the last MicroEmacs 2009 kill-region entry is immediately available for a paste operation into another windowing application.

## SEE ALSO

backward-kill-word(2), copy-region(2), forward-kill-word(2), kill-line(2), kill-paragraph(2), kill-rectangle(2), narrow-buffer(2), reyank(2), set-mark(2), undo(2), yank(2).

(c) Copyright JASSPA 2009
Last Modified: 2009/08/29
Generated On: 2009/10/12

</HMTL>