unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* gui-set-selection does not set Emacs' internal clipboard
       [not found] <9b8182a1-afc5-41ae-9bca-873795921705.ref@yahoo.de>
@ 2023-09-07 11:55 ` R. Diez
  2023-09-07 12:12   ` Po Lu
  0 siblings, 1 reply; 2+ messages in thread
From: R. Diez @ 2023-09-07 11:55 UTC (permalink / raw)
  To: Help Gnu Emacs mailing list

Hi all:

I have recently upgraded to Emacs 29.1, but I do not know whether I am hitting a new issue or regression, as I have always had Clipboard problems. Today I am trying to understand and fix one specific issue with gui-set-selection.

I have compiled Emacs myself on Ubuntu MATE 22.04.3.

I want Emacs' clipboard to behave like Microsoft Windows, GEdit, Pluma, usw., so I have set these variables:

(setq select-enable-clipboard t)
(setq select-active-regions nil)

Say I select and copy a piece of text in Emacs. Then I can paste the text both in Emacs and in an external editor like GEdit or Pluma. So far so good.

I have written an Emacs routine which converts something and places it in the X clipboard like this:

(gui-set-selection 'CLIPBOARD result)

Say I type, select and copy the piece of text "manual-text" in Emacs, and I then run my Emacs routine, which ends up placing in the clipboard the piece of text "from-gui-set-selection".

If I now paste inside Emacs, I get "manual-text". However, if I paste inside GEdit, Pluma, etc., I get "from-gui-set-selection".

That is, gui-set-selection is not updating Emacs' internal clipboard. Or perhaps Emacs does not realise that the X clipboard has changed when it was Emacs itself the one which just changed it.

If I now select a piece of text in GEdit, Pluma, etc. and copy it, then I can paste it into Emacs without trouble. Well, mostly, but that is an issue for another day.

I tried calling gui-set-selection again in my Emacs routine, but this time passing nil, 'PRIMARY or 'SECONDARY, to no avail. I must admit that I do not really understand how Emacs handles the clipboard.

Can somebody help?

Thanks in advance,
   rdiez



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

* Re: gui-set-selection does not set Emacs' internal clipboard
  2023-09-07 11:55 ` gui-set-selection does not set Emacs' internal clipboard R. Diez
@ 2023-09-07 12:12   ` Po Lu
  0 siblings, 0 replies; 2+ messages in thread
From: Po Lu @ 2023-09-07 12:12 UTC (permalink / raw)
  To: R. Diez; +Cc: Help Gnu Emacs mailing list

"R. Diez" <rdiezmail-emacs@yahoo.de> writes:

> That is, gui-set-selection is not updating Emacs' internal
> clipboard.

This is intentional; if you want it to, save the text to the kill ring
instead.



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

end of thread, other threads:[~2023-09-07 12:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <9b8182a1-afc5-41ae-9bca-873795921705.ref@yahoo.de>
2023-09-07 11:55 ` gui-set-selection does not set Emacs' internal clipboard R. Diez
2023-09-07 12:12   ` Po Lu

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