Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problems with KDE and Clipboard.

96 views
Skip to first unread message

Ian Barton

unread,
Sep 26, 2012, 8:30:44 AM9/26/12
to help-gn...@gnu.org
Since upgrading to Emacs 24, I have been having problems copy/pasting
between Emacs and other X applications. I am using Archlinux with KDE
and my emacs is:

GNU Emacs 24.2.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.4.4)
of 2012-08-28 on shaun

Symptoms:

When I first start emacs I can copy/paste between something like Chrome
and Emacs without a problem. However, after a while items I select from
Klipper are not pasted into Emacs, but the last item from the Kill ring
gets pasted instead. If I restart Emacs it works as I would expect for a
certain number of copy pastes, but then the problem re-occurs.

Relevant sections from my .emacs:

(setq x-select-enable-clipboard t) ;use system clipboard
(setq mouse-drag-copy-region nil) ; stops selection with a mouse being
immediately injected to the kill ring
(setq x-select-enable-primary nil) ; stops killing/yanking interacting
with primary X11 selection
(setq x-select-enable-clipboard t) ; makes killing/yanking interact
with clipboard X11 selection

I have read the Emacs wiki page about clipboard interaction, but can't
see anything there that might help. My current setup works fine with
Emacs 23.

Ian.


alexandr...@gmail.com

unread,
Jan 19, 2014, 5:37:56 AM1/19/14
to
After a year, did you resolve your problem ? I'am interested since still suffering from the same problem.

Alexandre

Emanuel Berg

unread,
Jan 19, 2014, 3:09:55 PM1/19/14
to
alexandr...@gmail.com writes:

> After a year, did you resolve your problem ? I'am
> interested since still suffering from the same
> problem.

I spent so much time on this acursed X clipboard/Emacs
kill ring many years ago. Half of it worked, the other
half didn't. It always works to insert the X clipboard
at point (and then move point to the end of the
insertion). But to push an item to the X clipboard,
that process never completes. And I don't understand
that because that exact line works in the shell, in a
shell function, and in a script... (though not if the
script is called from Emacs). I'm absolutely sure: it
is a mystery.

(defun insert-X-clipboard ()
(interactive)
;; 1 below = into current buffer
(shell-command "xclip -d :0 -selection clipboard -o" 1)
(goto-char (mark)) )

(defun set-X-clipboard ()
(interactive)
(let ((str (shell-quote-argument
(string-make-unibyte (car kill-ring)) ))
(cmd "xclip -d :0 -selection clipboard") )
(shell-command (format "echo %s | %s" str cmd)) ))

(insert-X-clipboard) ; works
(set-X-clipboard) ; hangs

--
underground experts united:
http://user.it.uu.se/~embe8573

nljli...@gmail.com

unread,
Jan 23, 2014, 9:14:31 PM1/23/14
to
On Sunday, January 19, 2014 6:37:56 AM UTC-4, alexandr...@gmail.com wrote:
> Le mercredi 26 septembre 2012 14:34:03 UTC+2, Ian Barton a écrit :
>
>> Since upgrading to Emacs 24, I have been having problems copy/pasting
>> between Emacs and other X applications. I am using Archlinux with KDE
>> and my emacs is:
>>
>> GNU Emacs 24.2.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.4.4)
>> of 2012-08-28 on shaun
>>
>> Symptoms:
>> When I first start emacs I can copy/paste between something like Chrome
>> and Emacs without a problem. However, after a while items I select from
>> Klipper are not pasted into Emacs, but the last item from the Kill ring
>> gets pasted instead. If I restart Emacs it works as I would expect for a
>> certain number of copy pastes, but then the problem re-occurs.
>>
>> Ian.
>
> After a year, did you resolve your problem ? I'am interested since still suffering from the same problem.
>
> Alexandre

Well, (in a way) I'm glad I'm not the only one with this problem. I have it with GNU Emacs 24.3.1 on Fedora 19 and Gnome and enquired about it on this group on 2013-11-21 ("Intermittent problems with cut/copy and paste (using CUA keys) between Emacs and other programs") where I asked how to go about tracking down the bug, but got no response to that.

After Emacs has been running for a few days the problem starts to occur and I have both the OP's problem of Emacs failing to paste from the system clipboard and the reverse problem of Emacs failing to place cut/copied items into the system clipboard.

I've found that I don't have to restart Emacs to clear the problem; I can clear it (for a while) with a few copy/paste operations within Emacs. Of course that barely mitigates the problem.

As I use Emacs to compose emails / news posts that and then have to be pasted into web-based news/mail interfaces, this bug is a frequent annoyance.

I'd very much like to hear anyone's suggestions for tracking down the cause of the issue.

N. Jackson.

Emanuel Berg

unread,
Jan 23, 2014, 9:31:15 PM1/23/14
to
nljli...@gmail.com writes:

> As I use Emacs to compose emails / news posts that
> and then have to be pasted into web-based news/mail
> interfaces, this bug is a frequent annoyance.

Of course, you know about message-mode, RMAIL, and
Gnus? So you don't "have to" do anything, really.

nljli...@gmail.com

unread,
Jan 23, 2014, 11:31:59 PM1/23/14
to
On Thursday, January 23, 2014 10:31:15 PM UTC-4, Emanuel Berg wrote:
> Of course, you know about message-mode, RMAIL, and
> Gnus?

Indeed. But I don't have them set up satisfactorily yet for sending mail. However, your comment has prompted me to post a question in this group about that, which I hope you might comment on Emanuel -- last year I read with interest your various adventures in mail configuration.

As for posting news, I haven't found a good way to chose a news server. The one I have been using is read only (which is why I've been posting from a ghastly web interface). Meanwhile I don't want to randomly try other servers to see if I can find a better one, as there's that infamous comment in the Gnus manual that suggests that once you choose a server you're essentially stuck with it for the rest of your life!

Emanuel Berg

unread,
Jan 25, 2014, 8:17:30 AM1/25/14
to
nljli...@gmail.com writes:

> Indeed. But I don't have them set up satisfactorily
> yet for sending mail. However, your comment has
> prompted me to post a question in this group about
> that, which I hope you might comment on Emanuel --
> last year I read with interest your various
> adventures in mail configuration.

Gnus (or RMAIL) is actually not difficult to setup. But
Gnus is a program that really encompass a lot, so it is
easy to be overwhelmed in the beginning, and if you
feel confident with Emacs, you might expect to
understand everything (with Gnus) at once. All I can
say is that that didn't happen to me, for sure, so I
just fell back to the old "learn one new thing every
day".

In your case, as you use news (as well as mail), Gnus
makes the most sense.

Ken Goldman

unread,
Jan 27, 2014, 3:28:22 PM1/27/14
to help-gn...@gnu.org
My solution (for gnome, anyway) is parcellite.

This app just says, "Whatever I put in any one of the many Linux and
emacs clipboards ... copy it to all the other ones."

This doesn't track down the cause, nor does it fix it, but it makes cut
and paste work.

Emanuel Berg

unread,
Jan 27, 2014, 10:55:21 PM1/27/14
to
Ken Goldman <kgol...@us.ibm.com> writes:

> My solution (for gnome, anyway) is parcellite.
>
> This app just says, "Whatever I put in any one of the
> many Linux and emacs clipboards ... copy it to all
> the other ones."

If it works on the X terminals as well (the "readline"
stuff, for example urxvt-readline(1) for urxvt) that'd
be something.

But I don't feel like testing it because aptitude tells
me it will break xpdf (of all programs - on Debian
Lenny), and I spent some time configuring that.

But like I said, if they pulled that off, that'd be
impressive to say the least.

> This doesn't track down the cause, nor does it fix
> it, but it makes cut and paste work.

Which is what matters.

But, I think one should avoid copy/paste (and even
kill/yank) apart from the quick fix, or the exception
to the rule - when sending messages and quoting code,
man page paragraphs, and so on.

It doesn't make sense to have the same information in
multiple spots unless that is part of some automatized
scheme (backup, RAID, redundant DB/server/distributed
systems, caches and memory hierarchies, etc.). When it
is the result of one person killing and yanking
when-/wherever [s]he sees fit, that will just lead to
errors and "consistency stress".
0 new messages