LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Emacs vs. Gnome Cut-And-Paste Tug of War (https://www.linuxquestions.org/questions/linux-software-2/emacs-vs-gnome-cut-and-paste-tug-of-war-769566/)

mejohnsn 11-16-2009 09:27 PM

Emacs vs. Gnome Cut-And-Paste Tug of War
 
I have problems when I do cut-and-paste or copy-and-paste between Emacs and other applications running under Gnome(Fedora 11).

Specifically, it works in one direction just fine, but fails in the other: I have to use X-windows cut-and-paste instead.

That is, I can copy and paste in Eclipse, and then Ctl-Y yanks into Emacs just fine. But when I try to go the other way (using Ctl-W in Emacs, Ctl-V in Eclipse), I get nothing. I have to highlight the whole file with the mouse cursor in Emacs, carefully position the mouse-cursor in Eclipse and simulate middle-click by clicking both left & right mouse buttons.

It is a pretty recent version of Emacs, 22.1. Eclipse is Galileo.

SaintDanBert 11-16-2009 10:32 PM

clipboard vs. emacs buffer
 
Quote:

Originally Posted by mejohnsn (Post 3759477)
...
That is, I can copy and paste in Eclipse, and then Ctl-Y yanks into Emacs just fine. But when I try to go the other way (using Ctl-W in Emacs, Ctl-V in Eclipse), I get nothing.
...

When you ctrl-X (cut) and ctrl-v (paste) in Eclipse you operated from the clipboard.

When you ctrl-w (cut) and ctrl-Y (yank) in Emacs, you operate from the current buffer into a separate emacs buffer. Same data but different places.

Emacs has an Edit menu with cut and paste entries. These operate against the clipboard.

~~~ 0;-Dan

mejohnsn 11-16-2009 11:41 PM

Quote:

Originally Posted by SaintDanBert (Post 3759519)
When you ctrl-X (cut) and ctrl-v (paste) in Eclipse you operated from the clipboard.

When you ctrl-w (cut) and ctrl-Y (yank) in Emacs, you operate from the current buffer into a separate emacs buffer. Same data but different places.

Emacs has an Edit menu with cut and paste entries. These operate against the clipboard.

~~~ 0;-Dan

It is possible that I was not clear enough about when I did ctl-w and when ctl-y. In both cases, I was operating on the current buffer. But they are separate cases. And in the one case, the case that works, clearly Emacs was using the same clipboard as Eclipse used. But when going the other direction, it does not.

That is what is so strange to me. I could understand it if Emacs simply failed to use the same clipboard at all, but that is not what is happening.

Or is it? When I mark the text just before doing ctl-C in Eclipse, is the same region marked for X-windows whether or not I used the mouse?

Also, now that I am back on the Fedora11 system, I verified by trying it out. It is the Emacs to Eclipse direction that fails. The other direction doesn't always work, but it often does.

That is, I mark the entire R.xml file using ctl-A, copy w/ ctl-C, switch over to Emacs; then I try to 'yank' the text with ctl-Y. Usually, I get the text I marked.

Interestingly enough, this time at least, the text I just yanked also shows up under Emacs in Edit>Paste from Kill Menu.

This is the case where I use ctl-Y. I use ctl-W only when going in the other direction, from Emacs to Eclipse.

Substitute 'Eclipse' with any other viewing/editing application under Gnome and I still get the same general behavior.

Finally, I got the version# wrong for my installation of Emacs: it is 23.1.1.

Or am I confusing "kill ring" with "clipboard"? It looks like the two are sometimes the same, but with no consistency.

If, after all, ctl-Y operated exclusively with the kill ring, and the latter never duplicated the clipboard, then what I just did (as described above) would be impossible.


All times are GMT -5. The time now is 04:45 PM.