This might be extraordinarily simple, but I am playing with Emacs (22.1.1) and I can't get it to paste text in the clipboard using Control-Y.
Then ctrl-w cuts the highlighted region into the emacs version of the clipboard, and ctrl y "yanks" it out at whatever point you move the cursor to. If you want to copy the highlighted region to the emacs version of the clipboard without cutting it out of the text, that's esc-w.
When you copy and paste text, the terminal does it : you're taking the text that the terminal displays and not the text that is in your emacs app. That's why you have to use terminal keybindings : Ctrl-Shift-C and Ctrl-Shift-V to copy and paste text.
Similarly, you can use Ctrl+shift+C to copy text from the terminal and then use it to paste in a text editor or web browser using the regular Ctrl+V shortcut. Basically, when you are interacting with the Linux terminal, you use the Ctrl+Shift+C/V for copy-pasting.
An Emacs paste is the command yank (usually bound to C-y ). A system paste is what you typically get from pressing C-v (or choosing "Edit-Paste" in an application window). An X paste is pressing the "center mouse button" (simulated by pressing the left and right mouse buttons together).
Try using the M-x clipboard-yank
command. If you want to copy text to the clipboard you have to M-x clipboard-kill-region
.
This works on Linux and Windows, I guess on Mac it's the same.
If you're using the in-built Emacs, then you're running Emacs in the terminal. The "clipboard" is a function of your windowing system. Emacs in terminal mode (-nw
) does not access any windowing system specific APIs. This is true of most command line tools designed to work in the terminal.
You need to upgrade your Emacs as others have suggested, and run in graphical mode. Using Emacs 24 on Mac OS X, the behaviour you want is the default.
If you want to do this in a terminal, then this hack will make the clipboard work.
(defun copy-from-osx () (shell-command-to-string "pbpaste")) (defun paste-to-osx (text &optional push) (let ((process-connection-type nil)) (let ((proc (start-process "pbcopy" "*Messages*" "pbcopy"))) (process-send-string proc text) (process-send-eof proc)))) (setq interprogram-cut-function 'paste-to-osx) (setq interprogram-paste-function 'copy-from-osx)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With