all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Visuwesh <visuweshm@gmail.com>
To: Po Lu <luangruo@yahoo.com>
Cc: Eli Zaretskii <eliz@gnu.org>, 65892@debbugs.gnu.org
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	[thread overview]
Message-ID: <87ikxt4c5r.fsf@gmail.com> (raw)
In-Reply-To: <87jzi9tpbt.fsf@yahoo.com> (Po Lu's message of "Fri, 28 Jun 2024 16:59:50 +0800")

[வெள்ளி ஜூன் 28, 2024] Po Lu wrote:

> Visuwesh <visuweshm@gmail.com> 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.

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.





      reply	other threads:[~2024-06-28 10:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-12 16:54 bug#65892: 30.0.50; yank-media fails for clipboard selection that are wiped after being accessed Visuwesh
2024-06-24  3:53 ` Visuwesh
2024-06-24 12:13   ` Eli Zaretskii
2024-06-24 13:46     ` Visuwesh
2024-06-25  3:45       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-25  4:36         ` Visuwesh
2024-06-25 12:59           ` Eli Zaretskii
2024-06-28  4:20             ` Visuwesh
2024-06-28  8:59               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-28 10:03                 ` Visuwesh [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ikxt4c5r.fsf@gmail.com \
    --to=visuweshm@gmail.com \
    --cc=65892@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=luangruo@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.