# yank(2)

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

## NAME

yank - Paste (copy) kill buffer contents into buffer

## SYNOPSIS

n yank (C-y)

## DESCRIPTION

When a non negative argument is supplied to yank, the command copies the contents of the kill buffer n times into the current buffer at the current cursor position. This does not clear the kill buffer, and therefore may be used to make multiple copies of a section of text. On windowing systems which support clip-boards, such as windows and X-terms, MicroEmacs will also cut to and paste from the global clip-board.

If yank is IMMEDIATELY followed by a reyank(2) then the yanked text is replaced by text of the next entry in the kill ring. (another reyank replaces the text with the previous reyank text and so on).

If an negative argument is given, yank removes the last 0-n items from the kill ring.

Text is inserted into the kill buffer by one of the following commands:-

backward-kill-word(2), copy-region(2), forward-kill-word(2), kill-line(2), kill-paragraph(2), kill-region(2), forward-delete-char(2), backward-delete-char(2).

All the above commands (except copy-region) cut text out of the buffer, the last two character delete commands require the presence of a numeric argument to add the deleted text to the kill buffer. If any of these commands are executed immediately after any other (including itself) or the @cl(4) variable is set to one of these command, the new kill text is appended to the last kill buffer text.

## NOTES

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 buffer entry is immediately available for a paste operation into another application (regardless of how it was inserted into the kill buffer). Conversely, data placed in the windowing kill buffer is available to MicroEmacs 2009, via yank, until a new item has been inserted into the kill buffer (the data may still be available via reyank(2)).

## EXAMPLE

The following example is a basic macro code implementation of the transpose-lines(2) command,

    beginning-of-line
    kill-line
    forward-line
    yank
    -1 yank
    backward-line

Note that similar to transpose-lines it does not leave the moved line in the kill buffer, effectively tidying up after itself.

## SEE ALSO

backward-delete-char(2), backward-kill-word(2), copy-region(2), forward-delete-char(2), forward-kill-word(2), kill-line(2), kill-paragraph(2), kill-region(2), reyank(2), yank-rectangle(2), @y(4), @cc(4).

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

</HMTL>