From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Visuwesh 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 09:50:33 +0530 Message-ID: <87r0ch4s1a.fsf@gmail.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> 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="39882"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: luangruo@yahoo.com, 65892@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 28 08:04:10 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 1sN4iP-000A5v-7r for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 28 Jun 2024 08:04:09 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sN4iK-0002dr-Fp; Fri, 28 Jun 2024 02:04:04 -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 1sN4iJ-0002df-H9 for bug-gnu-emacs@gnu.org; Fri, 28 Jun 2024 02:04:03 -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 1sN4iJ-0005b3-8S for bug-gnu-emacs@gnu.org; Fri, 28 Jun 2024 02:04:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sN4iH-0000lo-T3 for bug-gnu-emacs@gnu.org; Fri, 28 Jun 2024 02:04:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Visuwesh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 28 Jun 2024 06:04:01 +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.17195546202932 (code B ref 65892); Fri, 28 Jun 2024 06:04:01 +0000 Original-Received: (at 65892) by debbugs.gnu.org; 28 Jun 2024 06:03:40 +0000 Original-Received: from localhost ([127.0.0.1]:51413 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sN4hw-0000lE-1V for submit@debbugs.gnu.org; Fri, 28 Jun 2024 02:03:40 -0400 Original-Received: from mail-pl1-f194.google.com ([209.85.214.194]:47191) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sN4hu-0000ky-N5 for 65892@debbugs.gnu.org; Fri, 28 Jun 2024 02:03:39 -0400 Original-Received: by mail-pl1-f194.google.com with SMTP id d9443c01a7336-1f9aa039327so1411535ad.2 for <65892@debbugs.gnu.org>; Thu, 27 Jun 2024 23:03:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719554554; x=1720159354; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:references :message-id:date:in-reply-to:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=sIYuKSaDsqTUq/OysbZxJovDDbHypRt8z9uG8AKgv0Y=; b=lzjKPgLF88FdqQOuyvumQme5x6JFJvyQY/wDxChhJ9ZmWHhETFGmG146OPzW0HQCuk I1vuN0oPZTMsYEtV/xHBOJIR1YjuCncrhjpc0U9ma1qM4MukATRe5Bnw5Fv8vG4Gd6Oq 3JYi3W12NBa6XMPkUvqLKwyp8NA9O9jQUwdvT9m4ELo9ZMzkjmXfezqZIZkfwDBcwlkn slP/n183d4A7i0yHxsfW+5VnLx7++KobPssaPmbEqpRsiAu7i8CC+OcgDjXlJP0zAoJp w/y+vZ9RfkSm95v6JNXRBtVI578TW4EeN14mpF1EZOfda3QGzE2UTE4EZrTxeafPU6WQ y+5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719554554; x=1720159354; h=content-transfer-encoding:mime-version:user-agent:references :message-id:date:in-reply-to:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=sIYuKSaDsqTUq/OysbZxJovDDbHypRt8z9uG8AKgv0Y=; b=EwznmkeMP+kaAoHNkeS4ffuxs/fZHgXVnaPbMYPJq6ClSyCvEZnQ6A4fE9N85JwPWs xl0adk5DE7a8Vdb0zR1RJemUi01D6Lye92erevZbrfQi/QGQ7ebCAoAbp92oDirb5EqC J/dkVucTevdfHhPbl+beN911WgIdAF9a/hITMQfucC1j5YFCyZHQjTxVJscUbcy7Aj/w /NH3cCcX0d7lzhukfuvZfMooYlLNN5TBuLGimsR/PvJVqd50hwssAQfNCqDM9mPAmLdo 5IC1dS+Y92TJ/SXdJ15qlUfjQjadp0HjbxLXxXL48nEd13XiKGyFPS/WjaPZi51sTw7d pAAw== X-Forwarded-Encrypted: i=1; AJvYcCUKFbLlKqoWPJnt2KmAFI9RiIFY7gbRtvcDUNHInu6UlhaomaCQTLm2DooOsaAzFqB/XSViF2F8mZCZ2rkCWCfBp0HsltQ= X-Gm-Message-State: AOJu0YzR4FEMdSSIDN6c3CMW6B3S0N4+h3HvWrjw8GXM0V+He9zs/tJy vHOYXLKHBhjtoWNtOhDAexP8g7gy/EOIWQAYeQlkxdotHeKWxUONAVVMnDCp X-Google-Smtp-Source: AGHT+IFTFLLFw6itEz9TM1X2H5/wllhGn1Cj7QCYm6MFy/QxWX2xhBwc9BZJEHCj7pRNsTjzfvf3jA== X-Received: by 2002:a05:6a20:8c8a:b0:1bd:2d53:35d5 with SMTP id adf61e73a8af0-1bd2d539600mr7550910637.9.1719548441685; Thu, 27 Jun 2024 21:20:41 -0700 (PDT) Original-Received: from localhost ([103.232.241.147]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fac1535e62sm5589645ad.154.2024.06.27.21.20.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jun 2024 21:20:41 -0700 (PDT) In-Reply-To: <86sex19o0c.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 25 Jun 2024 15:59:31 +0300") 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:288048 Archived-At: [=E0=AE=9A=E0=AF=86=E0=AE=B5=E0=AF=8D=E0=AE=B5=E0=AE=BE=E0=AE=AF=E0=AF=8D = =E0=AE=9C=E0=AF=82=E0=AE=A9=E0=AF=8D 25, 2024] Eli Zaretskii wrote: >> From: Visuwesh >> Cc: Eli Zaretskii , 65892@debbugs.gnu.org >> Date: Tue, 25 Jun 2024 10:06:35 +0530 >>=20 >> BTW, I would be happy if I can do the above copying/cutting files from >> _dired_ without resorting to xclip(1) to set non-STRING targets. I >> tried to do it with the facilities offered by Emacs but failed to set >> _only_ the required target without other things like STRING. The same >> happened when I tried to copy an image to the clipboard. I would be >> happy to open a bug report or some such if you're interested. > > Isn't this the expected behavior? The application that sets the > clipboard data has no idea what the consumer might need or would want > to do with the data. It could past the image, or it could take the > image's meta-data (STRING) and do something with it. Or it could take > the image's file name and copy the file somewhere. Or something else. > This is why it is customary to put all the relevant data types in the > clipboard, so that the consumers could take whatever they need. 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=20 (gui-get-selection 'CLIPBOARD 'x-special/gnome-copied-files) ;; =3D> nil In fact, if I do (gui-get-selection 'CLIPBOARD 'TARGETS) I get [TIMESTAMP MULTIPLE TEXT COMPOUND_TEXT STRING UTF8_STRING text/plain te= xt/plain\;charset=3Dutf-8 TARGETS LENGTH DELETE FILE_NAME CHARACTER_POSITIO= N 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/.prof= ile" |xclip -t x-special/gnome-copied-files -selection clipboard I get (gui-get-selection 'CLIPBOARD 'TARGETS) ;; =3D> [TARGETS x-special/gnom= e-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")