unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* emacs doesn't use the X clipboard
@ 2004-01-11  0:26 Micha Feigin
  2004-01-11  5:46 ` Eli Zaretskii
       [not found] ` <mailman.387.1073803639.928.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 33+ messages in thread
From: Micha Feigin @ 2004-01-11  0:26 UTC (permalink / raw)


How do I make emacs use the X clipboard. It seems to usually ignore it
(It will sometimes paste from the clipboard, but more often then not it
will paste from its own kill ring, even when using the middle mouse
button to paste)

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: emacs doesn't use the X clipboard
  2004-01-11  0:26 emacs doesn't use the X clipboard Micha Feigin
@ 2004-01-11  5:46 ` Eli Zaretskii
       [not found] ` <mailman.387.1073803639.928.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 33+ messages in thread
From: Eli Zaretskii @ 2004-01-11  5:46 UTC (permalink / raw)


> Date: Sun, 11 Jan 2004 02:26:14 +0200
> From: Micha Feigin <michf@post.tau.ac.il>
> 
> How do I make emacs use the X clipboard. It seems to usually ignore it
> (It will sometimes paste from the clipboard, but more often then not it
> will paste from its own kill ring, even when using the middle mouse
> button to paste)

(I believe you mean "X selection", not the clipboard.  Clipboard means
something different in X than it does in MS-Windows.)

Emacs pastes from X only if you didn't issue any command that kills
text since the last X selection was made.  In other words, if you
select text in another application, then immediately paste inside
Emacs, you should get the text you selected in that other application.

This is so because each text you kill in Emacs is automatically put
into the X selection, so if you do that before pasting from X, the
text you kill in Emacs overshadows the previous X selection in another
application.

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: emacs doesn't use the X clipboard
       [not found] <mailman.381.1073784888.928.help-gnu-emacs@gnu.org>
@ 2004-01-11 13:02 ` Henrik Enberg
  0 siblings, 0 replies; 33+ messages in thread
From: Henrik Enberg @ 2004-01-11 13:02 UTC (permalink / raw)


Micha Feigin <michf@post.tau.ac.il> writes:

> How do I make emacs use the X clipboard. It seems to usually ignore it
> (It will sometimes paste from the clipboard, but more often then not it
> will paste from its own kill ring, even when using the middle mouse
> button to paste)

(setq x-select-enable-clipboard t)

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: emacs doesn't use the X clipboard
       [not found] ` <mailman.387.1073803639.928.help-gnu-emacs@gnu.org>
@ 2004-01-12 17:59   ` LEE Sau Dan
  2004-01-13  0:18     ` Carsten Weinberg
                       ` (3 more replies)
  0 siblings, 4 replies; 33+ messages in thread
From: LEE Sau Dan @ 2004-01-12 17:59 UTC (permalink / raw)


>>>>> "Eli" == Eli Zaretskii <eliz@elta.co.il> writes:

    Eli> Emacs pastes from X only if you didn't issue any command that
    Eli> kills text since the last X selection was made.  In other
    Eli> words, if you select text in another application, then
    Eli> immediately paste inside Emacs, you should get the text you
    Eli> selected in that other application.

Not always.   I've been experiencing  this annoying for some  time.  I
think the OP  has got the same problem that  I encounter.  Select text
in xterm,  and C-y  in Emacs (or  middle-click) while seeing  the text
still highlighted in xterm.  Emacs  pastes from the king-ring, not the
selection.  With the text  still highlighted in xterm, middle-click on
other apps and they all get the highlighted text from the xterm.

Worse yet,  this behaviour  is quite random  (to me).   Sometimes, C-y
does  paste   from  a  selection  (form   whatever  other  X-clients).
Sometimes, it  just pastes  from the kill-ring,  as if there  were not
selections  at all.  I  still haven't  figured out  the rules  of when
Emacs behaves one way and when the other.  So, to me it's "random".



    Eli> This is so because each text you kill in Emacs is
    Eli> automatically put into the X selection, so if you do that
    Eli> before pasting from X, the text you kill in Emacs overshadows
    Eli> the previous X selection in another application.

I  do understand  how  the  X selection  mechanism  works.  I've  even
programmed it in  C/Xlib.  That does not stop  Emacs from misbehaving,
though.



-- 
Lee Sau Dan                     李守敦(Big5)                    ~{@nJX6X~}(HZ) 

E-mail: danlee@informatik.uni-freiburg.de
Home page: http://www.informatik.uni-freiburg.de/~danlee

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: emacs doesn't use the X clipboard
  2004-01-12 17:59   ` LEE Sau Dan
@ 2004-01-13  0:18     ` Carsten Weinberg
       [not found]     ` <mailman.495.1073964322.928.help-gnu-emacs@gnu.org>
                       ` (2 subsequent siblings)
  3 siblings, 0 replies; 33+ messages in thread
From: Carsten Weinberg @ 2004-01-13  0:18 UTC (permalink / raw)


> I  do understand  how  the  X selection  mechanism  works.  I've  even
> programmed it in  C/Xlib.  That does not stop  Emacs from misbehaving,
> though.

Well, Lee you are right. I just experienced a lot of trouble copying text from gtk2-emacs to gtk2-mozilla-firebird and vice versa. Either via X selection or CUA-like key  strokes. Sometimes it works, sometimes not. Insofar it would be a good idea making emacs compatible to the gtk2 toolkit, and the gnome desktop environment.

Cheers
-C. Weinberg

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: emacs doesn't use the X clipboard
       [not found]     ` <mailman.495.1073964322.928.help-gnu-emacs@gnu.org>
@ 2004-01-13  5:00       ` Ian Zimmerman
  2004-01-13 12:06         ` LEE Sau Dan
  2004-01-13 11:23       ` Jens Schmidt
  1 sibling, 1 reply; 33+ messages in thread
From: Ian Zimmerman @ 2004-01-13  5:00 UTC (permalink / raw)



Lee> I do understand how the X selection mechanism works.  I've even
Lee> programmed it in C/Xlib.  That does not stop Emacs from
Lee> misbehaving, though.

Carsten> Well, Lee you are right. I just experienced a lot of trouble
Carsten> copying text from gtk2-emacs to gtk2-mozilla-firebird and vice
Carsten> versa. Either via X selection or CUA-like key
Carsten> strokes. Sometimes it works, sometimes not. 

This has been discussed here at least twice before :-(

I reported it to RMS, and he said "use gdb on Emacs".  Which I won't, because 
recompiling Emacs on my laptop takes more than an hour.

Maybe someone with more resources can follow this path and finally get
this fixed?

Carsten> a good idea making emacs compatible to the gtk2 toolkit, and
Carsten> the gnome desktop environment.

I don't get the connection here (how it would solve the problem), and
anyway if you mean make gtk2 (and _especially_ gnome) a dependency of
Emacs, I am most definitely against.

-- 
Nothing can be explained to a stone.
Or to a stoned person, either.

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: emacs doesn't use the X clipboard
  2004-01-12 17:59   ` LEE Sau Dan
  2004-01-13  0:18     ` Carsten Weinberg
       [not found]     ` <mailman.495.1073964322.928.help-gnu-emacs@gnu.org>
@ 2004-01-13  6:48     ` Eli Zaretskii
       [not found]     ` <mailman.510.1073976607.928.help-gnu-emacs@gnu.org>
  3 siblings, 0 replies; 33+ messages in thread
From: Eli Zaretskii @ 2004-01-13  6:48 UTC (permalink / raw)


> From: LEE Sau Dan <danlee@informatik.uni-freiburg.de>
> Newsgroups: gnu.emacs.help
> Date: 12 Jan 2004 18:59:26 +0100
> 
> Select text
> in xterm,  and C-y  in Emacs (or  middle-click) while seeing  the text
> still highlighted in xterm.  Emacs  pastes from the king-ring, not the
> selection.  With the text  still highlighted in xterm, middle-click on
> other apps and they all get the highlighted text from the xterm.
> 
> Worse yet,  this behaviour  is quite random  (to me).   Sometimes, C-y
> does  paste   from  a  selection  (form   whatever  other  X-clients).
> Sometimes, it  just pastes  from the kill-ring,  as if there  were not
> selections  at all.  I  still haven't  figured out  the rules  of when
> Emacs behaves one way and when the other.  So, to me it's "random".

Someone needs to debug this.  I don't think I've ever seen that on
any of the machines I work on.

The only issue that comes to mind is that of non-ASCII characters in
the X selection: perhaps some of the other applications encode
selected text in a way that Emacs doesn't understand/support, or use
some X selection type that Emacs didn't support (or still doesn't; you
didn't say which version you are using).

In any case, if this randomness is the kind of problems the OP was
dealing with (I kinda understood that in the OP's case, Emacs _never_
took text from the X selection), the proper place to report and
discuss it is on gnu.emacs.bug or emacs-pretest-bug@gnu.org (the
latter for the CVS versions), not here.

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: emacs doesn't use the X clipboard
       [not found]     ` <mailman.495.1073964322.928.help-gnu-emacs@gnu.org>
  2004-01-13  5:00       ` Ian Zimmerman
@ 2004-01-13 11:23       ` Jens Schmidt
  2004-01-13 12:22         ` LEE Sau Dan
  2004-01-13 14:38         ` Tim McNamara
  1 sibling, 2 replies; 33+ messages in thread
From: Jens Schmidt @ 2004-01-13 11:23 UTC (permalink / raw)


Carsten Weinberg <cweinberg@firemail.de> writes:

> > I  do understand  how  the  X selection  mechanism  works.  I've  even
> > programmed it in  C/Xlib.  That does not stop  Emacs from misbehaving,
> > though.
> 
> Well, Lee you are right.

Same problems on my side: Mostly working on VNC-based X servers, a
paste into Emacs sometimes works, sometimes not.  I have isolated
the problems a little bit, though.  Here is the exact scenario and
my findings:

One Emacs is 21.1.1 NT Emacs, the other is 21.1.1 on Solaris
running in a VNC session on NT.  Window manager of the VNC
session is fvwm2.  Both Emacsen started with --no-init-file
--no-site-file.  The third window around is an xterm also running
in the VNC session (most conveniently with a running cat >
/dev/null).  All text pasted around is ASCII only.

1. Paste from Solaris Emacs into NT Emacs or xterm always works
   fine.

2. Pasting between NT Emacs and xterm always works fine in both
   directions.

3. After a select in Solaris Emacs and a paste into NT Emacs, a
   paste into Solaris Emacs (regardless whether from xterm or NT
   Emacs) does not work any more.

4. After a select in Solaris Emacs, paste into xterm, immediate
   new select in xterm and paste back into Solaris Emacs, a paste
   into Solaris Emacs (regardless whether from xterm or NT
   Emacs) works again.

5. Setting `x-select-enable-clipboard' to t in Solaris Emacs
   disables the workaround under 4.

Hope that helps.  Would be interesting to know if the work-around
works for the other posters, too.  Then this could be almost
called a bug report, I guess.

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: emacs doesn't use the X clipboard
  2004-01-13  5:00       ` Ian Zimmerman
@ 2004-01-13 12:06         ` LEE Sau Dan
  2004-01-13 18:35           ` Carsten Weinberg
                             ` (4 more replies)
  0 siblings, 5 replies; 33+ messages in thread
From: LEE Sau Dan @ 2004-01-13 12:06 UTC (permalink / raw)


>>>>> "Ian" == Ian Zimmerman <bayard@newsguy.com> writes:

    Carsten> Well, Lee you are right. I just experienced a lot of
    Carsten> trouble copying text from gtk2-emacs to
    Carsten> gtk2-mozilla-firebird and vice versa. Either via X
    Carsten> selection or CUA-like key strokes. Sometimes it works,
    Carsten> sometimes not.

    Ian> This has been discussed here at least twice before :-(

    Ian> I reported it to RMS, and he said "use gdb on Emacs".  Which
    Ian> I won't, because recompiling Emacs on my laptop takes more
    Ian> than an hour.

But how  would that help, if you're  not a C programmer  or you're not
familiar with  Xlib, so that  you have no  idea of where to  put break
points?

(BTW, it'd be  fun to run gdb under  Emacs, debugging another instance
of Emacs.  I  hope one wouldn't be confused by  the two Emacses.  (-fg
and -bg suddenly becomes invaluable!)


    Ian> Maybe someone with more resources can follow this path and
    Ian> finally get this fixed?

How about an  'ltrace'?  At least, it doesn't  require recompiling the
binary.  I'm not sure if ltrace can show the Xlib calls, though.


    Carsten> a good idea making emacs compatible to the gtk2 toolkit,
    Carsten> and the gnome desktop environment.

    Ian> I don't get the connection here (how it would solve the
    Ian> problem), and anyway if you mean make gtk2 (and _especially_
    Ian> gnome) a dependency of Emacs, I am most definitely against.

Me  too.   But  Carsten  means  to make  Emacs's  cut&paste  mechanism
*compatible* with  gtk2, kdelib,  etc.  (These libraries  emulates the
"clipboard" paradigm on  top of X selections, providing  some (but not
completely)  interoperability  with  clients  that only  understand  X
selections.   I   don't  like  it  either.)    This  involves  setting
interacting with the "CLIPBOARD" selection.  No need to use gtk2, etc.
You can do that in Xlib.


-- 
Lee Sau Dan                     李守敦(Big5)                    ~{@nJX6X~}(HZ) 

E-mail: danlee@informatik.uni-freiburg.de
Home page: http://www.informatik.uni-freiburg.de/~danlee

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: emacs doesn't use the X clipboard
  2004-01-13 11:23       ` Jens Schmidt
@ 2004-01-13 12:22         ` LEE Sau Dan
  2004-01-15 12:51           ` Kester Clegg
  2004-01-15 16:26           ` Jens Schmidt
  2004-01-13 14:38         ` Tim McNamara
  1 sibling, 2 replies; 33+ messages in thread
From: LEE Sau Dan @ 2004-01-13 12:22 UTC (permalink / raw)


>>>>> "Jens" == Jens Schmidt <Jens.Schmidt27@epost.de> writes:

    Jens> Same problems on my side: Mostly working on VNC-based X
    Jens> servers, a paste into Emacs sometimes works, sometimes not.

I also  once believed it to  be a VNC bug.   But when I  found that it
also happens without VNC, and it  only happens with Emacs, I know it's
Emacs's problem.


    Jens> I have isolated the problems a little bit, though.  Here is
    Jens> the exact scenario and my findings:
    ...


It's  amazing  that you  have  observed  so  many things.   I've  been
frustrated by this problem for years.  (I'm sure Emacs 19.34 never had
this problem.   Maybe neither did Emacs  20.* -- I'm  not sure.  Emacs
21.* always have this problem.)

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.



    Jens> 4. After a select in Solaris Emacs, paste into xterm,
    Jens> immediate new select in xterm and paste back into Solaris
    Jens> Emacs, a paste into Solaris Emacs (regardless whether from
    Jens> xterm or NT Emacs) works again.

I've also discovered this workaround.


Strangely, Emacs to  Emacs cut&paste seems to work  all the time, even
with multilingual text, as long as  the text is not too long.  (I wish
the multilingual cut&paste also work between Mozilla and Emacs.)



-- 
Lee Sau Dan                     李守敦(Big5)                    ~{@nJX6X~}(HZ) 

E-mail: danlee@informatik.uni-freiburg.de
Home page: http://www.informatik.uni-freiburg.de/~danlee

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: emacs doesn't use the X clipboard
       [not found]     ` <mailman.510.1073976607.928.help-gnu-emacs@gnu.org>
@ 2004-01-13 12:28       ` LEE Sau Dan
  2004-01-13 15:50         ` Maurizio Loreti
                           ` (2 more replies)
  0 siblings, 3 replies; 33+ messages in thread
From: LEE Sau Dan @ 2004-01-13 12:28 UTC (permalink / raw)


>>>>> "Eli" == Eli Zaretskii <eliz@elta.co.il> writes:

    >> Worse yet, this behaviour is quite random (to me).  Sometimes,
    >> C-y does paste from a selection (form whatever other
    >> X-clients).  Sometimes, it just pastes from the kill-ring, as
    >> if there were not selections at all.  I still haven't figured
    >> out the rules of when Emacs behaves one way and when the other.
    >> So, to me it's "random".

    Eli> Someone needs to debug this.  I don't think I've ever seen
    Eli> that on any of the machines I work on.

I'm not sure if this is platform or X-server dependent.  But I have to
add that  in the past few  years, I've been  working on XFree86/Linux.
XFree86 versions 3.6,  4.0, 4.1, 4.2.  Linux versions  2.2, 2.4.  Most
of the time, Emacs is run  on Linux (multiple Emacs processes from the
same or  different machines), but also occasionally  remote (even from
another continent) from Solaris and AIX.


    Eli> The only issue that comes to mind is that of non-ASCII
    Eli> characters in the X selection: perhaps some of the other
    Eli> applications encode selected text in a way that Emacs doesn't
    Eli> understand/support, or use some X selection type that Emacs
    Eli> didn't support (or still doesn't; you didn't say which
    Eli> version you are using).

Isn't the "ctext" sort of standard in X11R6?  I've tried many settings
with  M-x  set-clipping-coding-system,  and  never got  it  work  with
pasting Chinese (big5) from Mozilla.



-- 
Lee Sau Dan                     李守敦(Big5)                    ~{@nJX6X~}(HZ) 

E-mail: danlee@informatik.uni-freiburg.de
Home page: http://www.informatik.uni-freiburg.de/~danlee

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: emacs doesn't use the X clipboard
  2004-01-13 11:23       ` Jens Schmidt
  2004-01-13 12:22         ` LEE Sau Dan
@ 2004-01-13 14:38         ` Tim McNamara
  2004-01-13 22:19           ` LEE Sau Dan
  1 sibling, 1 reply; 33+ messages in thread
From: Tim McNamara @ 2004-01-13 14:38 UTC (permalink / raw)



Seems to work correctly in both directions on OS X 10.3.2 (although it
takes a little getting used to, the Mac OS cut/copy/paste conventions
do not include automatic copying to the clipboard)

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: emacs doesn't use the X clipboard
  2004-01-13 12:28       ` LEE Sau Dan
@ 2004-01-13 15:50         ` Maurizio Loreti
  2004-01-13 18:13           ` Gian Uberto Lauri
                             ` (2 more replies)
  2004-01-13 17:19         ` Eli Zaretskii
       [not found]         ` <mailman.542.1074014317.928.help-gnu-emacs@gnu.org>
  2 siblings, 3 replies; 33+ messages in thread
From: Maurizio Loreti @ 2004-01-13 15:50 UTC (permalink / raw)


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

> I'm not sure if this is platform or X-server dependent.  But I have to
> add that  in the past few  years, I've been  working on XFree86/Linux.
> XFree86 versions 3.6,  4.0, 4.1, 4.2.  Linux versions  2.2, 2.4.

I am not sure, but the Window Manager too (KDE, Gnome, wmaker, ...)
may be relevant for the clipboard management.

-- 
Maurizio Loreti                         http://www.pd.infn.it/~loreti/mlo.html
Dept. of Physics, Univ. of Padova, Italy              ROT13: ybergv@cq.vasa.vg

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: emacs doesn't use the X clipboard
  2004-01-13 12:28       ` LEE Sau Dan
  2004-01-13 15:50         ` Maurizio Loreti
@ 2004-01-13 17:19         ` Eli Zaretskii
       [not found]         ` <mailman.542.1074014317.928.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 33+ messages in thread
From: Eli Zaretskii @ 2004-01-13 17:19 UTC (permalink / raw)


> From: LEE Sau Dan <danlee@informatik.uni-freiburg.de>
> Newsgroups: gnu.emacs.help
> Date: 13 Jan 2004 13:28:32 +0100
> 
> I'm not sure if this is platform or X-server dependent.

How else can we explain the fact that I personally never saw this?

It could be application-specific, though (I mean the other apps,
those with which you are trying to exchange the text).

>     Eli> The only issue that comes to mind is that of non-ASCII
>     Eli> characters in the X selection: perhaps some of the other
>     Eli> applications encode selected text in a way that Emacs doesn't
>     Eli> understand/support, or use some X selection type that Emacs
>     Eli> didn't support (or still doesn't; you didn't say which
>     Eli> version you are using).
> 
> Isn't the "ctext" sort of standard in X11R6?

No.  Newer versions of X and/or some applications use UTF-8 etc.

In addition, the type of the selection is a parameter: some
applications use UTF_STRING and other types, which Emacs didn't
support until very recently.

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: emacs doesn't use the X clipboard
  2004-01-13 15:50         ` Maurizio Loreti
@ 2004-01-13 18:13           ` Gian Uberto Lauri
  2004-01-13 22:14           ` LEE Sau Dan
       [not found]           ` <mailman.545.1074017499.928.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 33+ messages in thread
From: Gian Uberto Lauri @ 2004-01-13 18:13 UTC (permalink / raw)
  Cc: help-gnu-emacs

>>>>> "ML" == Maurizio Loreti <mlo@foobar.it> writes:

ML> LEE Sau Dan <danlee@informatik.uni-freiburg.de> writes:
>> I'm not sure if this is platform or X-server dependent.  But I have
>> to add that in the past few years, I've been working on
>> XFree86/Linux.  XFree86 versions 3.6, 4.0, 4.1, 4.2.  Linux
>> versions 2.2, 2.4.

ML> I am not sure, but the Window Manager too (KDE, Gnome, wmaker,
ML> ...)  may be relevant for the clipboard management.

KDE &  Gnome are not  window managers and  so they could  interfere (i
don't know, I don't need desktops along with other things).

I'm using WindowMaker since 1995  on Solaris and Linux (that means two
different X11 implementations) and the  X clipboard worked in the same
way it worked when I used mwm, twm, fvwm and afterstep before.

Just my little 3 cents coin.

 /\            ___
/___/\__|_|\_|__|___Gian Uberto Lauri_____________________
  //--\ | | \|  |   Integralista GNUslamico e fancazzista 
\/

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: emacs doesn't use the X clipboard
  2004-01-13 12:06         ` LEE Sau Dan
@ 2004-01-13 18:35           ` Carsten Weinberg
  2004-01-14  6:37           ` Eli Zaretskii
                             ` (3 subsequent siblings)
  4 siblings, 0 replies; 33+ messages in thread
From: Carsten Weinberg @ 2004-01-13 18:35 UTC (permalink / raw)


> Me  too.   But  Carsten  means  to make  Emacs's  cut&paste  mechanism
> *compatible* with  gtk2, kdelib,  etc.  


Lee this is exactly what I mean. I am using emacs for more than 10 years, and I am a friend of gnome too. I'm really standing behind this great software. Therefore its clear, that I am very interested in a compatible emacs (copy&paste, drag&drop), what means adding some standards of freedesktop.org to emacs.

Cheers
-Carsten

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: emacs doesn't use the X clipboard
  2004-01-13 15:50         ` Maurizio Loreti
  2004-01-13 18:13           ` Gian Uberto Lauri
@ 2004-01-13 22:14           ` LEE Sau Dan
       [not found]           ` <mailman.545.1074017499.928.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 33+ messages in thread
From: LEE Sau Dan @ 2004-01-13 22:14 UTC (permalink / raw)


>>>>> "Maurizio" == Maurizio Loreti <mlo@foobar.it> writes:

    Maurizio> LEE Sau Dan <danlee@informatik.uni-freiburg.de> writes:
    >> I'm not sure if this is platform or X-server dependent.  But I
    >> have to add that in the past few years, I've been working on
    >> XFree86/Linux.  XFree86 versions 3.6, 4.0, 4.1, 4.2.  Linux
    >> versions 2.2, 2.4.

    Maurizio> I am not sure, but the Window Manager too (KDE, Gnome,
    Maurizio> wmaker, ...)  may be relevant for the clipboard
    Maurizio> management.

I've always been with FVWM2 since 1995.  I constantly upgrade my Linux
systems  (relying on  the  distribution's updates).   This  one on  my
laptop (Debian woody stable) is version 2.4.6.


-- 
Lee Sau Dan                     李守敦(Big5)                    ~{@nJX6X~}(HZ) 

E-mail: danlee@informatik.uni-freiburg.de
Home page: http://www.informatik.uni-freiburg.de/~danlee

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: emacs doesn't use the X clipboard
  2004-01-13 14:38         ` Tim McNamara
@ 2004-01-13 22:19           ` LEE Sau Dan
  0 siblings, 0 replies; 33+ messages in thread
From: LEE Sau Dan @ 2004-01-13 22:19 UTC (permalink / raw)


>>>>> "Tim" == Tim McNamara <timmcn@bitstream.net> writes:

    Tim> Seems to work correctly in both directions on OS X 10.3.2
    Tim> (although it takes a little getting used to, the Mac OS
    Tim> cut/copy/paste conventions do not include automatic copying
    Tim> to the clipboard)

There is no "automatic copying to the clipboard" in X.  The X paradigm
is: select-and-paste,  not copy-and-paste.   There is no  "copying" in
the  process, and  no clipboard  is  involved.  Say  it is  "automatic
copying" is simply wrong.

(Yes, if you like, you  can launch 'xclipboard' to emulate a clipboard
into which you  can copy.  But that's just an emulation  on top of the
select-and-paste paradigm.)

This is arguably more efficient,  because the copying is skipped.  So,
the  X-clients won't  transfer  large amounts  of  selected but  never
pasted data.  The data is transfered only when it is pasted.




-- 
Lee Sau Dan                     李守敦(Big5)                    ~{@nJX6X~}(HZ) 

E-mail: danlee@informatik.uni-freiburg.de
Home page: http://www.informatik.uni-freiburg.de/~danlee

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: emacs doesn't use the X clipboard
  2004-01-13 12:06         ` LEE Sau Dan
  2004-01-13 18:35           ` Carsten Weinberg
@ 2004-01-14  6:37           ` Eli Zaretskii
  2004-01-14  7:59             ` Micha Feigin
  2004-01-14  7:16           ` Micha Feigin
                             ` (2 subsequent siblings)
  4 siblings, 1 reply; 33+ messages in thread
From: Eli Zaretskii @ 2004-01-14  6:37 UTC (permalink / raw)


> From: LEE Sau Dan <danlee@informatik.uni-freiburg.de>
> Newsgroups: gnu.emacs.help
> Date: 13 Jan 2004 13:06:58 +0100
> 
>     Ian> I reported it to RMS, and he said "use gdb on Emacs".  Which
>     Ian> I won't, because recompiling Emacs on my laptop takes more
>     Ian> than an hour.
> 
> But how  would that help, if you're  not a C programmer  or you're not
> familiar with  Xlib, so that  you have no  idea of where to  put break
> points?

You can get help debugging Emacs on emacs-devel list.  The file
etc/DEBUG, which is a part of the distribution, should get you
started.

The code in Emacs that deals with X selections is in xselect.c.

> (BTW, it'd be  fun to run gdb under  Emacs, debugging another instance
> of Emacs.  I  hope one wouldn't be confused by  the two Emacses.  (-fg
> and -bg suddenly becomes invaluable!)

I've done that many times.  IMHO, there's no confusion because one
Emacs is in the GUD mode, which has some special features in its
display.

> I'm not sure if ltrace can show the Xlib calls, though.

I doubt that.  And debugging with ltrace or similar tools is not a
very efficient method, anyway, compared to stepping with GDB thru the
source code.  IMHO, ltrace is for the software to which you don't have
the sources.

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: emacs doesn't use the X clipboard
  2004-01-13 12:06         ` LEE Sau Dan
  2004-01-13 18:35           ` Carsten Weinberg
  2004-01-14  6:37           ` Eli Zaretskii
@ 2004-01-14  7:16           ` Micha Feigin
       [not found]           ` <mailman.606.1074062176.928.help-gnu-emacs@gnu.org>
       [not found]           ` <mailman.665.1074118187.928.help-gnu-emacs@gnu.org>
  4 siblings, 0 replies; 33+ messages in thread
From: Micha Feigin @ 2004-01-14  7:16 UTC (permalink / raw)


On Tue, Jan 13, 2004 at 01:06:58PM +0100, LEE Sau Dan wrote:
> >>>>> "Ian" == Ian Zimmerman <bayard@newsguy.com> writes:
> 
>     Carsten> Well, Lee you are right. I just experienced a lot of
>     Carsten> trouble copying text from gtk2-emacs to
>     Carsten> gtk2-mozilla-firebird and vice versa. Either via X
>     Carsten> selection or CUA-like key strokes. Sometimes it works,
>     Carsten> sometimes not.
> 
>     Ian> This has been discussed here at least twice before :-(
> 
>     Ian> I reported it to RMS, and he said "use gdb on Emacs".  Which
>     Ian> I won't, because recompiling Emacs on my laptop takes more
>     Ian> than an hour.
> 
> But how  would that help, if you're  not a C programmer  or you're not
> familiar with  Xlib, so that  you have no  idea of where to  put break
> points?
> 
> (BTW, it'd be  fun to run gdb under  Emacs, debugging another instance
> of Emacs.  I  hope one wouldn't be confused by  the two Emacses.  (-fg
> and -bg suddenly becomes invaluable!)
> 
> 
>     Ian> Maybe someone with more resources can follow this path and
>     Ian> finally get this fixed?
> 
> How about an  'ltrace'?  At least, it doesn't  require recompiling the
> binary.  I'm not sure if ltrace can show the Xlib calls, though.
> 
> 
>     Carsten> a good idea making emacs compatible to the gtk2 toolkit,
>     Carsten> and the gnome desktop environment.
> 
>     Ian> I don't get the connection here (how it would solve the
>     Ian> problem), and anyway if you mean make gtk2 (and _especially_
>     Ian> gnome) a dependency of Emacs, I am most definitely against.
> 
> Me  too.   But  Carsten  means  to make  Emacs's  cut&paste  mechanism
> *compatible* with  gtk2, kdelib,  etc.  (These libraries  emulates the
> "clipboard" paradigm on  top of X selections, providing  some (but not
> completely)  interoperability  with  clients  that only  understand  X
> selections.   I   don't  like  it  either.)    This  involves  setting
> interacting with the "CLIPBOARD" selection.  No need to use gtk2, etc.
> You can do that in Xlib.
> 

Someone suggested at the beginning of the thread to use
(setq x-select-enable-clipboard t)
>From the little testing I've done (haven't had to do much yet) it seems
to have solved the problem. Could other people seeing the same problem
try this and see if it helps ?
It could be that this is somehow set as a default behavior either
site-wide or at compile time ?

> 
> -- 
> Lee Sau Dan                     ?Z05biGVm-(Big5)                    ?{@nJX6X?}(HZ) 
> 
> E-mail: danlee@informatik.uni-freiburg.de
> Home page: http://www.informatik.uni-freiburg.de/?danlee
> _______________________________________________
> Help-gnu-emacs mailing list
> Help-gnu-emacs@gnu.org
> http://mail.gnu.org/mailman/listinfo/help-gnu-emacs
> 

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: emacs doesn't use the X clipboard
  2004-01-14  6:37           ` Eli Zaretskii
@ 2004-01-14  7:59             ` Micha Feigin
  2004-01-14 13:33               ` Eli Zaretskii
  0 siblings, 1 reply; 33+ messages in thread
From: Micha Feigin @ 2004-01-14  7:59 UTC (permalink / raw)


On Wed, Jan 14, 2004 at 08:37:26AM +0200, Eli Zaretskii wrote:
> > From: LEE Sau Dan <danlee@informatik.uni-freiburg.de>
> > Newsgroups: gnu.emacs.help
> > Date: 13 Jan 2004 13:06:58 +0100
> > 
> >     Ian> I reported it to RMS, and he said "use gdb on Emacs".  Which
> >     Ian> I won't, because recompiling Emacs on my laptop takes more
> >     Ian> than an hour.
> > 
> > But how  would that help, if you're  not a C programmer  or you're not
> > familiar with  Xlib, so that  you have no  idea of where to  put break
> > points?
> 
> You can get help debugging Emacs on emacs-devel list.  The file
> etc/DEBUG, which is a part of the distribution, should get you
> started.
> 
> The code in Emacs that deals with X selections is in xselect.c.
> 
> > (BTW, it'd be  fun to run gdb under  Emacs, debugging another instance
> > of Emacs.  I  hope one wouldn't be confused by  the two Emacses.  (-fg
> > and -bg suddenly becomes invaluable!)
> 

Off topic, but you want something confusing, trying running gdb inside
gdb while its debugging gcc. BTW IIRC it was compiling gdb at the time ;-)

> I've done that many times.  IMHO, there's no confusion because one
> Emacs is in the GUD mode, which has some special features in its
> display.
> 
> > I'm not sure if ltrace can show the Xlib calls, though.
> 
> I doubt that.  And debugging with ltrace or similar tools is not a
> very efficient method, anyway, compared to stepping with GDB thru the
> source code.  IMHO, ltrace is for the software to which you don't have
> the sources.
> 
> 
> 
> _______________________________________________
> Help-gnu-emacs mailing list
> Help-gnu-emacs@gnu.org
> http://mail.gnu.org/mailman/listinfo/help-gnu-emacs

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: emacs doesn't use the X clipboard
  2004-01-14  7:59             ` Micha Feigin
@ 2004-01-14 13:33               ` Eli Zaretskii
  0 siblings, 0 replies; 33+ messages in thread
From: Eli Zaretskii @ 2004-01-14 13:33 UTC (permalink / raw)


> Date: Wed, 14 Jan 2004 09:59:24 +0200
> From: Micha Feigin <michf@post.tau.ac.il>
> > 
> > > (BTW, it'd be  fun to run gdb under  Emacs, debugging another instance
> > > of Emacs.  I  hope one wouldn't be confused by  the two Emacses.  (-fg
> > > and -bg suddenly becomes invaluable!)
> > 
> 
> Off topic, but you want something confusing, trying running gdb inside
> gdb while its debugging gcc. BTW IIRC it was compiling gdb at the time ;-)

Close, but still no cigar: when GDB debugs itself, it changes the
prompt so that you can easily distinguish between the GDB being
debugged and the one that is used to debug.

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: emacs doesn't use the X clipboard
       [not found]         ` <mailman.542.1074014317.928.help-gnu-emacs@gnu.org>
@ 2004-01-14 21:34           ` LEE Sau Dan
  0 siblings, 0 replies; 33+ messages in thread
From: LEE Sau Dan @ 2004-01-14 21:34 UTC (permalink / raw)


>>>>> "Eli" == Eli Zaretskii <eliz@elta.co.il> writes:

    >> From: LEE Sau Dan <danlee@informatik.uni-freiburg.de>
    >> Newsgroups: gnu.emacs.help Date: 13 Jan 2004 13:28:32 퍝
    >> 
    >> I'm not sure if this is platform or X-server dependent.

    Eli> How else can we explain the fact that I personally never saw
    Eli> this?

Different usage patterns?  Do  you often cut&paste text between Emacs,
xterm and Mozilla?  I do it very very very often.


    Eli> It could be application-specific, though (I mean the other
    Eli> apps, those with which you are trying to exchange the text).

I  could be,  but I'd  say  it's unlikely.   Emacs quite  consistently
behave  like  that,  whether   I'm  using  xterm,  Mozilla,  Netscape,
GTK-based  things, etc.   And the  other apps  simply  cut&paste among
themselves happily without problems.  Emacs is the odd man here.

And I would  assume that xterm has been  programmed correctly, because
it's such a classical apps. that is so heavily used.  Perhaps I should
try also 'xedit', which uses the classical Athena widget set, which is
a sort  of "reference" implementation  of an application using  X, Xt,
Athena and X11.


    Eli> The only issue that comes to mind is that of non-ASCII
    Eli> characters in the X selection: 

I seldom cut&paste non-English  non-ASCII non-text stuff between xterm
and Emacs.  I'm sure that 99%  of the time that I encounter this Emacs
misbehaviour,  I'm  trying  to  cut&paste purely  ASCII  text.   URL's
(already URL-encoded) being a non-negligible portion of it.


    Eli> perhaps some of the other applications encode selected text
    Eli> in a way that Emacs doesn't understand/support, or use some X
    Eli> selection type that Emacs didn't support (or still doesn't;
    Eli> you didn't say which version you are using).

Unlikely.  See above.


    >> Isn't the "ctext" sort of standard in X11R6?

    Eli> No.  Newer versions of X and/or some applications use UTF-8
    Eli> etc.

Too bad that they don't follow the "standard".

But I've  tried also (set-clipboard-coding-system  'utf8).  It doesn't
work    with    Mozilla     when    I    cut&paste    Chinese    text.
(set-clipboard-coding-system  'iso-8859-1) does  make  Emacs cut&paste
German text from Emacs properly.  But  most of the time, I leave Emacs
with its default (i.e. using 'ctext' for the cut&paste).


    Eli> In addition, the type of the selection is a parameter: some
    Eli> applications use UTF_STRING and other types, which Emacs
    Eli> didn't support until very recently.

I  think xterm  always  uses SELECTION.   xterm  doesn't even  support
Unicode, let alone UTF-8.


-- 
Lee Sau Dan                     李守敦(Big5)                    ~{@nJX6X~}(HZ) 

E-mail: danlee@informatik.uni-freiburg.de
Home page: http://www.informatik.uni-freiburg.de/~danlee

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: emacs doesn't use the X clipboard
       [not found]           ` <mailman.606.1074062176.928.help-gnu-emacs@gnu.org>
@ 2004-01-14 21:40             ` LEE Sau Dan
  2004-01-17 18:41               ` Eli Zaretskii
  0 siblings, 1 reply; 33+ messages in thread
From: LEE Sau Dan @ 2004-01-14 21:40 UTC (permalink / raw)


>>>>> "Eli" == Eli Zaretskii <eliz@elta.co.il> writes:

    >> I'm not sure if ltrace can show the Xlib calls, though.

    Eli> I doubt that.  And debugging with ltrace or similar tools is
    Eli> not a very efficient method, anyway, compared to stepping
    Eli> with GDB thru the source code.  IMHO, ltrace is for the
    Eli> software to which you don't have the sources.

I don't agree.

Firstly, 'ltrace' doesn't require the program to be required.  So, you
can use it  immediately.  No downloading of the  source code.  No time
wasted on compiling.

Secondly, 'ltrace' let's you trace  the behaviour of your program at a
different  level.  That can  often reveal  what it  has done  (on that
level)  more   clearly,  because   you're  not  flooded   with  excess
information.  (I  did 'strace' some  programs to check  which syscalls
they  make,  and  in what  sequence.   That  can  be very  helpful  in
identifying problems  when you suspect  that the sequence of  calls is
not in  the correct order, which  you once assumed.   'strace' lets me
see more clearly how the program interacts with the OS.)


-- 
Lee Sau Dan                     李守敦(Big5)                    ~{@nJX6X~}(HZ) 

E-mail: danlee@informatik.uni-freiburg.de
Home page: http://www.informatik.uni-freiburg.de/~danlee

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: emacs doesn't use the X clipboard
       [not found]           ` <mailman.665.1074118187.928.help-gnu-emacs@gnu.org>
@ 2004-01-15 12:49             ` Kester Clegg
  2004-01-22 21:29               ` Jeff
  0 siblings, 1 reply; 33+ messages in thread
From: Kester Clegg @ 2004-01-15 12:49 UTC (permalink / raw)


Micha Feigin <michf@post.tau.ac.il> writes:

> Someone suggested at the beginning of the thread to use
> (setq x-select-enable-clipboard t)
>>From the little testing I've done (haven't had to do much yet) it seems
> to have solved the problem. Could other people seeing the same problem
> try this and see if it helps ?

It doesn't make a scrap of difference.
-- 
************************************************************************
Kester Clegg				Dept. of Computer Science,
Research Assistant (UTC)		University of York, 
Tel (01904) 43 27 49			email: kester at cs.york.ac.uk
************************************************************************

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: emacs doesn't use the X clipboard
  2004-01-13 12:22         ` LEE Sau Dan
@ 2004-01-15 12:51           ` Kester Clegg
  2004-01-15 21:44             ` LEE Sau Dan
  2004-01-15 16:26           ` Jens Schmidt
  1 sibling, 1 reply; 33+ messages in thread
From: Kester Clegg @ 2004-01-15 12:51 UTC (permalink / raw)


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

>     Jens> 4. After a select in Solaris Emacs, paste into xterm,
>     Jens> immediate new select in xterm and paste back into Solaris
>     Jens> Emacs, a paste into Solaris Emacs (regardless whether from
>     Jens> xterm or NT Emacs) works again.
>
> I've also discovered this workaround.

me too, it's sad to say.

-- 
************************************************************************
Kester Clegg				Dept. of Computer Science,
Research Assistant (UTC)		University of York, 
Tel (01904) 43 27 49			email: kester at cs.york.ac.uk
************************************************************************

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: emacs doesn't use the X clipboard
       [not found]           ` <mailman.545.1074017499.928.help-gnu-emacs@gnu.org>
@ 2004-01-15 12:54             ` Kester Clegg
  2004-01-15 21:56               ` LEE Sau Dan
  0 siblings, 1 reply; 33+ messages in thread
From: Kester Clegg @ 2004-01-15 12:54 UTC (permalink / raw)


GianUberto.Lauri@eng.it (Gian Uberto Lauri) writes:

> KDE &  Gnome are not  window managers and  so they could  interfere (i
> don't know, I don't need desktops along with other things).
>
> I'm using WindowMaker since 1995  on Solaris and Linux (that means two
> different X11 implementations) and the  X clipboard worked in the same
> way it worked when I used mwm, twm, fvwm and afterstep before.

Well I'm using fvwm2 and emacs does not receive a select n paste from
applications like xterms sometimes - something is definitely broken. It
seems to just keep what was uppermost in the kill ring and yanks that.

-- 
************************************************************************
Kester Clegg				Dept. of Computer Science,
Research Assistant (UTC)		University of York, 
Tel (01904) 43 27 49			email: kester at cs.york.ac.uk
************************************************************************

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: emacs doesn't use the X clipboard
  2004-01-13 12:22         ` LEE Sau Dan
  2004-01-15 12:51           ` Kester Clegg
@ 2004-01-15 16:26           ` Jens Schmidt
  1 sibling, 0 replies; 33+ messages in thread
From: Jens Schmidt @ 2004-01-15 16:26 UTC (permalink / raw)


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.).

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: emacs doesn't use the X clipboard
  2004-01-15 12:51           ` Kester Clegg
@ 2004-01-15 21:44             ` LEE Sau Dan
  2004-01-18 23:54               ` Ian Zimmerman
  0 siblings, 1 reply; 33+ messages in thread
From: LEE Sau Dan @ 2004-01-15 21:44 UTC (permalink / raw)


>>>>> "Kester" == Kester Clegg <kester@cs.york.ac.uk> writes:

    Kester> LEE Sau Dan <danlee@informatik.uni-freiburg.de> writes:
    Jens> 4. After a select in Solaris Emacs, paste into xterm,
    Jens> immediate new select in xterm and paste back into Solaris
    Jens> Emacs, a paste into Solaris Emacs (regardless whether from
    Jens> xterm or NT Emacs) works again.
    >>  I've also discovered this workaround.

    Kester> me too, it's sad to say.

So, all of us are too lazy to submit a bug report?  :)


-- 
Lee Sau Dan                     李守敦(Big5)                    ~{@nJX6X~}(HZ) 

E-mail: danlee@informatik.uni-freiburg.de
Home page: http://www.informatik.uni-freiburg.de/~danlee

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: emacs doesn't use the X clipboard
  2004-01-15 12:54             ` Kester Clegg
@ 2004-01-15 21:56               ` LEE Sau Dan
  0 siblings, 0 replies; 33+ messages in thread
From: LEE Sau Dan @ 2004-01-15 21:56 UTC (permalink / raw)


>>>>> "Kester" == Kester Clegg <kester@cs.york.ac.uk> writes:

    Kester> Well I'm using fvwm2 and emacs does not receive a select n
    Kester> paste from applications like xterms sometimes - 

And for a  few times when that happens, I  try to select&paste between
all other  X clients, including  the affected xterm.  Sometimes,  I do
that with clients  running from several remote machines.   All of them
select&paste  among themselves  happily.  However,  whenever I  try to
paste from  any of them into  emacs, emacs doesn't do  it as expected.
It  seems  to  me  that  emacs  doesn't  want  to  take  part  in  the
party... until I apply that magic workaround.


    Kester> something is definitely broken. It seems to just keep what
    Kester> was uppermost in the kill ring and yanks that.

Not  sure.  I guess  Emacs is  in some  situations unable  to properly
handle the X11 event which informs  it that it has lost the selection.
So, it still believes it owns the selection (which is kept as the last
item in  the kill ring).  A  paste thus pastes directly  from the kill
ring, not from the X selection.

There is another problem with  Emacs and X.  I can't remember anymore,
as I've  already given  up and  found some way  to work  around.  It's
about how Emacs reads  and interpret the user's application resources.
When a  resource is specified in  mulitple places, or  when a resource
name is matched by multiple resource entries specified with wildcards,
Emacs takens the wrong one.  Again, I'm too lazy to file a bug report.

(Don't take  me wrong.  I did file  bug reports a few  times for other
bugs.  I was so impressed that RMS  responded me in a few hours with a
patch that really fixed the bug!)


-- 
Lee Sau Dan                     李守敦(Big5)                    ~{@nJX6X~}(HZ) 

E-mail: danlee@informatik.uni-freiburg.de
Home page: http://www.informatik.uni-freiburg.de/~danlee

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: emacs doesn't use the X clipboard
  2004-01-14 21:40             ` LEE Sau Dan
@ 2004-01-17 18:41               ` Eli Zaretskii
  0 siblings, 0 replies; 33+ messages in thread
From: Eli Zaretskii @ 2004-01-17 18:41 UTC (permalink / raw)


> From: LEE Sau Dan <danlee@informatik.uni-freiburg.de>
> Newsgroups: gnu.emacs.help
> Date: 14 Jan 2004 22:40:01 +0100
> 
> >>>>> "Eli" == Eli Zaretskii <eliz@elta.co.il> writes:
> 
>     >> I'm not sure if ltrace can show the Xlib calls, though.
> 
>     Eli> I doubt that.  And debugging with ltrace or similar tools is
>     Eli> not a very efficient method, anyway, compared to stepping
>     Eli> with GDB thru the source code.  IMHO, ltrace is for the
>     Eli> software to which you don't have the sources.
> 
> I don't agree.

I guess we have different experience to draw upon, then.

My experience tells me that trace interpretation is a painstakingly
slow process, compared to stepping with a debugger.  It also requires
lots of knowledge of system internals, which many programmers lack.

By contrast, getting the sources and rebuilding with debug info is
nowadays a matter of several dozen minutes.

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: emacs doesn't use the X clipboard
  2004-01-15 21:44             ` LEE Sau Dan
@ 2004-01-18 23:54               ` Ian Zimmerman
  0 siblings, 0 replies; 33+ messages in thread
From: Ian Zimmerman @ 2004-01-18 23:54 UTC (permalink / raw)



Kester> me too, it's sad to say.

LEE> So, all of us are too lazy to submit a bug report?  :)

But it has been reported already, see my post.  You'll get nowhere
unless you do the gdb thing.

-- 
Nothing can be explained to a stone.
Or to a stoned person, either.

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: emacs doesn't use the X clipboard
  2004-01-15 12:49             ` Kester Clegg
@ 2004-01-22 21:29               ` Jeff
  0 siblings, 0 replies; 33+ messages in thread
From: Jeff @ 2004-01-22 21:29 UTC (permalink / raw)


On Thu, 15 Jan 2004 12:49:39 +0000, Kester Clegg wrote:

> Micha Feigin <michf@post.tau.ac.il> writes:
> 
>> Someone suggested at the beginning of the thread to use
>> (setq x-select-enable-clipboard t)
>>>From the little testing I've done (haven't had to do much yet) it seems
>> to have solved the problem. Could other people seeing the same problem
>> try this and see if it helps ?
> 
> It doesn't make a scrap of difference.

Wow. It certainly does on my machine. I tried putting the above in my
.emacs and it broke my ability to hilight in an xterm and paste it into
emacs. When I removed it again, it worked fine. 

-Jeff

^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2004-01-22 21:29 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-11  0:26 emacs doesn't use the X clipboard Micha Feigin
2004-01-11  5:46 ` Eli Zaretskii
     [not found] ` <mailman.387.1073803639.928.help-gnu-emacs@gnu.org>
2004-01-12 17:59   ` LEE Sau Dan
2004-01-13  0:18     ` Carsten Weinberg
     [not found]     ` <mailman.495.1073964322.928.help-gnu-emacs@gnu.org>
2004-01-13  5:00       ` Ian Zimmerman
2004-01-13 12:06         ` LEE Sau Dan
2004-01-13 18:35           ` Carsten Weinberg
2004-01-14  6:37           ` Eli Zaretskii
2004-01-14  7:59             ` Micha Feigin
2004-01-14 13:33               ` Eli Zaretskii
2004-01-14  7:16           ` Micha Feigin
     [not found]           ` <mailman.606.1074062176.928.help-gnu-emacs@gnu.org>
2004-01-14 21:40             ` LEE Sau Dan
2004-01-17 18:41               ` Eli Zaretskii
     [not found]           ` <mailman.665.1074118187.928.help-gnu-emacs@gnu.org>
2004-01-15 12:49             ` Kester Clegg
2004-01-22 21:29               ` Jeff
2004-01-13 11:23       ` Jens Schmidt
2004-01-13 12:22         ` LEE Sau Dan
2004-01-15 12:51           ` Kester Clegg
2004-01-15 21:44             ` LEE Sau Dan
2004-01-18 23:54               ` Ian Zimmerman
2004-01-15 16:26           ` Jens Schmidt
2004-01-13 14:38         ` Tim McNamara
2004-01-13 22:19           ` LEE Sau Dan
2004-01-13  6:48     ` Eli Zaretskii
     [not found]     ` <mailman.510.1073976607.928.help-gnu-emacs@gnu.org>
2004-01-13 12:28       ` LEE Sau Dan
2004-01-13 15:50         ` Maurizio Loreti
2004-01-13 18:13           ` Gian Uberto Lauri
2004-01-13 22:14           ` LEE Sau Dan
     [not found]           ` <mailman.545.1074017499.928.help-gnu-emacs@gnu.org>
2004-01-15 12:54             ` Kester Clegg
2004-01-15 21:56               ` LEE Sau Dan
2004-01-13 17:19         ` Eli Zaretskii
     [not found]         ` <mailman.542.1074014317.928.help-gnu-emacs@gnu.org>
2004-01-14 21:34           ` LEE Sau Dan
     [not found] <mailman.381.1073784888.928.help-gnu-emacs@gnu.org>
2004-01-11 13:02 ` Henrik Enberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).