emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: chris <inkbottle007@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: cut and paste not working after xdg-open "org-protocol://store-link?url=URL&title=TITLE"
Date: Sun, 30 Jan 2022 19:38:03 +0100	[thread overview]
Message-ID: <1761146.GlYOGd2maZ@pluto> (raw)
In-Reply-To: <871r0px5cu.fsf@localhost>

[-- Attachment #1: Type: text/plain, Size: 2926 bytes --]

On Sunday, 30 January 2022 04:36:01 CET Ihor Radchenko wrote:
> chris <inkbottle007@gmail.com> writes:
> > 3- if you do `C-y` you can see the URL is in the kill-ring
> > But obviously there is no reason for this URL to be also in the Wayland
> > (or
> > x11) clipboard? (there is no law of nature saying that what is in emacs
> > kill- ring must necessarily also be in wayland clipboard. I think there
> > is a law of nature for the other way around though)
> > In any case, in the case of Kde/Kwin/Wayland, it is not copied in the
> > Wayland clipboard.
> > Maybe it's in the description of org-protocol/store-link that the URL
> > should be copied in emacs kill-ring, in any case, it is.
> > But no it doesn't show in the kde/wayland clipboard (and why would it).
> 
> I am not 100% sure if I understand your message clearly. However, just
> letting you know about existence of the following Emacs customisations:

It is, only, in conjunction with `org-protocol`, that kill-ring and Wayland-clipboard get out 
of sync.

Not in some general case. General case is fine.

But in the case of org-protocol, as described in the original post and not present in the 
excerpt you quoted, they do get out of sync.

To summarize again there are two things that are happening:

After doing `xdg-open "org-protocol://store-link?url=URL&title=TITLE"`.
The string "URL" is pushed into Emacs kill-ring.
But, this very string "URL", is not inserted into Wayland clipboard.

That was the first thing, string pushed into kill-ring, but not pushed simultaneously, into 
Wayland clipboard.

Now second thing: from that point onward, the other way around is broken. (And that is 
the part that is really annoying.)

[Then] I mouse-select a string in Firefox, or any application not Emacs. I verify the string is 
indeed in Wayland clipboard, I paste it in Firefox, or in the terminal (not Emacs).

Now I do `C-y`: this later string is not pasted, even though it should have been. I do `M-y` 
to see if I can find the string in the kill-ring: I can't find the string in the kill-ring.

What, instead, is the string at the top of Emacs kill-ring: the string "URL" (from the initial 
org-protocol action).

So Emacs has now stopped inserting strings from Wayland-clipboard into Emacs kill-ring.

No matter how hard I try.

The labor-intensive workaround:

Now what I do is copy a string inside Emacs using `C-w`.

Then, I verify if I can past it in Firefox: I can. It really is in Wayland clipboard.

Now I copy a string from Firefox into Emacs: it is not broken anymore, until the next time I 
use org-protocol, at which point it gets broken again.

And now it really is also present in Emacs kill-ring.

> save-interprogram-paste-before-kill:
>         Whether to save existing clipboard text into kill ring before
> replacing it. select-enable-primary:
>         Non-nil means cutting and pasting uses the primary selection.
> 
> Best,
> Ihor



[-- Attachment #2: Type: text/html, Size: 6764 bytes --]

  reply	other threads:[~2022-01-30 18:47 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-27  0:03 cut and paste not working after xdg-open "org-protocol://store-link?url=URL&title=TITLE" chris
2022-01-28 12:40 ` Max Nikulin
2022-01-30  3:12   ` chris
2022-01-30  3:36     ` Ihor Radchenko
2022-01-30 18:38       ` chris [this message]
2022-01-31  1:14         ` Ihor Radchenko
2022-01-31  2:13           ` chris
2022-01-31  3:28             ` Ihor Radchenko
2022-01-31  3:43               ` chris
2022-01-31  3:49                 ` chris
2022-01-31  4:00                   ` chris
2022-01-31  6:47                     ` Tim Cross
2022-01-31 16:29           ` Max Nikulin
2022-02-01  5:48             ` chris
2022-02-01  5:57               ` chris
2022-02-02 16:49                 ` Max Nikulin
2022-01-30  8:31     ` Max Nikulin

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

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to=1761146.GlYOGd2maZ@pluto \
    --to=inkbottle007@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).