Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot copy text in Emacs and paste into another application

Tags:

emacs

elisp

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?

like image 684
cnd Avatar asked May 21 '12 04:05

cnd


People also ask

How do you copy from emacs and paste somewhere else?

Right-clicking in a PuTTY window pastes the contents of the Windows copy/paste buffer. In Konsole or Terminal on Linux, you highlight what you want then press Shift+Ctrl+C for copy and Shift+Ctrl+V for paste.

How do I copy text in Emacs?

Once you have a region selected, the most basic commands are: To cut the text, press C-w . To copy the text, press M-w . To paste the text, press C-y .

How do I copy text and paste outside in Vim?

To copy selected text to system clipboard type "+y in Normal Mode. Now you can paste it anywhere else using Ctrl-v . To copy text from outside applications into Vim editor, first copy the text using the usual Ctrl-C command then go to Vim editor and type "+p in Normal Mode.


1 Answers

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.

like image 188
cjm Avatar answered Sep 17 '22 03:09

cjm