From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Konstantin Kharlamov Newsgroups: gmane.emacs.bugs Subject: bug#56273: [REGRESSION] (x-clipboard-yank) pastes from kill-ring when `select-enable-clipboard` is t Date: Tue, 28 Jun 2022 09:31:43 +0300 Message-ID: <73cf50ca4af746855f5d751f67e30aace2738d38.camel@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17161"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.44.2 To: 56273@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jun 28 09:29:46 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 1o65fO-0004M7-0y for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 28 Jun 2022 09:29:46 +0200 Original-Received: from localhost ([::1]:55984 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o65fN-0000li-3F for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 28 Jun 2022 03:29:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55706) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o64nT-00026Q-7u for bug-gnu-emacs@gnu.org; Tue, 28 Jun 2022 02:34:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59940) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o64nS-0004ed-27 for bug-gnu-emacs@gnu.org; Tue, 28 Jun 2022 02:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o64nR-00082c-TE for bug-gnu-emacs@gnu.org; Tue, 28 Jun 2022 02:34:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Konstantin Kharlamov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 28 Jun 2022 06:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 56273 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.165639801230868 (code B ref -1); Tue, 28 Jun 2022 06:34:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 28 Jun 2022 06:33:32 +0000 Original-Received: from localhost ([127.0.0.1]:53837 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o64mx-00081n-K9 for submit@debbugs.gnu.org; Tue, 28 Jun 2022 02:33:31 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:40736) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o64mu-00081d-6v for submit@debbugs.gnu.org; Tue, 28 Jun 2022 02:33:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55682) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o64mi-0001jb-03 for bug-gnu-emacs@gnu.org; Tue, 28 Jun 2022 02:33:18 -0400 Original-Received: from forward101o.mail.yandex.net ([37.140.190.181]:46736) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o64md-0004VJ-N6 for bug-gnu-emacs@gnu.org; Tue, 28 Jun 2022 02:33:14 -0400 Original-Received: from sas1-8a23c9b94e43.qloud-c.yandex.net (sas1-8a23c9b94e43.qloud-c.yandex.net [IPv6:2a02:6b8:c14:2f2a:0:640:8a23:c9b9]) by forward101o.mail.yandex.net (Yandex) with ESMTP id 95589369DFF6 for ; Tue, 28 Jun 2022 09:31:50 +0300 (MSK) Original-Received: from sas2-ffeb92823cb1.qloud-c.yandex.net (sas2-ffeb92823cb1.qloud-c.yandex.net [2a02:6b8:c08:6803:0:640:ffeb:9282]) by sas1-8a23c9b94e43.qloud-c.yandex.net (mxback/Yandex) with ESMTP id PG7qCH7DwN-VofqemBw; Tue, 28 Jun 2022 09:31:50 +0300 X-Yandex-Fwd: 2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1656397910; bh=d69+yR7meWziIjan/5Rp5JkkqSBryxNmr500Q0/oj7w=; h=Date:To:From:Subject:Message-ID; b=DDr1wsW83arbGDQlL1fGwpm47XE8XVvUdBg7swNP6p8KRRGKo/rd+MR7FeEswuKxZ vcj58xC250iv8los8NeuAZayuEShmOxGOXI25ed2mz8WgCUuZt1qh8XRn711pKSIOj lOMDiy1sRcs5ymdWwEp7Z7i4//nUjJ/k8wRUUad0= Authentication-Results: sas1-8a23c9b94e43.qloud-c.yandex.net; dkim=pass header.i=@yandex.ru Original-Received: by sas2-ffeb92823cb1.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id 7WDV9ctcV9-VoMWiMdR; Tue, 28 Jun 2022 09:31:50 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) Received-SPF: pass client-ip=37.140.190.181; envelope-from=hi-angel@yandex.ru; helo=forward101o.mail.yandex.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: 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:235514 Archived-At: After upgrade to latest development version at: 05fe0faed4: "make clean" etc. problem now fixed on Solaris. I found out that using (x-clipboard-yank) when `select-enable- clipboard` is set to t randomly pastes stuff that is not in system clipboard. I don't know exact commit that broke it, am in process of bisecting right now. Latest one working that I found so far is 7055104358ad51b8c49e120851ee5d4d3c909e6d. # Steps to reproduce 1. Create /tmp/.emacs file with the following content: (setq select-enable-clipboard nil inhibit-startup-screen t) (defun clipboard-yank-test () (interactive) (let ((select-enable-clipboard t)) (x-clipboard-yank))) (global-set-key "\C-y" 'clipboard-yank-test) 2. Launch `HOME=3D/tmp/ emacs` 3. Outside Emacs copy a word "test" 4. In Emacs ensure that `C-y` pastes word "test" 5. In Emacs, delete a different word in the *scratch* buffer, e.g. a "create" 6. In Emacs, press C-y to paste current clipboard content ## Expected A word "test" will be inserted as this is the one that is in the system clipboard. Note: the word "create" didn't replace content in the clipboard, because global value of select-enable-clipboard is nil. So it still has "test", and the C-y was expected to paste "test" as well due to `select-enable-clipboard` being temporarily set to `t` in clipboard- yank-test. ## Actual The word you deleted in *scratch* buffer will be inserted instead of "test".