Subject: bug#64423: 29.0.92; save-interprogram-paste-before-kill doesn't prevent streaming large selections

From: Po Lu <[email-masked]>
Date: Thu, 06 Jul 2023 09:59:14 +0800

Spencer Baugh <[email-masked]> writes:

> And yet, we do this today: that's what x-selection-timeout does.  Should
> we remove that functionality?

[...]

> I assume we should not remove that functionality.  So if automatically
> interrupting a selection transfer if the owner takes too long is fine,
> what's the issue with interrupting it if the owner sends too much data?

Because sending a lot of data is *NOT* a bug in the selection owner.
Delaying subsequent user activity for a significant amount of time is.

> Both situations are usually the result of buggy X clients, both
> situations would break Emacs if not handled, both situations are
> standard considerations for robustness in any network protocol.

Blocking user interaction while quitting remains possible is not
``broken'' in my book.

> No, because then they are performing an operation which it makes sense
> might block: pasting data copied from another application.  In that
> situation, they are fine with it.

[...]

> No, there is no problem with other X clients.  It is simply that users
> expect delays when yanking and don't expect delays when killing.
>
> So, Emacs should be able to configure a different x-selection-timeout
> when running the save-interprogram-paste-before-kill logic, to reflect
> the fact that users have these different expectations for yanking and
> killing.  I don't see why this is objectionable.

Taking more than five seconds to yank points to a bug in whichever
client is owning the clipboard selection at the time of the yank.