+@node Clipboard
+@subsection Using the Clipboard
+@cindex clipboard
+
+ The @dfn{clipboard} is the facility that most graphical applications
+use for ``cutting and pasting''. When the clipboard exists, the kill
+and yank commands in Emacs make use of it.
+
+ When you kill some text with a command such as @kbd{C-w}
+(@code{kill-region}), or copy it to the kill ring with a command such
+as @kbd{M-w} (@code{kill-ring-save}), that text is also put in the
+clipboard.
+
+@vindex save-interprogram-paste-before-kill
+ When an Emacs kill command puts text in the clipboard, the existing
+clipboard contents are normally lost. Optionally, you can change
+@code{save-interprogram-paste-before-kill} to @code{t}. Then Emacs
+will first save the clipboard to its kill ring, preventing you from
+losing the old clipboard data---at the risk of high memory consumption
+if that data turns out to be large.
+
+ Yank commands, such as @kbd{C-y} (@code{yank}), also use the
+clipboard. If another application ``owns'' the clipboard---i.e., if
+you cut or copied text there more recently than your last kill command
+in Emacs---then Emacs yanks from the clipboard instead of the kill
+ring.
+
+@vindex yank-pop-change-selection
+ Normally, rotating the kill ring with @kbd{M-y} (@code{yank-pop})
+does not alter the clipboard. However, if you change
+@code{yank-pop-change-selection} to @code{t}, then @kbd{M-y} saves the
+new yank to the clipboard.
+
+@vindex x-select-enable-clipboard
+ To prevent kill and yank commands from accessing the clipboard,
+change the variable @code{x-select-enable-clipboard} to @code{nil}.
+
+@cindex clipboard manager
+@vindex x-select-enable-clipboard-manager
+ Many X desktop environments support a feature called the
+@dfn{clipboard manager}. If you exit Emacs while it is the current
+``owner'' of the clipboard data, and there is a clipboard manager
+running, Emacs transfers the clipboard data to the clipboard manager
+so that it is not lost. In some circumstances, this may cause a delay
+when exiting Emacs; if you wish to prevent Emacs from transferring
+data to the clipboard manager, change the variable
+@code{x-select-enable-clipboard-manager} to @code{nil}.
+
+@vindex x-select-enable-primary
+@findex clipboard-kill-region
+@findex clipboard-kill-ring-save
+@findex clipboard-yank
+ Prior to Emacs 24, the kill and yank commands used the primary
+selection (@pxref{Primary Selection}), not the clipboard. If you
+prefer this behavior, change @code{x-select-enable-clipboard} to
+@code{nil}, @code{x-select-enable-primary} to @code{t}, and
+@code{mouse-drag-copy-region} to @code{t}. In this case, you can use
+the following commands to act explicitly on the clipboard:
+@code{clipboard-kill-region} kills the region and saves it to the
+clipboard; @code{clipboard-kill-ring-save} copies the region to the
+kill ring and saves it to the clipboard; and @code{clipboard-yank}
+yanks the contents of the clipboard at point.
+
+@node Primary Selection
+@subsection Cut and Paste with Other Window Applications
+@cindex X cutting and pasting
+@cindex X selection
+@cindex primary selection
+@cindex selection, primary
+
+ Under the X Window System, there exists a @dfn{primary selection}
+containing the last stretch of text selected in an X application
+(usually by dragging the mouse). Typically, this text can be inserted
+into other X applications by @kbd{mouse-2} clicks. The primary
+selection is separate from the clipboard. Its contents are more
+``fragile''; they are overwritten each time you select text with the
+mouse, whereas the clipboard is only overwritten by explicit ``cut''
+or ``copy'' commands.
+
+ Under X, whenever the region is active (@pxref{Mark}), the text in
+the region is saved in the primary selection. This applies regardless
+of whether the region was made by dragging or clicking the mouse
+(@pxref{Mouse Commands}), or by keyboard commands (e.g., by typing
+@kbd{C-@key{SPC}} and moving point; @pxref{Setting Mark}).
+
+@vindex select-active-regions
+ If you change the variable @code{select-active-regions} to
+@code{only}, Emacs saves only temporarily active regions to the
+primary selection, i.e., those made with the mouse or with shift
+selection (@pxref{Shift Selection}). If you change
+@code{select-active-regions} to @code{nil}, Emacs avoids saving active
+regions to the primary selection entirely.
+
+ To insert the primary selection into an Emacs buffer, click
+@kbd{mouse-2} (@code{mouse-yank-primary}) where you want to insert it.
+@xref{Mouse Commands}.
+
+@cindex MS-Windows, and primary selection
+ MS-Windows provides no primary selection, but Emacs emulates it
+within a single Emacs session by storing the selected text internally.
+Therefore, all the features and commands related to the primary
+selection work on Windows as they do on X, for cutting and pasting
+within the same session, but not across Emacs sessions or with other
+applications.
+
+@node Secondary Selection
+@subsection Secondary Selection
+@cindex secondary selection
+
+ In addition to the primary selection, the X Window System provides a
+second similar facility known as the @dfn{secondary selection}.
+Nowadays, few X applications make use of the secondary selection, but
+you can access it using the following Emacs commands: