GNU bug report logs - #73830
using one expression to make multiple X selections

Previous Next

Package: emacs;

Reported by: libreville <libreville <at> riseup.net>

Date: Wed, 16 Oct 2024 01:26:02 UTC

Severity: normal

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: libreville <libreville <at> riseup.net>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: using one expression to make multiple X selections
Date: Wed, 16 Oct 2024 19:42:54 +0000
Hi there,

going by the list archive, my first email didn't go through. Here it is
again in case that's right:


Hello,

I stumbled on this while trying to elisp a few things into my X
clipboard manager. Evaluating these two expressions in turn:

(gui-set-selection 'CLIPBOARD "1")
(gui-set-selection 'CLIPBOARD "2")

results in both "1" and "2" being saved to the clipboard history.
However:

(progn
  (gui-set-selection 'CLIPBOARD "1")
  (gui-set-selection 'CLIPBOARD "2"))

results in "2" being saved to the clipboard history but, contrary to
what I would expect, not "1". On the other hand this:

(progn
  (gui-set-selection 'CLIPBOARD "3")
  (sleep-for 1)
  (gui-set-selection 'CLIPBOARD "4"))

gets both "3" and "4" onto the clipboard (history). I get similar
results with kill-new in place of gui-set-selection 'CLIBOARD and with
other ways of grouping the two kills into one expression.

Why does waiting work around the problem?

Tested with both copyq and clipman / Emacs 28.2 / Xfce.

Best,

liv.



On 2024-10-15 18:04, libreville wrote:
> My apologies, that should of course have read "sleep-for 1", not
> "wait-for 1".
> 
> On 2024-10-15 13:59, libreville wrote:
> 
>> 
>> (progn 
>>   (gui-set-selection 'CLIPBOARD "3")
>>   (wait-for 1)
>>   (gui-set-selection 'CLIPBOARD "4"))
>>




This bug report was last modified 300 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.