From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tim Cross Newsgroups: gmane.emacs.devel Subject: Re: recent change to yanking behavior of the clipboard Date: Mon, 07 Feb 2022 12:11:36 +1100 Message-ID: <87pmnz4geo.fsf@gmail.com> References: <20220205193944.836651.FMU2130669@unexploded-cow.prv.splode.com> <87o83kphri.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="15335"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.7.7; emacs 28.0.91 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Feb 07 02:28:30 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 1nGspR-0003jq-7C for ged-emacs-devel@m.gmane-mx.org; Mon, 07 Feb 2022 02:28:29 +0100 Original-Received: from localhost ([::1]:57504 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nGspO-00060J-L8 for ged-emacs-devel@m.gmane-mx.org; Sun, 06 Feb 2022 20:28:26 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:58026) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nGsmF-0004Ma-IZ for emacs-devel@gnu.org; Sun, 06 Feb 2022 20:25:12 -0500 Original-Received: from [2607:f8b0:4864:20::633] (port=33492 helo=mail-pl1-x633.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nGsmC-0002eh-FC for emacs-devel@gnu.org; Sun, 06 Feb 2022 20:25:10 -0500 Original-Received: by mail-pl1-x633.google.com with SMTP id k17so10025674plk.0 for ; Sun, 06 Feb 2022 17:25:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=references:user-agent:from:to:subject:date:in-reply-to:message-id :mime-version; bh=JlHsHILZYY7FbVRRJ9AeFvFAwI+VRd6efxTwGWJW8D8=; b=Bk9k6RFscZ7GTf6MehEBjOOhyu1i8VFj4hhHpL06hpezLOuz0jKnJgZ6oQPBtIpJsL z3zk3VaY/9UOWCa8Ei3IvRSjkLPLi68VQ3snvzMPw7GOIbFVfcmcE+bi2B7Xah+X+dfO ogSbXB5x9Z8+AJ268kiKPidfoYC93zdUWALYqivUvzGMeWZbUjIBHy/n9f0YuI236xmH SlGNSc5elSS9w7YJfbJxbl3hoUmfNne/CSp8RSgMjaXlGeuAb4Uv1AbI5Gg7RufJSilc BSmdIkAxcolLw/Doy4RMJu3PGJpKMoGCPZnt2HYg55Ngi+4CpeFgt4Z2eO6nLT3S6vEE toBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:references:user-agent:from:to:subject:date :in-reply-to:message-id:mime-version; bh=JlHsHILZYY7FbVRRJ9AeFvFAwI+VRd6efxTwGWJW8D8=; b=EKn8BGFvxmUxTRmqp9ZAqr98600R4oAnxHJlHJNItZWESf1Ak+f4t/2f5ew7BTSyE7 g1qL/xBaZbFp0SGXsmN0JmKHSXh9A7uMMXVxZ6amjFsofrKhUZmwixUKA3zBLTPO+mUp 2Jb8aBR4ulE8fUya/icgqi0Fjk/AmsR2HXUHrb0yMUCruO30471YePXhEzQZ+CtE60+e zru/t7kB/j2wZRh9oGa7vqjzfIMWO5ymP213tAMicU2zMqJmRg0jYLiA+e4Ve6c8UWby ybIAtunrL3hhpupKxQ9hXo+o1jq26iZYnCIQ+CqR23pw4FBZSGhB0uZB4oRNS5s9jWOc qhNg== X-Gm-Message-State: AOAM531tcOrmaym3wBtEIn8P/UbYfWh1k5ZACcnGUSkhQHoS5m/m+c8r sjGmONr54mgE6vE/CfRATI9TotAbk0w= X-Google-Smtp-Source: ABdhPJzd8aF1X5UW/BE5Bv/KxUPNc+cvhyLqyh1XWkdFZB2F1RE8h0t+zZRmtc7RX/erTqlyp0EISg== X-Received: by 2002:a17:90a:af8c:: with SMTP id w12mr1948428pjq.153.1644197106389; Sun, 06 Feb 2022 17:25:06 -0800 (PST) Original-Received: from dingbat (2001-44b8-31f2-bb00-258d-f255-e8e2-f18f.static.ipv6.internode.on.net. [2001:44b8:31f2:bb00:258d:f255:e8e2:f18f]) by smtp.gmail.com with ESMTPSA id gb5sm8908470pjb.16.2022.02.06.17.25.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Feb 2022 17:25:06 -0800 (PST) In-reply-to: <87o83kphri.fsf@yahoo.com> X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::633 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=theophilusx@gmail.com; helo=mail-pl1-x633.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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:286000 Archived-At: Po Lu writes: > 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. > Just a question. What about Wayland? I ask this because recently there was a post on the orgmode list where someone was getting inconsistent behaviour between Emacs, emacsclient and other applications running the pgtk version of Emacs under Wayland. Given that Fedora has moved to defaulting to Wayland, Debian is beginning to support Wayland and Ubuntu are moving in that direction, combined with Emacs supporting a pure GTK implementation which (I assume) means you could run Wayland without the legacy X integration, should any refactoring of Emacs interaction with the clipboard also be factoring in Wayland as another 'platform'? Tim P.S. Do many people still run Emacs remotely over X? I did this for a long time (until things became very slow with font-locking). These days, I find things like X2Go have become so good, I just use that and avoid the performance hit of remote X and all that xauth merging etc.