unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* clipboard cut/paste problem
@ 2005-05-02  0:59 plaut
  2005-05-02  2:09 ` plaut
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: plaut @ 2005-05-02  0:59 UTC (permalink / raw)


I'm having a problem getting emacs (21.4.1 under Linux) to import text
from other applications via cut/paste.  I have the following in my
.emacs:

(setq-default x-select-enable-clipboard t)
(setq interprogram-paste-function 'x-cut-buffer-or-selection-value)

Pasting (e.g., with yank) from other programs via the clipboard works
fine *until* I cut something to the clipboard from within emacs (e.g.,
with kill-line).  From then on, emacs only pastes from its own cut
buffer, not from the clipboard.

Any suggestions?

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

* Re: clipboard cut/paste problem
  2005-05-02  0:59 clipboard cut/paste problem plaut
@ 2005-05-02  2:09 ` plaut
  2005-05-02 17:05 ` Peter Dyballa
       [not found] ` <mailman.444.1115053645.2819.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 7+ messages in thread
From: plaut @ 2005-05-02  2:09 UTC (permalink / raw)


I should also mention that if I set x-select-enable-clipboard to nil,
then clipboard-yank retrieves the clipboard contents fine.  I'd just
like to have this integrated with the standard keyboard/mouse yank
functions (which is what I thought x-select-enable-clipboard set to t
was supposed to accomplish).

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

* Re: clipboard cut/paste problem
  2005-05-02  0:59 clipboard cut/paste problem plaut
  2005-05-02  2:09 ` plaut
@ 2005-05-02 17:05 ` Peter Dyballa
       [not found] ` <mailman.444.1115053645.2819.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 7+ messages in thread
From: Peter Dyballa @ 2005-05-02 17:05 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 02.05.2005 um 02:59 schrieb plaut:

> I'm having a problem getting emacs (21.4.1 under Linux) to import text
> from other applications via cut/paste.  I have the following in my
> .emacs:
>
> (setq-default x-select-enable-clipboard t)

You shouldn't do that! By this means everything you kill in GNU Emacs 
is put into the X clipboard and another copy is put into the primary 
selection. This is pollution.

> (setq interprogram-paste-function 'x-cut-buffer-or-selection-value)
>
> Any suggestions?

Deliberately copy something into the clipboard that this gets shared 
among all X clients! Most of what you kill is obviously scrap, 
otherwise you wouldn't kill it, would you? Besides there are in GNU 
Emacs functions like clipboard-kill-region or clipboard-kill-ring-save. 
And check mouse-insert-selection! This is what I use to import 
something into GNU Emacs. And what about 
x-get-selection/x-get-cut-buffer?

--
Greetings

   Pete

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

* Re: clipboard cut/paste problem
       [not found] ` <mailman.444.1115053645.2819.help-gnu-emacs@gnu.org>
@ 2005-05-02 18:55   ` plaut
  2005-05-02 19:21     ` plaut
  0 siblings, 1 reply; 7+ messages in thread
From: plaut @ 2005-05-02 18:55 UTC (permalink / raw)


Thanks for the comments.  Using (mouse-sel-mode 1) with default
bindings has mouse-2 bound to mouse-insert-selection, and I can
initially use it to insert the clipboard contents from other programs
(independent of the kill-ring), but once I make a mouse selection
within emacs (mouse-1 drag), the region becomes the primary selection
and mouse-2 inserts it, but then copying to the clipboard from other
programs no longer sets the primary selection for emacs (i.e., mouse-2
continues to insert the last region selected within emacs).  This holds
even if (mouse-sel-mode 1) is the *only* line in .emacs.

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

* Re: clipboard cut/paste problem
  2005-05-02 18:55   ` plaut
@ 2005-05-02 19:21     ` plaut
  2005-05-07  4:23       ` Ian Zimmerman
       [not found]       ` <mailman.3841.1115440661.2819.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 7+ messages in thread
From: plaut @ 2005-05-02 19:21 UTC (permalink / raw)


Actually, I need to take that back.  Sometimes it works and sometimes
it doesn't (within only (mouse-select-mode 1) in .emacs).   very
strange.....

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

* Re: clipboard cut/paste problem
  2005-05-02 19:21     ` plaut
@ 2005-05-07  4:23       ` Ian Zimmerman
       [not found]       ` <mailman.3841.1115440661.2819.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 7+ messages in thread
From: Ian Zimmerman @ 2005-05-07  4:23 UTC (permalink / raw)



plaut> Actually, I need to take that back.  Sometimes it works and
plaut> sometimes it doesn't (within only (mouse-select-mode 1) in
plaut> .emacs).  very strange.....

I and others reported this here three times already (I think).  Once I
contacted RMS about it and he said to use gdb to debug.  Now imagine
tracing something like this with gdb!  Intermittent, requires multiple
programs, involves X server ... horror.  Not to speak about the
resources needed just to build emacs with full debugging info.

Looks like this will never get fixed unless someone is paid to
track it down.

If you still stand behind the hypothesis in your penultimate post
that selecting something in emacs triggers it, you got further than
I did, though.  Is that the case - your last post is ambiguous.

-- 
Optimist: We're only two weeks behind schedule.
Pessimist: The schedule is a whole two weeks ahead of us.

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

* Re: clipboard cut/paste problem
       [not found]       ` <mailman.3841.1115440661.2819.help-gnu-emacs@gnu.org>
@ 2005-05-10  1:53         ` plaut
  0 siblings, 0 replies; 7+ messages in thread
From: plaut @ 2005-05-10  1:53 UTC (permalink / raw)


> If you still stand behind the hypothesis in your penultimate post
> that selecting something in emacs triggers it, you got further than
> I did, though.  Is that the case - your last post is ambiguous.

yes, the problem seems to be triggered by a mouse selection (not just
by setting the region).  Up until that point, setting the clipboard in
another app (by cut/copy) sets the primary selection in emacs (which is
then inserted by mouse-insert-selection).  After an emacs mouse
selection, cut/copy elsewhere no longer sets the primary selection (nor
emacs' view of the clipboard, apparently, as clipboard-yank still
returns "Kill ring is empty").

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

end of thread, other threads:[~2005-05-10  1:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-02  0:59 clipboard cut/paste problem plaut
2005-05-02  2:09 ` plaut
2005-05-02 17:05 ` Peter Dyballa
     [not found] ` <mailman.444.1115053645.2819.help-gnu-emacs@gnu.org>
2005-05-02 18:55   ` plaut
2005-05-02 19:21     ` plaut
2005-05-07  4:23       ` Ian Zimmerman
     [not found]       ` <mailman.3841.1115440661.2819.help-gnu-emacs@gnu.org>
2005-05-10  1:53         ` plaut

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