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 15:33:28 +0530 Message-ID: <87ikxt4c5r.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> <87r0ch4s1a.fsf@gmail.com> <87jzi9tpbt.fsf@yahoo.com> 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="8579"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , 65892@debbugs.gnu.org To: Po Lu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 28 12:05: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 1sN8Tu-00021b-4M for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 28 Jun 2024 12:05:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sN8TY-0006fi-CE; Fri, 28 Jun 2024 06:05: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 1sN8TW-0006fP-8Z for bug-gnu-emacs@gnu.org; Fri, 28 Jun 2024 06:05:02 -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 1sN8TV-0000Vh-Vk for bug-gnu-emacs@gnu.org; Fri, 28 Jun 2024 06:05:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sN8TV-0000rY-V2 for bug-gnu-emacs@gnu.org; Fri, 28 Jun 2024 06:05: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 10:05: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.17195690803278 (code B ref 65892); Fri, 28 Jun 2024 10:05:01 +0000 Original-Received: (at 65892) by debbugs.gnu.org; 28 Jun 2024 10:04:40 +0000 Original-Received: from localhost ([127.0.0.1]:44721 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sN8T9-0000qo-FC for submit@debbugs.gnu.org; Fri, 28 Jun 2024 06:04:39 -0400 Original-Received: from mail-il1-f194.google.com ([209.85.166.194]:58657) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sN8T8-0000qc-2b for 65892@debbugs.gnu.org; Fri, 28 Jun 2024 06:04:38 -0400 Original-Received: by mail-il1-f194.google.com with SMTP id e9e14a558f8ab-3762eadd807so1507115ab.1 for <65892@debbugs.gnu.org>; Fri, 28 Jun 2024 03:04:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719569012; x=1720173812; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sAQ68+Y2V+sGEICf424nF1V3aWXWl9SE+Rm4GfLFmFc=; b=GvAb0QNetqRc+Vb16YLsSRlWtY0goeJik67l3tyTo7Aaduk6pwnp3MENhvIhFm/QZV QlBhMjzt9A6VOuIdeZJAxygYrsKrWPo1KS/bcbUZlEuLnF9Z4mmDfqmbhQ281XYFIWpP lrim0/B2FH7ExVhPMKxQG4FVRj5kRaqgIUSyacUKgxQbWpZ08QpFWvwue8ZDO4jIDffM Nm3xYVhu+oDQbSpABQIQ/jwWye2FLoLnwK2m4Cp9maDlgn+iYEYUH9L/karC0E8xMny0 pWwq0iMArXmiKTO+wUTGsCifAEiDaR+oX7yVIwXwUGqYH9kCLXlUCuMLvzpUmIqslAnO tn6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719569012; x=1720173812; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=sAQ68+Y2V+sGEICf424nF1V3aWXWl9SE+Rm4GfLFmFc=; b=FdHt8vusMiJYgarYt2JyW3MAXupNWr8UHvbmWDXp9DQOAPjjs5LA3VXW/plfIkRnz3 kxJIC0qWWflURc+LFiMqCc5NRbizWJ79iUTVkQVPbZYY/9Inn5FDfsPihgs5ExcK4A6J qfycfnkztowrJTfpriyp5oP0TyG2TqqwxfeKnx4G6xxXFDvUgRsP6IVpOEasaorl+msR jVz0F8XGOE/3eognF4i5zUOGq1RekyIR19QpoXwomu0IhVYEtC+OrzWvNs3zDkaWHerc cfLTiPjmtuvM8CFf7lYMTvqIQ/191IrOKn/9gjYYT1AXW8wk+sm6FheGBDo9ghZGQ8yB gChQ== X-Forwarded-Encrypted: i=1; AJvYcCW2CTcXg5ECW7ACTUAKs4GGvM1EGWX+B9smQkYBN2UusYshRoda+zaLwRmth0Qi544ZEHbxV3nAuHb6YHTasKKiaJQl9Ys= X-Gm-Message-State: AOJu0Yx44WFpK49FbrGSrWrxarEAxCsj9ZQ8h17JPNRwpwgIw5E9lQKS IURTf1HPmDGjVjcKp1ZgFkcXs4nOiHi3hg/m/3TNlfGC0+tomw6y X-Google-Smtp-Source: AGHT+IEN+9ruIRrnvZLxhokwDeSJQ7jox1/PD4oYy9e1QxyNyJMVJIpuXM8zAGcFi91NAzd7kPPThg== X-Received: by 2002:a05:6e02:1a44:b0:374:a1e8:2086 with SMTP id e9e14a558f8ab-3763f5d79bemr221334245ab.19.1719569012136; Fri, 28 Jun 2024 03:03:32 -0700 (PDT) Original-Received: from localhost ([103.232.241.147]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-72c69b51ff1sm868239a12.4.2024.06.28.03.03.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jun 2024 03:03:31 -0700 (PDT) In-Reply-To: <87jzi9tpbt.fsf@yahoo.com> (Po Lu's message of "Fri, 28 Jun 2024 16:59:50 +0800") 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:288058 Archived-At: [=E0=AE=B5=E0=AF=86=E0=AE=B3=E0=AF=8D=E0=AE=B3=E0=AE=BF =E0=AE=9C=E0=AF=82= =E0=AE=A9=E0=AF=8D 28, 2024] Po Lu wrote: > 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/.prof= ile\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= text/plain\;charset=3Dutf-8 TARGETS LENGTH DELETE FILE_NAME CHARACTER_POSI= TION LINE_NUMBER COLUMN_NUMBER OWNER_OS HOST_NAME USER CLASS NAME ATOM INTE= GER 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/.p= rofile" |xclip -t x-special/gnome-copied-files -selection clipboard >> >> I get >> >> (gui-get-selection 'CLIPBOARD 'TARGETS) ;; =3D> [TARGETS x-special/g= nome-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. As I expected. > 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. Can the documentation please be expanded to make this point clear? Given that it talks about text/uri-list, I misunderstood that Emacs can set clipboard with any TARGET value. Clearly this is not the case. Including some more examples would also improve the documentation significantly IMO. As it is, it is very hard to understand the facility. > 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. I do not ask for this feature in this release in any case. It was merely a side-request/question since I have been left confused for months now.