From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.devel Subject: Re: recent change to yanking behavior of the clipboard Date: Sun, 06 Feb 2022 15:37:53 +0800 Message-ID: <87o83kphri.fsf@yahoo.com> References: <20220205193944.836651.FMU2130669@unexploded-cow.prv.splode.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="24718"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux) Cc: emacs-devel@gnu.org To: Noah Friedman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Feb 06 08:43:10 2022 Return-path: Envelope-to: ged-emacs-devel@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 1nGcCT-0006A3-Pu for ged-emacs-devel@m.gmane-mx.org; Sun, 06 Feb 2022 08:43:09 +0100 Original-Received: from localhost ([::1]:37156 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nGcCS-0007zb-5h for ged-emacs-devel@m.gmane-mx.org; Sun, 06 Feb 2022 02:43:08 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:58854) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nGc7t-00075L-Gf for emacs-devel@gnu.org; Sun, 06 Feb 2022 02:38:26 -0500 Original-Received: from sonic308-56.consmr.mail.ne1.yahoo.com ([66.163.187.31]:41702) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nGc7h-0005EY-6K for emacs-devel@gnu.org; Sun, 06 Feb 2022 02:38:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1644133083; bh=D/ctFtVMtyaJYP8FAZIsva+iB03XlAncNz3IDtqXY9Q=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=jG2ZOq2V1DgSfh1b665XgPRleFCFrpPNkAJ3jZNfEkOyKIUxfd8BSPhBxXA88NdQYve9z9qcNK7tzbB5lERJLLqBBzNN+Egl91BoKDFrCNJYopnYIhZQoWeyFNfibX3H9FbxO+0n+26nCiIcT4sZ3WHfo2pTBvNessbihK2B4rM29uUwfPyV4PJzopHbhSvfdmHGOPCeRZR8xNYmkBFv2RMYY5gTOcY+wowcpz07JvFnq1HRqz/ttYwCOG6unNRcahg/LnERF2vf99UU/qwnNtvb8cpC27aTuG9p+HS93Wg3gGXw561Ko9iB7tK1JntVUcsMYw2Qv0Tyl5gB+PH7DA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1644133083; bh=xxHE/1ZZy98+nt5PozMsCS6vhH+2slTyRu8t/c48zbF=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=hPmvWfP46E+N2iCX826yo9BSl/PhZIZYeqM5P3NHgHFv8SeLLs2krvaH9/zw/Qm5/mkOo5NA3ZUFu6SW86ipQYArWVHvTyMkPOfJndQZ5YOV3NTXCFD8IoFZXMAYoMVp5UtQCArbL3EDnsa1SpKoZWAPQM8T7pjK3Q26zva1gQLRKrVyTHogCV8EeHUb9A/4bGLJUF5si6N/ZTcVUi/OW8xRUMxE3fteSPL1QCT7HVz+O53Z51SsHxdAPnkwG8Beh4c5VUGeOanFgZ38CRl5S+HjxVgGYYXDeecH41skGkRMKL4M7ii5GvFIUv07Lmc0hbD4pmjvbE32VUQUHhNSsQ== X-YMail-OSG: 1GDh7D8VM1n1I5r3YGk3FTYgZlTN1ewGRVaVCkpWRiWDQZ7BwQPM64HsqJK5znn tLs2IlFlC3AjSgSZGGLrpBZVFDi_JkknBY.IDMALQdvaP9.rmeAOjGuXiKw5_dP4C92I97IBKWfH 5x.NUWj7aa.9a4eA2GR9SeQYDT2uYmqvzW3n7OIPkqWhXs4czx8t1hwyItN2kudwVKJQfI6VNEda aSIAfVvYfrEJaxiy.X_jltW_GPRiyT4iJOMQeMkNyRmaE3bR5.IIOiBznm2xLwdj_3c.H23QIYsI 97mo1inEvBnDx_VTizn7Taw1onW0bjP.nPJTSflA6B..Bd7fB7kpx2VQFHzJbKkHG2VymyiuYBke y_CsYBKzb6ZOibT.fPmBDxKjEaDEB9.5d75ZnrYiuLSY6drVk_vbsd1HkXqhSy.8H71Cyv_C0Vzj LXegPJgNiSQkP9s5lmI4j0djNdpLpf2eZoQiZQKgLSHWBGkyzM2Ln7q4MYkaTW6o_pD2RnUEVrG5 MXuhwmkmxXyNqqNuTR.JLjITLP3yiPvm91mM6iegwA7PyEVyVhbD_ivhm1K0bEn3rZdBwlLRL.x_ FtHOHoYogLd4lqJhHdPgLqY4moDAeHe9fEYibe4nAjUUK4S1G4Z03rcSQo0kXyBLsykfCcgRxjwb 5YMDWbwZ_4shwy_K_w.AI2PhFS05MNTLH7_ynTWkdXneO1hss9ztk2dzyPDfHcQw.U.30g1EXJIS GNnEuE66uH49bsmAw0kANeOctVD6JvFuOyukD5ezsqDJBo_tyR2gLnDP1ybw09bIXA3M6FEkFm4e ZReR3YfRy1Q_qfxn7iBML70RKzwvQpIh2W5ix05uoW X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic308.consmr.mail.ne1.yahoo.com with HTTP; Sun, 6 Feb 2022 07:38:03 +0000 Original-Received: by kubenode516.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 0b5ca19bd6ad3f35d8c583f7f63b7b69; Sun, 06 Feb 2022 07:37:58 +0000 (UTC) In-Reply-To: <20220205193944.836651.FMU2130669@unexploded-cow.prv.splode.com> (Noah Friedman's message of "Sat, 05 Feb 2022 19:39:44 -0800 (PST)") X-Mailer: WebService/1.1.19711 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.187.31; envelope-from=luangruo@yahoo.com; helo=sonic308-56.consmr.mail.ne1.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:285937 Archived-At: Noah Friedman writes: > This change in master: > > 2022-02-01 10:13:15 +0800 Po Lu 99c637499e > > Only apply last change to the clipboard > > * lisp/select.el (gui--selection-value-internal): Only return > nil if we own the clipboard. > > Means that yanking never pastes the clipboard if I've programmatically set > the clipboard selection (which I do for both emacs and the sake of other > program windows that use it) If you assert ownership of CLIPBOARD from another program, then `gui-selection-value' (which is the interprogram-paste-function) will not return nil. If not, that program is buggy and should be fixed. Unless you are setting the clipboard inside Emacs via `x-set-selection', in which case see below: > But, curiously, you didn't make this change for the primary selection. Because, typically, Emacs does not keep a local ring for text stored into the primary selection. `select-enable-primary' is a violation of the XDG clipboard spec, and is unlikely to be used by many people, so I didn't enable that code there. > That means when I yank, I don't get the thing I've most recently copied to > the clipboard. I get some old thing from the primary selection. > > I don't understand how this new behavior is meant to be useful. It is meant to be useful by providing a visible performance improvement when Emacs is run over a network with moderate latency, by not querying the X server for the value of CLIPBOARD when text was last killed inside Emacs. And yes, that is what motivated me to install that change. > It's broken, and I am not exaggerating, somewhere around 30 years of > muscle reflexes. Why can't you save the clipboard contents into the kill ring as well? > Please revert this. We can provide a knob to turn that new behaviour off, but I'm not giving up such a visible performance increase in yanking text when Emacs is forwarded over a remote connection. > Not every item that goes to the clipboard comes from a buffer kill or > copy action. Not everything emacs "owns" is already in the kill-ring. No, and neither should C-y yank any text not in the kill ring (or from an interprogram paste, and text Lisp code saves into the kill ring is not "interprogram".) Thanks.