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: Thu, 10 Feb 2022 14:20:15 +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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25315"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.6.10; emacs 27.2 Cc: Po Lu , 53894@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Feb 10 17:48:47 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 1nICcg-0006OI-D9 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 10 Feb 2022 17:48:46 +0100 Original-Received: from localhost ([::1]:40458 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nICcf-0007KI-D3 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 10 Feb 2022 11:48:45 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:58396) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nIAH8-0003d2-PP for bug-gnu-emacs@gnu.org; Thu, 10 Feb 2022 09:18:22 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60572) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nIAGn-0001iz-OX for bug-gnu-emacs@gnu.org; Thu, 10 Feb 2022 09:18:22 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nIAGn-0005iD-JL for bug-gnu-emacs@gnu.org; Thu, 10 Feb 2022 09:18:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ignacio Casso Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 10 Feb 2022 14:18:01 +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.164450263221883 (code B ref 53894); Thu, 10 Feb 2022 14:18:01 +0000 Original-Received: (at 53894) by debbugs.gnu.org; 10 Feb 2022 14:17:12 +0000 Original-Received: from localhost ([127.0.0.1]:54469 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nIAG0-0005gr-66 for submit@debbugs.gnu.org; Thu, 10 Feb 2022 09:17:12 -0500 Original-Received: from mail-vi1eur05olkn2039.outbound.protection.outlook.com ([40.92.90.39]:42080 helo=EUR05-VI1-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nIAFy-0005gZ-Oe for 53894@debbugs.gnu.org; Thu, 10 Feb 2022 09:17:11 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A98D0jV7JcyBAgjOOFkxQx69MjEwBXkxXVm9ikGFDXo0Pt/GJSH3TZHvzCg8eqGpmnexkUGcZVWdIzIk6Wc4/VxVaLHB9EtEdit0KQbxjLozxQQSlQ325NXJHI9vr0sNZfZX3lWAmwOLvahsHEiVzblgAXaZN+ZdovFhgAOiJNNnbuzCav/gaLp7qctPLpbtWKLQ+qcqdrV5g79ltGjH346us/homg0ATem5TkXiQSYZ6X8q8Pl5Ojdz84TWMkXZx7iAkMn2sVlqIFOPHPe9UDVNyePpYlHRCdyWwxY2uAgm0o3RVLm8D71EsEf7RmSOdiWxxuMqfqzjDFOUVAVVMw== 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=SJbjMc8QnuewKT90BnvWmievWVQBP6qjuIJv3ApA3+k=; b=Osp1ZbCQ7noXNWGk1xC+IWQ+ZsVMuGd1KrdDlWPIwf1Iy8KHivyxeTJjDDVqJSU+wXNMNuNjiQbA+0j/Df/2muCwb8+y5ZvgnTBczqt1/+Twt/gmG80KzobApiBrlAOak/EGc2QwoYN1LvsnaLN5+JpWUkBNB/KnC0R2dWukLOzrftBB4NKnyxPgDq5UBDtFUI77NnZlSCMcoco+CwasU/ll0dwXeIPa9YebbLQlXuVwaje13bnwVqZJNU19b0HmwYyKEURx6FE4oqeXNpwEhFQKt/JrlNh/M1oQrMLYIw1jpjlTurROSN4/oPajZ+Tnu25GGy9EVyTrX8IdZDstgQ== 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=SJbjMc8QnuewKT90BnvWmievWVQBP6qjuIJv3ApA3+k=; b=I4l03U7l26IXMO1R9Kb8QG5LB+wxxYUpK7evvLBZruO7480YbR7zFQLvIXRjymbs+CZZW319pRK7tWEqX6qpBVXlIZS7mdz7bz81i4rA5N0G5Xo7j/HVfJfzBzXAR8q2bl6UacvvgS+9FE1/oiE3SU58lxuN0ovAuyQPSdVunc5phKZniMhwYyR+TM5HQ0Z9E0+k69SRPk0KFuJX9Ra8WNDESLZ8Cay6RkIYC87/Ea1Z2blpQrxrVuj67BpGZRKVaOG4kpRapWrXrDENh8FSpOZlIKaikM3TURy0MSEmeZnNOT3hvc28pQ2b7SoJaNgmdneiacEVBya4KvIorujrRg== Original-Received: from PAXPR06MB7760.eurprd06.prod.outlook.com (2603:10a6:102:155::8) by PR1PR06MB5740.eurprd06.prod.outlook.com (2603:10a6:102:c::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11; Thu, 10 Feb 2022 14:17:04 +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.012; Thu, 10 Feb 2022 14:17:04 +0000 In-reply-to: <87iltm7upm.fsf@gnus.org> X-TMN: [phIz3ZpmYRYPFEFFTX1EoZcvQIZVPptc] X-ClientProxiedBy: MR2P264CA0163.FRAP264.PROD.OUTLOOK.COM (2603:10a6:501:1::26) To PAXPR06MB7760.eurprd06.prod.outlook.com (2603:10a6:102:155::8) X-Microsoft-Original-Message-ID: <87pmnurelg.fsf@hotmail.com> X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: be2ade73-d037-4af7-eedc-08d9eca00306 X-MS-TrafficTypeDiagnostic: PR1PR06MB5740:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QkVeELOTXCA8EE7OlAV3S0MQLRY+5q8w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8lB+cdGjdqbp5Vbn0WTdFDCgvZHEidM8G6O/xOEL3UIwdc3+jGT82aiHGdM8gtx01/ARmGUT2YxDe8iFy6kBDDWFbiVK1MSWhPCXDyVnWVvDYRueSFvWIo1xuzZERPLaVMkpHHDxX8IA7XGHurRoCfjS/mYQSzo9hPXGXQjN9HSqla3qDN03EQKkeusW68YNzU1eKknrzi9iycFAssVEeiDpYFoPX3PamEtGM/CufnJfka/VBjtmAxVdtZZd1HKQiazR2PaYV9A1/b8cuYalksb8qfXkgqNt5hiCExQYvLHWtFBk0bhCFg 8vlomiW2wCPArwjkXuXlDeVdgO3i/PH8uXSGz0Zi95Sr512bs18MDflc6BfyLjdkMGbDk+lwkcOOvbevxqDri/0GC8HPJ/A+P5 X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-6e454.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: be2ade73-d037-4af7-eedc-08d9eca00306 X-MS-Exchange-CrossTenant-AuthSource: PAXPR06MB7760.eurprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2022 14:17:04.3249 (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: PR1PR06MB5740 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:226610 Archived-At: Hi all, Did you read my last email? I think you got some things wrong. I'll explain it again inline. First, about my original concern: >> In addition, I believe the OP claims that the algorithm we use to >> decide (on X) when to return nil is flawed, or at least ruins his use >> case. I don't think I succeed to understand the rationale for that >> claim, FWIW. > > Here's the case to reproduce: > > In external program, "copy" a text > In Emacs: C-y M-y > In external program, "copy" the same text > In Emacs: C-y > > This C-y will not yank the text. Lars is right here >> So now the only issue left (for me) is that I don't think I understand >> why the OP doesn't like this: after all, the original text from the >> clipboard is still available in the kill ring, and can be pasted given >> enough M-y, or using the Edit menu-bar menu, or using the new feature >> of M-y when it is invoked not after C-y or another M-y. > > But it's surprising (and frustrating) to click on "Copy text" in a > different application and then (sometimes) not being able to yank it > with `C-y'. And here too. But I don't really care that much, I was just reporting it. As you said, you can find it in the kill ring or use clipboard-yank, and it's a really uncommon scenario. And now about the DWIM logic in gui-selection-value: > 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. > > But I haven't analysed the problem in depth, and I don't know how this > works on non-X systems -- perhaps that DWIM logic in gui-selection-value > is still necessary on some systems. That logic is still necessary. gui-selection-value is called every time we yank, and we only want it to return non-nil when there is something new there. If there is, it's pushed to the top of the kill ring and yanked, and from then onwards the kill ring handles it. Otherwise, i.e., if its the same as gui--last-selected-text-clipboard, it returns nil. So gui-selection-value will almost always return nil for that reason, and it's in fact gui-backend-selection-owner-p what is probably unnecessary, since it achieves the same as setting gui--last-selected-text-clipboard to the string being killed in the first place, which gui-select-text already does. In particular, removing that logic would not solve the problem I reported. The only way to solve it would be with clipboard timestamps, which are probably not worth to use if this is the only problem they solve (although I saw a comment about them being needed also to resolve discrepancies between clipboard and primary selection). Regards, --Ignacio