manpagez: man pages & more
info emacs
Home | html | info | man
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

26.1.2 Cut and Paste with Other Window Applications

To copy text to another windowing application, kill it or save it in the kill ring. Then use the “paste” or “yank” command of the other application to insert the text.

To copy text from another windowing application, use its “cut” or “copy” command to select the text you want. Then yank it in Emacs with C-y or Mouse-2.

When Emacs puts text into the kill ring, or rotates text to the front of the kill ring, it sets the primary selection in the window system. This is how other windowing applications can access the text. On the X Window System, emacs also stores the text in the cut buffer, but only if the text is short enough (the value of x-cut-buffer-max specifies the maximum number of characters); putting long strings in the cut buffer can be slow.

The commands to yank the first entry in the kill ring actually check first for a primary selection in another program; after that, they check for text in the cut buffer. If neither of those sources provides text to yank, the kill ring contents are used.

The standard coding system for X Window System selections is compound-text-with-extensions. To specify another coding system for selections, use C-x <RET> x or C-x <RET> X. See section Coding Systems for Interprocess Communication.

© 2000-2021
Individual documents may contain additional copyright information.