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#65892: 30.0.50; yank-media fails for clipboard selection that are wiped after being accessed Date: Fri, 28 Jun 2024 16:59:50 +0800 Message-ID: <87jzi9tpbt.fsf@yahoo.com> References: <87a5trjprx.fsf@gmail.com> <875xtzro7j.fsf@gmail.com> <86v81ybksc.fsf@gnu.org> <87frt2qwri.fsf@gmail.com> <87le2ty9b5.fsf@yahoo.com> <87bk3pr63w.fsf@gmail.com> <86sex19o0c.fsf@gnu.org> <87r0ch4s1a.fsf@gmail.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="7801"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , 65892@debbugs.gnu.org To: Visuwesh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 28 11:51:28 2024 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 1sN8GN-0001u2-7N for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 28 Jun 2024 11:51:27 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sN8G2-0003Ek-Gl; Fri, 28 Jun 2024 05:51:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sN8G0-0003EB-7H for bug-gnu-emacs@gnu.org; Fri, 28 Jun 2024 05:51:04 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sN8Fy-0002fO-6r for bug-gnu-emacs@gnu.org; Fri, 28 Jun 2024 05:51:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sN8Fy-0000Ua-68 for bug-gnu-emacs@gnu.org; Fri, 28 Jun 2024 05:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 28 Jun 2024 09:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65892 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 65892-submit@debbugs.gnu.org id=B65892.17195682411784 (code B ref 65892); Fri, 28 Jun 2024 09:51:02 +0000 Original-Received: (at 65892) by debbugs.gnu.org; 28 Jun 2024 09:50:41 +0000 Original-Received: from localhost ([127.0.0.1]:44653 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sN8Fc-0000Sc-FS for submit@debbugs.gnu.org; Fri, 28 Jun 2024 05:50:40 -0400 Original-Received: from sonic310-23.consmr.mail.ne1.yahoo.com ([66.163.186.204]:39110) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sN8FY-0000RT-RC for 65892@debbugs.gnu.org; Fri, 28 Jun 2024 05:50:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1719568229; bh=bKwXVWx02VDBlcO1/4dHNJgcTajnkR9jQ8ZdeXFBLK8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=THa41HmhotxP5WwMuBflvxS5XVeA79CsCTAIi5IRf/v/CHOOD1IBQpFwJML2XwTUYdctd4Q7Uv/3h6ixez/Yr1BM1pGLTqiKzX7gbzWE8nZq4AAeeGN/Hae494kVU/kJhdKe8X4u402dk7uSZ4IdDtfIDn2yG1jrOXvdXd93Z5sQOZj67cDPQD4NC+r4JGu7AQ/J3BgDMEuFPYEPweWOP4tdiMEtaejDheWXJemG40uswlA/nvFSFABssj+CAlQRCCvbkbhgBZsmhQddJ7DAZA3mNWHalgI8MaaksKMYQeAPmCw2uanbeIkN3kGwfxbitopiERosmL7O64trFCYVcw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1719568229; bh=Moloxy1M/K7sOQDrkHosr/yc9HNLpNIA/Kbd1TLdomm=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=fKqoTj8smwQiq35zaicIBvNvNGc1egA+sd9W4LTAiFvWREUNk3D7PTKgCAQwsvwIQ/iVQUPiYbq9E/W2qkl9G04LS/JiRVNkJ0LutxyBvKU/jlMyMBjj4oAbUPN3TPB6YggmuX1EJL3/I6HScAkaolVymZyC42joew+fbMEH4hIq00Qk0S41o1fvF+yiczhXXv+77EQzzh841mzmNMRh7DL22h19ckoaj4thyDU4TwGvNzWuuXV47ikO/tGzvjHfBO9sBC5GUY56NQAeMGXHFbU4PMXr2s/Zab2y2Y7M+dIsb2lxq/i/kU5eF90X0mgo9emzolS15cPUuFdaoh0acA== X-YMail-OSG: jHqe6YsVM1lx0UUASeX6yvNNmngYe9nfr9kWXJV_9LDx_cJ1.YcoTE.Ea0mL1EB tfuWwgva0cwaD3E6En.qhxX7iO74JwHNU4I4uiGMepUPd2r_8HBE0vcEJWkQ.FnsfHjjw8vuhoc. vfOGPlMRhFg0OC5MIIbrTU05msFmanMf8cXlYo4JMpM8hA1HjQ5mhI.Z.h1OsNjKed09LCYyOkDj GPp7uiQVbGezXMpr810VhKxpGw_Pj34UWtKYktJ75wtgtLIqS75w3ARGvRs.TL2h4urODhu3YlWG CDnxxj8jDTJ6qGSFV82PGoVh9DczG3hLq9mf1Kp8qujiymn7XaiBzwG0iPg9XVcrxfP3sVH0b2X2 wEj.hFdYJ_nA5Sv177ExcLf69cppd6QuJsn..N6_48jjSWSIKMrOdT1.2VgBpQgeVa8dZpbNTlNi qDdx3fu2keUxdRlXPTO7nLDI7q429wrVHcwV2RZkwMQUloFF0AkWb77KsiP35gps3EbebZCmBzr1 mlqdXOZi3b3TwAoqeMjaD_rldJjyN1nCBlv470n7YSq5Ke.xttV..nbBbEa1tJs7e8Qoupcrnys2 VAt3gvAQysHZmZx0hBzCYIJ39lQzaBJe5YxULdIMm6gj6Imqrj7YQ4l2Lm0kgh7Ste6Wtui_Ifyv b4kHTHGzCbPxoCPSXStCbbSQDYgf2sdlavk6tMwGjl1ghhJSSnXPFRDY9utoXuRLMxOTzTbroCyS wshWVFjVzTcsy2qRusKxTCcgrRuaLG4vHLMLhXTJtbY0O.UagBHxEMj0v21zewIheZSaRTxHTfTd QjFNV8PgjXMB7ZMSajWYq2ZbSMvFcJl2G_LyZELSYq X-Sonic-MF: X-Sonic-ID: 54f3d627-16d2-42d3-b68f-fc17c51bb2e0 Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic310.consmr.mail.ne1.yahoo.com with HTTP; Fri, 28 Jun 2024 09:50:29 +0000 Original-Received: by hermes--production-sg3-7b469d9f6-2cjcg (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 4f00419a4da54895973790cae6434301; Fri, 28 Jun 2024 09:00:08 +0000 (UTC) In-Reply-To: <87r0ch4s1a.fsf@gmail.com> (Visuwesh's message of "Fri, 28 Jun 2024 09:50:33 +0530") X-Mailer: WebService/1.1.22407 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:288057 Archived-At: Visuwesh writes: > While what you say makes perfect sense, I seldom find this to be the > case. But I think I worded my message too poorly. As per the manual [1], I > can set use text-property to set an alternate TARGET as > > (gui-set-selection > 'CLIPBOARD > (propertize "asd" 'x-special/gnome-copied-files > "copy\nfile:///home/viz/.mkshrc\nfile:///home/viz/.profile\0")) > > If I do > > (x-get-clipboard) > > I get > > #("asd" 0 3 (x-special/gnome-copied-files "copy > file:///home/viz/.mkshrc > file:///home/viz/.profile\0")) > > (where I changed the actual NULL character to \0). But > > (gui-get-selection 'CLIPBOARD 'x-special/gnome-copied-files) ;; => nil > > In fact, if I do > > (gui-get-selection 'CLIPBOARD 'TARGETS) > > I get > > [TIMESTAMP MULTIPLE TEXT COMPOUND_TEXT STRING UTF8_STRING text/plain text/plain\;charset=utf-8 TARGETS LENGTH DELETE FILE_NAME CHARACTER_POSITION LINE_NUMBER COLUMN_NUMBER OWNER_OS HOST_NAME USER CLASS NAME ATOM INTEGER SAVE_TARGETS] > > with the x-special/gnome-copied-files nowhere in sight. If I evaluate > x-get-clipboard in a fresh emacs -Q, I obviously don't see the > text-property too. I thought the inability of gui-get-selection to > return the expected was because there isn't a proper function for the > TARGET in selection-converter-alist but that should not matter since > yank-media does handle this type fine with just a gui-get-selection > call. So the problem is with the inability to specify the TARGETS I > think. If I do > > % printf '%s\0' "copy\nfile:///home/viz/.mkshrc\nfile:///home/viz/.profile" |xclip -t x-special/gnome-copied-files -selection clipboard > > I get > > (gui-get-selection 'CLIPBOARD 'TARGETS) ;; => [TARGETS x-special/gnome-copied-files] > > If you replace x-special/gnome-copied-files with an image, the same > argument holds. > > Perhaps I simply do not understand the manual but I cannot find how to > set the TARGET properly. It would be nice if the relevant info node > could have examples of gui-set-selection that does sets the clipboard to > have an image as the DATA, or something else. > > I hope this is clear. Sorry for my late reply. > > 1. (info "(elisp) Window System Selections") You misunderstand the purpose of permitting properties in selection data strings, I think. They are not designed to provide new data types, nor do they in fact do so, but to enable specifying values specific to a data type for which an existing selection converter is defined. Undoubtedly Emacs can be extended with facilities that suit your requirements, but the release is too close at hand for such new features as these, I'm afraid.