From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#58608: 29.0.50; Nasty bug with pasting primary selection in term buffers Date: Thu, 20 Oct 2022 08:36:35 +0300 Message-ID: <835ygfys2k.fsf@gnu.org> References: <4b9aa5bac2d1bfe5af7c246ae9648c87@webmail.orcon.net.nz> <62d5bb83a2bd9e5464d198c4ad38ec77@webmail.orcon.net.nz> <83ilkgysxo.fsf@gnu.org> <2e5596b526f1cf77da9e162dc2cb8566@webmail.orcon.net.nz> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5359"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 58608@debbugs.gnu.org To: Phil Sainty Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 20 07:37:39 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 1olOFP-00019d-7a for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 20 Oct 2022 07:37:39 +0200 Original-Received: from localhost ([::1]:53264 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1olOFN-0003h9-Nc for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 20 Oct 2022 01:37:37 -0400 Original-Received: from [::1] (port=51158 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1olOFN-0003BI-Jf for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 20 Oct 2022 01:37:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54086) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1olOEo-00038r-4o for bug-gnu-emacs@gnu.org; Thu, 20 Oct 2022 01:37:07 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33618) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1olOEn-0004OY-TS for bug-gnu-emacs@gnu.org; Thu, 20 Oct 2022 01:37:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1olOEn-0001N3-Of for bug-gnu-emacs@gnu.org; Thu, 20 Oct 2022 01:37:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 20 Oct 2022 05:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58608 X-GNU-PR-Package: emacs Original-Received: via spool by 58608-submit@debbugs.gnu.org id=B58608.16662442205255 (code B ref 58608); Thu, 20 Oct 2022 05:37:01 +0000 Original-Received: (at 58608) by debbugs.gnu.org; 20 Oct 2022 05:37:00 +0000 Original-Received: from localhost ([127.0.0.1]:60928 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1olOEl-0001Mg-OS for submit@debbugs.gnu.org; Thu, 20 Oct 2022 01:37:00 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:49954) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1olOEi-0001MM-Q0 for 58608@debbugs.gnu.org; Thu, 20 Oct 2022 01:36:58 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:46150) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1olOEd-0004Mj-Bn; Thu, 20 Oct 2022 01:36:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=SWiJteSPWKzdu2t9bTOdp+pZbYMkPs7zW4Ec+3oDX/I=; b=E3DZ7/lO/Nqx wWIs6x1Y3EnyRxJhAplVsRUEHs5ctFxjzSw/80ZjlZ7+WVMw70DBD8AsAJ85h8u4b9mo8RI8SRqBy KBKQb947b5uPiuoFDfqIaxkzv2Wf3h+bbbdHfUqcAFgiOXKq6r29fTXskvQwUb7kio1jeGdsSJ6qn NwN+apE1OqSWLulzuJmtQECoaAxWq4j9+oMjSOxYcZbHk8z5Qt48QjoWgDO4OPGZjHnJaHQRt4OpW 2TMnzveOlAfvjUXvFZjYoRnWDN/E9KOKcuPCQIHPeQNQ9hpBVazmyFA38YlHzF6LiKT4/E0gc14G9 wXzFgEs+1soqirLTpmeMag==; Original-Received: from [87.69.77.57] (port=2349 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1olOEa-0007oc-Lj; Thu, 20 Oct 2022 01:36:48 -0400 In-Reply-To: <2e5596b526f1cf77da9e162dc2cb8566@webmail.orcon.net.nz> (message from Phil Sainty on Thu, 20 Oct 2022 11:14:50 +1300) 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:245918 Archived-At: > Date: Thu, 20 Oct 2022 11:14:50 +1300 > From: Phil Sainty > Cc: 58608@debbugs.gnu.org > > > I think it could be important to understand why select-active-regions > > causes this problem in your case. > > I think mechanically it's because the middle click moves point to the > click position, and the call to `deactivate-mark' then causes the > primary selection to be updated based on the current point and mark > (unless we mess with select-active-regions). > > You've made me wonder, though... this command is intended only for > term char mode, so should a middle click *really* be setting point? > If all we're trying to do is send the selection text to the inferior > process, that bit might be wrong. It could be, but maybe looking at the Git history of that code will tell you why we have that part there? I mean, maybe there are use cases where that is important? If nothing comes up, I think you are right, and that move should be removed. On a GUI frame, a middle click leaves point _at_the_end_ of the inserted text, not where I click. But if we aren't sure, it's okay to momentarily disable select-active-regions here, we just need a comment with the explanation you wrote above. > I'm now looking at that (setq this-command 'yank) as well, and > wondering whether it's important for anything under the impression > that a `yank' just happened to also see point at the location of > the yank. I'm not sure whether a middle click in a terminal to > send the primary selection directly to the inferior process *should* > be treated as `yank' though -- maybe that code is also wrong. Indeed, we don't by default treat middle click as yank on GUI frames. So maybe you are right -- but please note that there are some user options which perhaps do cause the middle click to be treated as yank as optional behavior, in which case they should do the same in the term case.