Cannot copy text in Emacs and paste into another application

elisp, emacs

Solution

Read the manual, section 25.1.5 Using the Clipboard:

You can customize the variable `x-select-enable-clipboard` to make the Emacs yank functions consult the clipboard before the primary selection, and to make the kill functions to store in the clipboard as well as the primary selection. Otherwise, these commands do not access the clipboard at all.

You should probably also read section 25.1.3 Cut and Paste with Other Window Applications.

Problem

I'm running GNU Linux and GNU Emacs 23.4.2 When I copy text in Emacs (with M-w, or in CUA mode C-c) and then type C-v in some other application to try to paste the copied text, it doesn't work -- the text from Emacs is not pasted. However, when I instead copy the text using the Emacs menus (Edit->Copy), this works -- I can successfully paste the copied text into another application with C-v. How can I fix this, so that copying via the keybindings works the same as copying via the menus?

Original source