[PLUG] unifying the X clipboards

Ian Burrell ianburrell at gmail.com
Tue Jul 17 21:50:40 UTC 2007


On 7/12/07, Rogan Creswick <creswick at gmail.com> wrote:
> This is a pet peeve of mine that has recently really started to drive
> me up the wall.
>
> I've been using X and emacs for most of my computing lifetime, so I'm
> hardwired to using mouse-select to copy, then C-y to paste.
>
> While this still works in emacs, in my current environment (XFCE 4 on
> Kubuntu Feisty),  it does not work reliably in other applications.
> There are very clearly (at least) two different clipboards working --
> one that is filled by highlighting text and pasted by middle-clicking,
> and another that is filled with M-w, C-c, C-k, or C-w, depending on
> the application.  That second clipboard then pastes with C-y (or C-v,
> or probably a host of other strokes I don't know about).
>
> This means that I frequently highlight something in Firefox, whack the
> trackball over to gaim, and hammer C-y to paste, dumping in the last
> line of content I killed in emacs or Eclipse.  (I use dvorak, so
> pasting with C-y is like C-t on a qwerty keyboard.  It's very easy to
> do while still using the mouse.)
>
> So, my question is: is there any way that I can make all these
> techniques use the same clipboard? and, can I somehow convince *all*
> apps to use C-y to paste?
>

The two clipboards is by design.  It is specified in a freedesktop
spec [1].  It was designed to unify the cut-and-paste behavior.  There
is the clipboard, which works with explicit cut-and-paste.  This is
familar to Windows and Mac users and mostly uses the same keybindings.
 There is the primary selection which is the currently selected text
which is pasted by middle mouse.

Gtk and Qt have implemented support for the clipboard and most modern
apps implement the standard.  Some apps, like OpenOffice, don't
implement the current selection probably because they come from a
world where there is only the clipboard.  Emacs is the one program
that behaves differently and uses the primary selection for
everything.  There has been some work done in making Emacs behave like
other apps and separate the selection/region from the clipboard [2].

 - Ian

1: http://www.freedesktop.org/wiki/Specifications/ClipboardsWiki
2: http://www.emacswiki.org/cgi-bin/wiki/CopyAndPaste



More information about the PLUG mailing list