help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacs doesn't use the X clipboard


From: Jens Schmidt
Subject: Re: emacs doesn't use the X clipboard
Date: 15 Jan 2004 08:26:54 -0800

LEE Sau Dan <danlee@informatik.uni-freiburg.de> writes:

> If I  have found the patterns,  I would have come  up with workarounds
> and also reported  the bug.  Since I haven't  been able to confidently
> reproduce the misbehaviour, I refrain from filing a bug report.

Here are some more details, probably they are of some help.

First, on my side things run in VNC.  The VNC server cannot set
the PRIMARY selection, it has to use the (deprecated) cut
buffers.  The only thing it can do to the selection is to clear
it (according to some comment in the source code - I am not
familiar with X11 programming at all).

In contrast to that, xterm and Solaris Emacs both evaluate the
cut buffer *and* the PRIMARY selection.

So it also might be the VNC server who is the bad guy, at least
in my case.


For the following tests, the snippet below has been useful:

(defun show-selections ()
  (interactive)
  (insert "prm: <" (or (condition-case c (x-get-selection) (error nil))
                       "<nil>") ">\n"
          "cut: <" (x-get-cut-buffer) ">\n"))

Now I've run the following tests (xterm and Solaris Emacs running
inside VNC server, NT Emacs running outside VNC server):

1. <Select "Stopped" from xterm>
  prm: <Stopped>
  cut: <Stopped>
2. <Select "xterm" from Solaris Emacs>
  prm: <xterm>
  cut: <xterm>
3. <Select "interactive" from NT Emacs>
  prm: <xterm>
  cut: <interactive>
4. <Select "kill-element" from xterm>
  prm: <xterm>
  cut: <kill-element>
5. <Eval (x-set-selection 'PRIMARY "fromemacs") from Solaris Emacs>
  prm: <fromemacs>
  cut: <kill-element>
6. <Select "Data may be" from xterm>
  prm: <DATA may be>
  cut: <DATA may be>
7. <Select "x-last" from NT Emacs>
  prm: <<nil>>
  cut: <x-last>
8. <Eval (x-set-selection 'PRIMARY "fromemacs2") from Solaris Emacs>
  prm: <fromemacs2>
  cut: <x-last>
9. <Select "newer" from NT Emacs>
  prm: <fromemacs2>
  cut: <newer>
10. <Select "closed" from xterm>
  prm: <fromemacs2>
  cut: <closed>

You may note that

- the cut buffer always gets updated.  If you're copying and
  pasting between outside VNC server, xterm and Emacs only, you
  may replace `x-cut-buffer-or-selection-value' by something that
  is based on `x-set-selection' only and you'll be happy with
  that.  However, you won't be happy with that approach as soon
  as you'll use more recent X11 software.

- a call to `x-set-selection' on Solaris Emacs (8. and, implictly
  2.) followed by the VNC server setting the cut buffer (9. and
  3.) makes Solaris Emacs break - it does not notice changes in
  the primary selection any more (4. and 10.)

- the workaround I've sent before simplifies to `x-set-selection'
  on Solaris Emacs (5.) immediately followed by the xterm setting
  the cut buffer and the primary selection (6.).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]