From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" 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: Mon, 28 Feb 2022 21:48:23 +0800 Message-ID: <87czj73xw8.fsf@yahoo.com> References: <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> <87pmnttw78.fsf@yahoo.com> <87leyhtv9q.fsf@yahoo.com> <87wni0str6.fsf@yahoo.com> <87h78j6bz0.fsf@yahoo.com> Reply-To: Po Lu Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13152"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) Cc: Lars Ingebrigtsen , 53894@debbugs.gnu.org, Eli Zaretskii To: Ignacio Casso Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 28 15:03:31 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 1nOgcd-0003Cd-Cv for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 28 Feb 2022 15:03:31 +0100 Original-Received: from localhost ([::1]:44586 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nOgcb-0001xP-TS for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 28 Feb 2022 09:03:29 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:39332) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nOgOc-0000Qm-PY for bug-gnu-emacs@gnu.org; Mon, 28 Feb 2022 08:49:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38432) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nOgOc-0007s4-GJ for bug-gnu-emacs@gnu.org; Mon, 28 Feb 2022 08:49:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nOgOc-0008V0-Ey for bug-gnu-emacs@gnu.org; Mon, 28 Feb 2022 08:49:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 28 Feb 2022 13:49: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.164605612032642 (code B ref 53894); Mon, 28 Feb 2022 13:49:02 +0000 Original-Received: (at 53894) by debbugs.gnu.org; 28 Feb 2022 13:48:40 +0000 Original-Received: from localhost ([127.0.0.1]:60562 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOgOF-0008UQ-Ls for submit@debbugs.gnu.org; Mon, 28 Feb 2022 08:48:39 -0500 Original-Received: from sonic303-21.consmr.mail.ne1.yahoo.com ([66.163.188.147]:44634) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOgOD-0008UC-Lg for 53894@debbugs.gnu.org; Mon, 28 Feb 2022 08:48:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1646056112; bh=uksIGgxki6F0DpChgvX5bZiA4buho1rlevWaZw24MXQ=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=f6cQlnkWraQZKn/PfA0HvZ1mGTknJvolyKH1ExsGqizC/JzIR8jd7uTgPU52A/c733YNaYgwhrG61knR2IDHXq8cy/8DLu0BMuDHeqa0MQGYYq7AYRNYT9fwhdMW+O4ZCSeViG0gOHAL9eKNatnbI79A8xA4XCHMpWHKx5PSG8Pqm34cUHawhooiVMdyUwGhrRFrW8rBJY1SVPXnlxTS6X0FdBzHxM6/5jUgBLMEqMkUuZoQWWo2dZvv+hDDbaQuv4YMUcC6M22F9Z+Xcs0YlxtM3TpCIBwPkVN7afXGfo/4xKtoRxEXMPYyoqUiRvpVNLqEoCGRvH+PdxDJZ178oA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1646056112; bh=Na+TdHPnHUFS4TIl1poGrheXKAfsUSp91OKuGqMsolF=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=EMjRTjCcF7kaBKclufq/hKvM9ug1lwQ2YUO7SS6q4gmuvV8KIm/VeWc7UkZITD8PSJ1LFL5oTvZe0bFj52urVApP9MKszrgIaSV0rFZAQvqlmOzWnG6sJB7UmUTw/SdpzPajzh+ivGc/JMVREFBSMGFukD8wb0fqzL0ulYdRJb0msh3/nLYhCEwi9STkbmPoxoysMlOuvIAHaJyeDXS5w/8qqoFYeb6sDA9k78JGyV1nbCKJyHf+oNpdWr05f/nW3wQZ9py9g0C1xRadTaaoPOV0VW6U+vw8Z808U/NFqbTIalOrTd62K4RmazULxE7JLY9ahiKS9Jb+fYP+9VY5PQ== X-YMail-OSG: jLtB4_MVM1nUMZDoHNaqDVha9PE.T6PXqroMWFV.MemulM8Oe1WRKH292Q9hErG 9MOhWV7TvqRmY5unOYgWYaeZ6zkLS7eWjk6so9ckoZ1fAmXfjn2C1yE11OErOPNW1TiIsZsF3jhk xzOSc.65nU0oXJn65vzkj3sS5ilN9iMGgrSkHf6xhS2pD9oAZs5HX6PBahLEwtmn8RmcqAprIGi_ oXUaRK7tHXC9ZtRF_gDau7nbHWPf1351V3z2Yt.ff3GL3VSUpC.QVTCTnLHyX7Vt0Rw60UjECdvr VS7Y53ubiaMq.s_igKKWqgfqLGZOjMm1KMyfxLBQJJnd60mPAH9cUR5NAejNTJzJfIqb4gLFt_el aMgwnwh8RQ0S7lNCVXEfTq02_bukto7XdsscLH1mtxTsRQQMQPG_Pz8peO9GCnWfR.5EBNdc_rel CyajRyYkD7UHeqAehYPYaHrs4wieJMwuG8Ll4I9Pg3eQtuxjiXesG1SmD4ROpmobWNPuSSFt_qiu NPZlZrqOiEcVOeeyu3es6AHRtwkq9Qu_3tMIxMwD8KWxqSS5PFk.IeKQdlTZdYeTL_by.CtXzfqL EXPfsmxh0CKYflBa.52K2_qYv48J26a31fzU3jYiSnpnuavrGSt7Uzkne.n_g_AGn_h9eBTOZgS6 YfJRAadiIVnobZNV8UE4YNwiOAzcs3yAsnnEZdnylGLqYbrIv4pY_SCtXg9haUGKohIn8LyeennK sdruPUfm39nTXe.hTp6EtaxQzQmCDrWwmxa4kOV1wd75XJ1mneHHu_SBscqzMNXP4J2fpavncKma AuiJ2ee64EGnGrZg57sJUP6L.Gby5eHZpZGc8qqrn4 X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.ne1.yahoo.com with HTTP; Mon, 28 Feb 2022 13:48:32 +0000 Original-Received: by kubenode509.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 075c498cbba36949cb6d17a21339a9ef; Mon, 28 Feb 2022 13:48:28 +0000 (UTC) In-Reply-To: (Ignacio Casso's message of "Mon, 28 Feb 2022 13:12:44 +0100") X-Mailer: WebService/1.1.19797 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo 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:227815 Archived-At: Ignacio Casso writes: > Here I have not replaced the variable, since I have assumed that code > under the obsolete/ directory does not need to be maintained, and C-h > f tells me that function is not loaded by default. However there is a > warning when compiling. Should I fix it? I can do that instead, but see below. > - Using new variables gui--last-clipboard-selection-fingerprint and > gui--last-primary-selection-fingerprint instead of > gui--last-selected-text-clipboard and > gui--last-selected-text-primary. They have the same purpose but hold > the text and the timestamp instead of just the text, and I have > updated the code everywhere they were referenced to use the > text-timestamp pair instead of just the text . Better ideas for the > names are welcome. Can't you put a `timestamp' text property on strings stored inside the old gui--last-selected-text-clipboard variable instead? > - Just threw the idea that a better fingerprint would include the owner > of the selection, if timestamps are sometimes not updated precisely > when the owner changes, as Po Lu said. What I said is that badly behaved clients do not change the timestamp to take into account new data becoming available for clients they already own. The X server ensures that timestamps always increase with selection ownership changes. >> diff --git a/lisp/term/pc-win.el b/lisp/term/pc-win.el >> index 327d51f275..2ae3cbd8b2 100644 >> --- a/lisp/term/pc-win.el >> +++ b/lisp/term/pc-win.el >> @@ -248,7 +248,7 @@ w16-selection-owner-p >> ;; Windows clipboard. >> (cond >> ((not text) t) >> - ((equal text gui--last-selected-text-clipboard) text) >> + ((equal text (car gui--last-clipbaord-selection-fingerprint)) t) >> (t nil))))) >> > - Have not tested since I don't use Windows, but it's semantically > equivalent as before. pc-win is for the MS-DOS port (which does work, and should be kept working.) However, I think this modification can be avoided by storing the timestamp as a text property, which I proposed above. Thanks.