Subject: Re: bug#56530: 29.0.50; mouse-2 cut selected text when cua-mode is enabled

From: Juri Linkov <[email-masked]>
Date: Thu, 14 Jul 2022 20:24:52 +0300

>> It should delete the region only when clicking on the selected region.
>> Maybe it's possible to add a corresponding function for the
>> 'delete-selection' property?
>
> Shouldn't be too difficult, but it seems like different people have
> different expectations of what should happen here, so I think having
> separate minor modes (or some user options) is probably the way to go.

There is already the minor mode: delete-selection-mode
that is configured by symbol properties.
Supporting a descriptive symbol name would allow to easily
configure the desired behavior with just:

  (put 'mouse-yank-at-click 'delete-selection 'yank-on-region)