[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Simple copy & paste problem
From: |
Thierry Volpiatto |
Subject: |
Re: Simple copy & paste problem |
Date: |
Wed, 11 Aug 2010 22:06:43 +0200 |
User-agent: |
Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) |
Joel James Adamson <adamsonj@email.unc.edu> writes:
> Andrea Crotti <andrea.crotti.0@gmail.com> writes:
>
>> This is probably very stupid but every time I step into it and it's very
>> annoying.
>>
>> Supposing I want to copy something from Safari to emacs.
>> So I
>> - select and copy
>> - select and kill the text I want to substitute
>> - try to paste
>>
>> ARGH! Now the text I copied from safari is disappeared...
>>
>> A workardound is to delete first and then copy-paste.
>> But is there a smarter way to solve this?
>> Something like
>> "if I copied something from the os keep it as first in the kill ring"?
>
> How about drag and drop? Does that work on OS X? Select the text, then
> drag it to Emacs. That's usually what I do when I want to go from
> Firefox to Emacs.
You can't do that if emacs and firefox are on differents desktops.
But you can use mouse2 (don't know for OSX).
You can use that also:
,----
| (defun yank-from-clipboard ()
| (interactive)
| (let ((primary (x-selection 'PRIMARY)))
| (when primary (insert primary))))
| (global-set-key (kbd "C-c v") 'yank-from-clipboard)
`----
Like that nothing is added to emacs kill-ring.
If you don't mind adding to emacs kill-ring:
,----
| ;; (setq interprogram-paste-function 'x-cut-buffer-or-selection-value)
| ;; (setq x-select-enable-primary t)
`----
--
Thierry Volpiatto
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997