>> I wonder if we can tune it to detect that common case
>> while not triggering in your case.
>
> I think the key is to check not just whether the two strings are equal, but
> also whether the head of the kill-ring really comes from the currently
> active region. E.g. check that last-command is one that uses
> copy-region-as-kill.
Should we care only for situation of selecting and yanking with the mouse?
In this case we could check last-command-event for mouse keys.
I don't think that's enough. The selection may have been unchanged by the last command.
For example, with a single window in the frame, and using cua-selection-mode, select one word with the mouse, then select another word, then type "C-x o" (there's only one window, so this does nothing) then hit "C-y". The selected word isn't edited. Try the same but omit the "C-x o" step and the selected word is replaced by the previously selected word.