From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#50067: Context menus Date: Tue, 31 Aug 2021 20:37:54 +0300 Message-ID: <87y28hpktx.fsf@mail.linkov.net> References: <74BC00E9-2509-47DA-9428-1523FF7F3B33@acm.org> <87v942pvcj.fsf@mail.linkov.net> <004A628A-99CC-4C62-8AE2-921C4C38D42A@acm.org> <87h7fkh8z8.fsf@mail.linkov.net> <060413B6-E0EF-491D-986F-3988C255729F@misasa.okayama-u.ac.jp> <87lf4tews5.fsf@mail.linkov.net> <00A9BE5A-D661-42AF-A65B-3B80C7428121@misasa.okayama-u.ac.jp> <87wnociu41.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23639"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: 50067@debbugs.gnu.org To: Tak Kunihiro Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 31 20:06:17 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mL89G-0005ph-TP for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 31 Aug 2021 20:06:14 +0200 Original-Received: from localhost ([::1]:48248 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mL89F-0008SH-51 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 31 Aug 2021 14:06:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33706) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL894-0008Rt-Td for bug-gnu-emacs@gnu.org; Tue, 31 Aug 2021 14:06:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52041) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mL894-0008V8-Ls for bug-gnu-emacs@gnu.org; Tue, 31 Aug 2021 14:06:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mL894-0001E8-BC for bug-gnu-emacs@gnu.org; Tue, 31 Aug 2021 14:06:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 31 Aug 2021 18:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50067 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed Original-Received: via spool by 50067-submit@debbugs.gnu.org id=B50067.16304331344655 (code B ref 50067); Tue, 31 Aug 2021 18:06:02 +0000 Original-Received: (at 50067) by debbugs.gnu.org; 31 Aug 2021 18:05:34 +0000 Original-Received: from localhost ([127.0.0.1]:35348 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mL88c-0001D1-AB for submit@debbugs.gnu.org; Tue, 31 Aug 2021 14:05:34 -0400 Original-Received: from relay8-d.mail.gandi.net ([217.70.183.201]:47813) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mL88X-0001Cf-Na for 50067@debbugs.gnu.org; Tue, 31 Aug 2021 14:05:33 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 09D9F1BF20D; Tue, 31 Aug 2021 18:05:19 +0000 (UTC) In-Reply-To: <87wnociu41.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 23 Aug 2021 10:24:22 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:213118 Archived-At: >>>> 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.