GNU bug report logs -
#50067
Context menus
Previous Next
Reported by: Juri Linkov <juri <at> linkov.net>
Date: Sun, 15 Aug 2021 08:52:01 UTC
Severity: normal
Tags: fixed
Fixed in version 28.0.50
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
Message #243 received at 50067 <at> debbugs.gnu.org (full text, mbox):
>>>> On paste when there is a region and delete-selection-mode is t, the
>>>> region should be replaced by the text.
>>>
>>> Please explain how the region should be replaced by the text,
>>> when mouse-yank-at-click or mouse-yank-primary is used
>>> to paste where the mouse is clicked. Should it delete the region
>>> and paste where mouse is clicked on another part of the buffer?
>>> What if the mouse is clicked in another window?
>>
>> When there is a region and yank text by `C-y’, the text would
>> be replaced.
>>
>> I think when there is a region and point in on region, region
>> should be replaced by text. No?
>
> mouse-yank-at-click is intended to paste where you click.
> So when there is a region, and you click mouse-3 at some other position
> where you want to paste, and select "Paste" from the context-menu,
> it's unclear what to do with the region. It makes no sense
> to delete the region, when you paste at the clicked position
> outside of the region, but not on the region.
>
> Please see more in mouse-yank-at-click and mouse-yank-primary
> that contain such comment about the need to deactivate the region:
>
> ;; Without this, confusing things happen upon e.g. inserting into
> ;; the middle of an active region.
> (when select-active-regions
> (let (select-active-regions)
> (deactivate-mark)))
But maybe still it should delete the region before yanking?
I suggest to try these settings:
(put 'mouse-yank-primary 'delete-selection 'yank)
(put 'mouse-yank-at-click 'delete-selection 'yank)
(put 'menu-bar-select-yank 'delete-selection 'yank)
Then maybe they should be added to delsel.el.
This bug report was last modified 3 years and 171 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.