On  6.05.08, Pavel Sanda wrote:
> > Normally, I can highlight text in a terminal and paste it with a 
> > middle-click. In LyX, usually I can get to it with Edit -> Paste Special.
> > (I can copy-and-paste fine in my xterms.)
> > 
> > In my LyX, the Paste Special choices are shaded out and not clickable.
> > 
> > This is LyX 1.5.2 on NetBSD. I am not running any clipboard utility.
> > 
> > Any ideas why I can't paste into LyX?

Short answer
------------

LyX supports the CLIPBOARD x-selection nicely, but the PRIMARY selection
only partially.

Long answer
-----------

I finally found documentation of pasting and clipboard issues under
X-Windows in xclip's README:
 
   For a good overview of what selections are about, have a look at 
   <http://www.freedesktop.org/standards/clipboards.txt>. Short version:
   
   * XA_PRIMARY contains the last text you highlighted
   * Middle click pastes XA_PRIMARY
   
   * XA_CLIPBOARD contains text explicitly copied with Edit | Copy, Ctrl-C etc.
   * Edit | Paste pastes XA_CLIPBOARD

The MS-Windows clipboard corresponds to the CLIPBOARD x-selection (in the
view of the end-user, implementation differs). 

There is no MS-Windows counterpart for the PRIMARY selection
(clipboards.txt speaks of it as an "easter-egg" for experienced X-Windows
users).

However, IMHO proper support for the PRIMARY selection is is an important
feature for seamless integration in an X-Windows environment:

* some applications do not support CLIPBOARD. Althought this can be seen
  as a deficient of these applications and not LyX's fault, it helps the
  end user if LyX can communicate with these applications via the PRIMARY
  selection.

* Experienced X-Windows users are used to the "rapid select and paste"
  way of pasting marked text via the middle mouse button. 
  
  The need to explicitely copy the marked text (via the keyboard)
  interrupts the workflow considerably.


State of the art (LyX 1.5.4 on Debian Gnu/Linux)
------------------------------------------------

For diagnosis, I am running the xfce clipboard, as this shows the state
of PRIMARY and CLIPBOARD selection in separate lists. I do not know how
far this influences the behaviour of LyX.

Transfer to LyX
~~~~~~~~~~~~~~~

Works as expected (mostly): 
  
* ^V (Edit>Paste Special>Plain Text) inserts the latest text copied with 
  ^C in firefox.
    
* middle click (Edit>Paste Special>Selection) inserts the text
  highlighted in firefox (PRIMARY).

* middle click inserts the text highlighted in rxvt-unicode (PRIMARY).
    
* middle click does *not* insert text highlighted in the Jed text editor
  (although this text is shown in the PRIMARY list in the xfce clipboard).

  
Transfer from LyX
~~~~~~~~~~~~~~~~~

* ^V in firefox inserts text copied with ^C in lyx.

* ^V in rxvt-unicode has a different function. Pasting relies on the
  middle mouse click. 

* middle click does not always insert text selected in lyx!

  Text selected in lyx only sometimes appears in the xfce clipboard
  list of the PRIMARY selection: 
  
  + marking words by double click usually sets PRIMARY, 
  + Shift+Cursor-Keys sets PRIMARY
  + marking with mouse-drag usually usually *fails* to set PRIMARY
    (it does so sometimes but the pattern governing this behaviour is not
    clear).

If there is interest, I can continue the evaluation using xclip instead
of the xfce clipboard to rule out interferences.

Günter



  



Reply via email to