From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ignacio Casso Newsgroups: gmane.emacs.bugs Subject: bug#53894: 27.2; Clipboard copy -> C-y -> M-y -> Same clipboard copy does not push to kill ring Date: Fri, 11 Feb 2022 12:28:08 +0100 Message-ID: References: <87mtj0l0wp.fsf@gnus.org> <87r18bg59w.fsf@gnus.org> <87wni3zdqf.fsf@yahoo.com> <838rujutsj.fsf@gnu.org> <87a6ezfcnc.fsf@gnus.org> <83zgmztabd.fsf@gnu.org> <8735kr9kmp.fsf@gnus.org> <83pmnuudo6.fsf@gnu.org> <87ee4ayl3n.fsf@yahoo.com> <83k0e2ucq7.fsf@gnu.org> <877da2yjze.fsf@yahoo.com> <87iltm7upm.fsf@gnus.org> <87leyiw6uu.fsf@yahoo.com> <87wni1tzzl.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6903"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.6.10; emacs 27.2 Cc: Lars Ingebrigtsen , 53894@debbugs.gnu.org To: Po Lu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 11 14:06:55 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 1nIVdW-0001bB-Hq for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 11 Feb 2022 14:06:54 +0100 Original-Received: from localhost ([::1]:52524 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nIVdV-0007SZ-CE for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 11 Feb 2022 08:06:53 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:42474) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nIV11-0005sk-OY for bug-gnu-emacs@gnu.org; Fri, 11 Feb 2022 07:27:07 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36392) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nIV0w-0006Nh-Ac for bug-gnu-emacs@gnu.org; Fri, 11 Feb 2022 07:27:07 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nIV0w-0007yL-7q for bug-gnu-emacs@gnu.org; Fri, 11 Feb 2022 07:27:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ignacio Casso Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 11 Feb 2022 12:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53894 X-GNU-PR-Package: emacs Original-Received: via spool by 53894-submit@debbugs.gnu.org id=B53894.164458236730582 (code B ref 53894); Fri, 11 Feb 2022 12:27:02 +0000 Original-Received: (at 53894) by debbugs.gnu.org; 11 Feb 2022 12:26:07 +0000 Original-Received: from localhost ([127.0.0.1]:58522 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nIV03-0007xC-0H for submit@debbugs.gnu.org; Fri, 11 Feb 2022 07:26:07 -0500 Original-Received: from mail-oln040092069067.outbound.protection.outlook.com ([40.92.69.67]:53809 helo=EUR02-VE1-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nIV01-0007wd-RH for 53894@debbugs.gnu.org; Fri, 11 Feb 2022 07:26:06 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kRnEQexVYGpskgzfnTx//bdFqaIutvd+KX0xq/qdUsirdOc0n5zi82RwzKiIqa4skJFObGI9m9uTGxeRKbqW+OHreaANvjQ8y0lImqQCBPgQ0RBm6PTRlZ+6gq3cDe3J5KQqILFO/p01ex2kfDR/TL6wU6TuIdZOmScoSSIz6U2v5mJm6zAkRxerGqaIb1VymnPt2qZuq824daBnVF3cZyTWg5xT/IfOE5bHrQ0NU3MNl1piUJoCQDcMAWcBsMFwe8PWQ1Y8eB9vGYYWWSCswS2l5t6rh9QQtIaFlZH24u6nH7qAn2GJOqRf7iYmRFX9h4VC/YKaYJsTJP6xWC0L7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ChZjY6268gb5VdgkgYW3F90evVWCzfcxh5ChTmBCMBY=; b=k9XuwunYBqKALNNB2kg+nIkdPACBzlhYOKj+ULl7787wkbd5pp3JlWKZvPsfrS6UGs2JBt68eJ6BNpXGFBhiQOZ8zZrcwciukwr4CNjllVlsFr9tPE3f6GmEhIXDTG81Xwt/FI69bTTjEHLzMU/ZCJZ4TWFElIDJ6IEoVUVzofMohapH3JANFdGqaq9TmKjOtqEeA9BWJpPZrkzPYoWdDUuyCIyYcmQJf0eFACFatBnwXxc6IlmeFAneJzVoi72RaG9GLLKK0AIchVtSg/TYoE5PgJIZxV40ehPCZhu/yrIeeD12F2F2eJcmffZ0zsXbfwPlNqTYmoPAbYMJCQE//Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ChZjY6268gb5VdgkgYW3F90evVWCzfcxh5ChTmBCMBY=; b=jkpjS7vyMU5dwfExgcwVkyh3AO5pCVDXUwQe8fEOqU7vkQA84z5dC6rsVcCYBSycNJjj44wXr8NrqbDYL++dXIuFmxEwxbiBHac0azb2pdoycOGRgZcu3yIMiGz9xeXdTTjF6cso4pbVYuqcpnkmk180anEq117MQfBJqQEpT3kmY1mRygId1aMf1VvXUymsJFKMU0IJD8GuKMVLsjHJIuQnadma85xODQ6KknlTu0JVMSWCx34vQugsJvxSPgc0D3LF4jBEqaSWqRtM46/bRFbRrfHvqVCywmtPOm/zkQCRJf1bGfeJdaFub7+u6XQYdIEJl7RYgvlVR7PPL65cCA== Original-Received: from PAXPR06MB7760.eurprd06.prod.outlook.com (2603:10a6:102:155::8) by DB9PR06MB7372.eurprd06.prod.outlook.com (2603:10a6:10:23e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.12; Fri, 11 Feb 2022 12:25:59 +0000 Original-Received: from PAXPR06MB7760.eurprd06.prod.outlook.com ([fe80::50de:9162:7856:2782]) by PAXPR06MB7760.eurprd06.prod.outlook.com ([fe80::50de:9162:7856:2782%6]) with mapi id 15.20.4975.015; Fri, 11 Feb 2022 12:25:59 +0000 In-reply-to: <87wni1tzzl.fsf@yahoo.com> X-TMN: [/GIs7RxRCdhRLK0nX0X2U2+kMnpc7Bbd] X-ClientProxiedBy: MR2P264CA0004.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:1::16) To PAXPR06MB7760.eurprd06.prod.outlook.com (2603:10a6:102:155::8) X-Microsoft-Original-Message-ID: <87zgmx37ze.fsf@hotmail.com> X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dee8c972-1123-4989-8a56-08d9ed59a8a7 X-MS-TrafficTypeDiagnostic: DB9PR06MB7372:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-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QiiAX9yq7J9ljGlpOjLbtuiY0cnShoU0sz5QIXVw6Ls+T3haJs1QRRbix98LCyUJ+8RtD+EeESGFNLHdZFph8gZv5bL5MfZSZbLB5SjSq1cF//z6bDR487pu/XOnFa5ZJpllN5nhgBnIbi5fbHYGqBQo4XQljy+YZvbg81nn2CR6UaDas/gT+qvdaig53IngyxTVBZIo6f8KMmyNEWpaCrthJDTPkDCn5itqBm7QPVDYrRerCkERBa1tzFO6aUUy+PIfn20UShqHGahoMxiUhqFaZ5birT+N1x+Tsyq6djngq5XV792iY8G1lAZuUsIqBd6Luh94MJBamZ3D8Jju80 YtjXMZEHCFnVheGJK50E4nCUKLjePrhTbFcYKbRFL/H5o7GEyyVBxemfrQ6mtZmS+nSW5JGFsU3z7VFMeaUERBBNe4EgoHckau X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-6e454.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: dee8c972-1123-4989-8a56-08d9ed59a8a7 X-MS-Exchange-CrossTenant-AuthSource: PAXPR06MB7760.eurprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2022 12:25:59.0497 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR06MB7372 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:226666 Archived-At: Well my point in this case was gui--last-selected-text-clipboard being still necessary, since you were suggesting to remove it in the email thread: >> No, the problem is still present on the trunk. But I suspect that after >> you introduced the `gui-backend-selection-owner-p' test in >> gui--selection-value-internal, the logic surrounding >> gui--last-selected-text-clipboard in gui-selection-value is no longer >> necessary, and should just be removed now. > > Indeed, it should be removed for the platforms where > `gui-backend-selection-owner-p' does work. I'll explain what I mean one final time since you have not really addressed it yet, so I don't know if I'm wrong or you didn't understood what I meant. Otherwise I'll leave it at that, since there is no point in having this discussion while I'm running Emacs 27 and have to look at the most recent code in Github. I'll go step by step: - gui-selection-value is called every time we yank (of course, since we need to know if anything new was added to the clipboard) - When it returns non-nil, the text is pushed to the kill ring, according to C-h v interprogram-paste-function. From then onwards we want the kill ring to handle it. - Therefore, the next time we yank, we don't want gui-selection-value to return the clipboard again, since it's already in the kill-ring, and it would be pushed again, duplicating the top of the kill-ring, or if it had rotated, pushing down the current top. - Thus we need a mechanism to ensure we return nil if the clipboard has not changed. I understand that originally it was checking if the text was the same with gui--last-selected-text-clipboard. - It was my impression that you though in the email thread of bug #27442 that the only reason behind that variable was checking that it was not Emacs itself the one that had copied to the clipboard, in which case we also would want get-selection-value to return nil since the text would also be in the kill ring already. I pointed in my second email that the reason I just explained may be another, equally important reason, and insisted in the third. - In my last emails I though, wrongly, that in Emacs 28 that mechanism had been replaced by asserting selection ownership (without altering the selection text, so other programs don't know the difference) as soon as the selection was read, and checking whether ownership had changed. This assumption was reinforced by you suggesting that gui--last-selected-text-clipboard was no longer necessary, which would indeed be true in that case, but not now, and you suggesting that removing it would fix the bug I originally posted, which again would be true in that case, but it is not now (it would, but it would introduce new, worse bugs). I hope it is clearer now what I mean. Of course it all could be that my mental model of clipboards or my understanding of gui-backend-selection-value are still wrong: all this depends on my assumption that repeated calls to gui-selection-value would return the clipboard text over and over again as long as Emacs does not kill or other application copies to the clipboard. Regards, Ignacio Po Lu writes: > Ignacio Casso writes: > >> One final question. Does then Emacs assert ownership of the selection >> also when it reads it (C-y) > > Not that I know of, no; the ownership remains unchanged. > >> and not only when it sets it (C-k), as I assumed in my last email? >> Because otherwise I think my point still holds > > AFAIU the problem is that if you do this: > > - Kill some text in Emacs > - C-y > - Cut the same text in another program > > then that same text is not pushed onto the kill ring again, when you > press C-y. I don't understand why Emacs would have to own the clipboard > in order to fix that. > > Thanks.