From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#56530: 29.0.50; mouse-2 cut selected text when cua-mode is enabled Date: Fri, 22 Jul 2022 17:07:12 +0200 Message-ID: <877d4589un.fsf@gnus.org> References: <3c83c124-95a9-9dc6-a7a6-6e357c7574e4@orange.fr> <877d4hmjdh.fsf@gmail.com> <87lesxtivx.fsf@gnus.org> <87wnchl1fm.fsf@gmail.com> <86mtdcg6qr.fsf@mail.linkov.net> <87edyna9wy.fsf@gnus.org> <867d4fa9p7.fsf@mail.linkov.net> <87h73j7epu.fsf@gnus.org> <86edym1a36.fsf@mail.linkov.net> <8735f1tkg2.fsf@gnus.org> <86r12j5yya.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38664"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: David Ponce , 56530@debbugs.gnu.org, Visuwesh To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 22 17:08:12 2022 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 1oEuGB-0009sH-Fp for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 22 Jul 2022 17:08:11 +0200 Original-Received: from localhost ([::1]:42228 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oEuGA-0005LN-0J for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 22 Jul 2022 11:08:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37648) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEuG2-0005Iz-9z for bug-gnu-emacs@gnu.org; Fri, 22 Jul 2022 11:08:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52404) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oEuG2-00022V-1G for bug-gnu-emacs@gnu.org; Fri, 22 Jul 2022 11:08:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oEuG1-0006oE-Sj for bug-gnu-emacs@gnu.org; Fri, 22 Jul 2022 11:08:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 22 Jul 2022 15:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56530 X-GNU-PR-Package: emacs Original-Received: via spool by 56530-submit@debbugs.gnu.org id=B56530.165850244526107 (code B ref 56530); Fri, 22 Jul 2022 15:08:01 +0000 Original-Received: (at 56530) by debbugs.gnu.org; 22 Jul 2022 15:07:25 +0000 Original-Received: from localhost ([127.0.0.1]:42147 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oEuFR-0006n0-Dy for submit@debbugs.gnu.org; Fri, 22 Jul 2022 11:07:25 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:39746) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oEuFP-0006mi-RA for 56530@debbugs.gnu.org; Fri, 22 Jul 2022 11:07:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=oOYvb8jUj7Gvxkg+Easx2r8accZnh2OP9YmgUlcI844=; b=BIhowOrot104up9dLQ+mMl5WQR gjjRVOkayrJPmD3iNwnWBo6ZaqCYBvZM7IlgB3dBn1HQ2sHEsbvxva3G9yOHDmdMXT+It6TQeH7Hc PjhmfOj7J5zd6tX4O6k6xA8PcPqXFC5tY60I6lMlhL4JJdBOQg1jXzpRlEoHH3KxB3fI=; Original-Received: from 46.156.37.168.tmi.telenormobil.no ([46.156.37.168] helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oEuFG-00007Y-HU; Fri, 22 Jul 2022 17:07:17 +0200 In-Reply-To: <86r12j5yya.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 17 Jul 2022 21:49:41 +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:237635 Archived-At: Juri Linkov writes: > All affected mouse commands mouse-yank-from-menu, mouse-yank-at-click, > mouse-yank-primary, mouse-yank-secondary have the same line: > > (or mouse-yank-at-point (mouse-set-point event)) > > So when the region is deleted by delete-selection-pre-hook > `mouse-set-point' tries to set point using outdated information > of the event's position in the deleted region. > > Maybe delete-selection-pre-hook could directly modify the event? > Everything works fine with this: > > ((eq type 'yank-on-region) > (let ((pos (posn-point (event-end last-nonmenu-event)))) > (when (and (>= pos (region-beginning)) > (<= pos (region-end))) > (delete-selection-helper 'yank) > (setf (nth 5 (nth 1 last-nonmenu-event)) (region-beginning))))) > > But is this a good idea? It sounds kinda gross. Would it be possible to rewrite these commands to that point is set before the deletion is done, or is that unfeasible? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no