Subject: bug#53894: 27.2; Clipboard copy -> C-y -> M-y -> Same clipboard copy does not push to kill ring

From: Eli Zaretskii <[email-masked]>
Date: Thu, 10 Feb 2022 08:20:28 +0200

> Cc: Ignacio Casso <[email-masked]>, [email-masked]
> Date: Thu, 10 Feb 2022 09:56:08 +0800
> From:  Po Lu via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email-masked]>
> 
> Every platform except MS-Windows has `x-selection-owner-p' or something
> to that effect which tells Emacs whether or not it was the last program
> to have saved to a selection (i.e., the clipboard, or the primary
> selection.)
> 
> On the platforms where it does work reliably, Emacs uses it to determine
> whether or not to return nil from the interprogram-paste-function, so I
> don't see a problem here.
> 
> Eli says MS-Windows also does something similar, but using a different
> mechanism.

Yes.  But (a) I don't think this report is about MS-Windows, and (b) I
haven't seen a complete reproduction recipe to try this on MS-Windows
and see how Emacs behaves there.  In general, on MS-Windows we do
internally something that closely emulates the ownership test, but it
cannot be 100% compatible for obvious reasons.

In addition, I believe the OP claims that the algorithm we use to
decide (on X) when to return nil is flawed, or at least ruins his use
case.  I don't think I succeed to understand the rationale for that
claim, FWIW.