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

From: Po Lu <[email-masked]>
Date: Thu, 10 Feb 2022 09:56:08 +0800

Lars Ingebrigtsen <[email-masked]> writes:

> Ignacio Casso <[email-masked]> writes:
>
>> This would also answer my original question: unless there was a
>> timestamp in the clipboard Emacs has indeed no way to know right now if
>> the exact same string was copied to the clipboard again in-between (in
>> which case I would expect it to be pushed to the top of the kill-ring
>> again)
>
> On X (at the very least), the clipboard does have a timestamp, though.
> But we don't use it, which seems like the bug here.  Probably.
>
> Po Lu's done some work in this area lately; added to the CCs.

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.

Thanks.