Subject: Re: bug#40375: 27.0.50; yank unexpectedly depends on progn

From: Markus Triska <[email-masked]>
Date: Mon, 13 Apr 2020 20:01:13 +0200

Andreas Schwab <[email-masked]> writes:

> What does your interprogram-paste-function return?

Its value is `gui-selection-value'.

I have now repeatedly tried it, and sometimes it indeed works as
expected (i.e., the image is inserted), but I can reliably trigger the
problem when I:

1. open Firefox and browse to the description of this bug, i.e.:
   https://debbugs.gnu.org/cgi/bugreport.cgi?bug=403752
2. click on the URL bar, so that the text in the URL becomes selected
3. switch to a terminal application using only the keyboard, and then,
   from the terminal, perform the steps I outlined.

In this case, the text that is inserted is not the expected image that
was most recently killed in Emacs, but rather the URL from Firefox that
is selected in that application.

I can reproduce this with XQuartz 1.18.4 (xorg-server 1.18.4) on OSX.

Is it possible that yanking in Emacs does not work as expected when text
is selected in other applications on this platform?

Once this issue occurs, what is yanked is no longer predictable for me:
Sometimes it is text that is selected in other applications, sometimes
it is text that was copied to the clipboard from other applications, but
is no longer selected. It feels like there is no clear pattern.

What I would prefer in all these cases is that Emacs yank the text that
was most recently killed in this example, which is the sample image that
you can reproduce.

Thank you and all the best,
Markus