From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#27442: Un-obsolete x-clipboard-yank, or provide analogous functional Date: Mon, 05 Jul 2021 10:46:12 -0400 Message-ID: References: <83r2ydupg7.fsf@gnu.org> <9b98217a-be79-56ed-16a9-0c15622111c5@yandex.ru> <877di4yhk8.fsf@gnus.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13883"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Eli Zaretskii , 27442@debbugs.gnu.org, Constantine Kharlamov To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jul 05 16:47:24 2021 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 1m0Psa-0003PR-Nn for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 05 Jul 2021 16:47:24 +0200 Original-Received: from localhost ([::1]:42884 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0PsZ-0003i9-6k for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 05 Jul 2021 10:47:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44908) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0PsE-0003fn-PF for bug-gnu-emacs@gnu.org; Mon, 05 Jul 2021 10:47:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34831) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0PsE-0007hL-HB for bug-gnu-emacs@gnu.org; Mon, 05 Jul 2021 10:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m0PsE-0000Ds-Bz for bug-gnu-emacs@gnu.org; Mon, 05 Jul 2021 10:47:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 05 Jul 2021 14:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27442 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch moreinfo Original-Received: via spool by 27442-submit@debbugs.gnu.org id=B27442.162549638231392 (code B ref 27442); Mon, 05 Jul 2021 14:47:02 +0000 Original-Received: (at 27442) by debbugs.gnu.org; 5 Jul 2021 14:46:22 +0000 Original-Received: from localhost ([127.0.0.1]:46377 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0PrZ-00089s-S5 for submit@debbugs.gnu.org; Mon, 05 Jul 2021 10:46:22 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:27780) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0PrY-00083w-Ln for 27442@debbugs.gnu.org; Mon, 05 Jul 2021 10:46:20 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id B6941440F2A; Mon, 5 Jul 2021 10:46:14 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 78AB8440CD3; Mon, 5 Jul 2021 10:46:13 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1625496373; bh=QyBgnIz3RoZRZ5gmvdheMA8BUMUuwgYVw3utMQZ/D/Y=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=dsr03WJEkhBTh7QqjBfOZ+UDyvd59t34kodDYBhrTJx1E10dbnLAj036ruH1h5Kuc kAsPP/VkyCYbeUeCstFrI5LmpNDrTiNxBcNcj0Iig0K898z/G2dm+ge+b5oWKr/SPH 7MKHHq7koTditacOWgoLLMoPxckBfwwkCw9Ye6hUZhkn6EMIiNH2Y3I88ZXpJeeWeP xqiCT1wSHYbx++eAgGTim17GCPt6abWZaeVZb34fqwIs+EhYac4OClSPQRGyvYLZUG cxHpdB9ndQyRb2rq0CcstnG0JmuAePZ5u5zDqp2BpP1NjJX2uMkfnH7UaUzqnhcXJe bUOum5H47Cd3g== Original-Received: from alfajor (unknown [45.72.205.238]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 3E2031201E4; Mon, 5 Jul 2021 10:46:13 -0400 (EDT) In-Reply-To: <877di4yhk8.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 05 Jul 2021 16:13:43 +0200") 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:209466 Archived-At: > (defun gui-selection-value () > (let ((clip-text > (when select-enable-clipboard > (let ((text (gui--selection-value-internal 'CLIPBOARD))) > (if (string= text "") (setq text nil)) > > ;; Check the CLIPBOARD selection for 'newness', is it different > ;; from what we remembered them to be last time we did a > ;; cut/paste operation. > (prog1 > (unless (equal text gui--last-selected-text-clipboard) > text) > (setq gui--last-selected-text-clipboard text))))) > > So, indeed, if you `M-x clipboard-yank', then kill some text in Emacs, > you can't `M-x clipboard-yank' until you've clipboarded some other text, > yanked it, and then clipboarded the original text again. > > Fixing this should be pretty trivial -- the following patch should do > the trick, I think (although I haven't tested it). But I'm not quite > sure about the intended logic here, so I've added Stefan M to the CCs -- > perhaps he has some comments. AFAIK this part of the clipboard interaction is one I just preserved from earlier code when I did my "gui-selection" rework. I "just preserved" it because I don't really understand how it's intended to work, nor do I understand enough of the design constraints to be able to come up with my own design of how it should work :-( Your patch looks acceptable to me (it is also disappointing because it doesn't really help understand how this thing is intended to work, but it follows the same principles as the ones I followed). Stefan