bug-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#58606: Emacs next pgtk crashes when pasting to other app


From: bokr
Subject: bug#58606: Emacs next pgtk crashes when pasting to other app
Date: Wed, 26 Oct 2022 15:37:47 +0200
User-agent: Mutt/1.10.1 (2018-07-13)

Hi Joshua,

On +2022-10-25 10:27:48 -0400, Joshua Branson via Bug reports for GNU Guix 
wrote:
> Andrew Tropin <andrew@trop.in> writes:
> 
> > On 2022-10-18 10:52, Andrew Tropin wrote:
> >
> >> Recently discovered a problem, which reproduces this way:
> >> - Open a new emacs instance.
> >> - Yank anything with M-w or select with mouse.
> >> - Paste yanked text to chromium/icecat.
> >>
> 
> I sometimes run two instances of Emacs.  I discovered today, that Emacs
> cannot yank from one and paste to another.  When I try to paste I get this
> mysterious warning message in Emacs:
> 
> "waiting for reply from selection owner."
> 
> 
> 

Disclaimer: Sharing newbie discovery, inviting risk commentary, no warranty :)

A hack to get around clipboarding hangs (which I won't go into here :)
is (if you are safely by yourself on your laptop) this:

Select what you want to copy-paste as usual
(Ctl-Space and move point to end of region)
but then don't copy it with  Mx w --
instead do shell-op on region like
--8<---------------cut here---------------start------------->8---
Esc |
tee /tmp/foo
--8<---------------cut here---------------end--------------->8---
that should write your region into /tmp/foo

Then switch to your other emacs instance and insert
foo contents at point using

--8<---------------cut here---------------start------------->8---
Ctl-x i
/tmp/foo
--8<---------------cut here---------------end--------------->8---

tee should not have added any newline unless you had it in
your selected region, and Ctl-x i should insert verbatim.
(well, probably modulo different encodings in various buffers. Idk :)

If you want to hop between gui and emacs -nw it should work
fine there too. I've tried that.

If you want to do like append-string, adding to the end of foo, use
...|tee -a /tmp/foo
or use separate files ad lib, of course: whatever|tee /tmp/bar

If you want to be a bit safer, it'd probably be good to make
a restricted temp dir like

--8<---------------cut here---------------start------------->8---
$ mktemp -d /tmp/joshclips.XXXXXX.d
/tmp/joshclips.rinY4L.d
$ ls -ltra /tmp/joshclips.rinY4L.d/
total 8
drwxrwxrwt 16 root root 4096 Oct 26 12:59 ..
drwx------  2 bokr bokr 4096 Oct 26 12:59 .
--8<---------------cut here---------------end--------------->8---
(note the restricted write perm just to user, not group)

and then tee to
/tmp/joshclips.rinY4L.d/foo

Of course, if you want to preserve your cutting room detritus,
you can use other directories than /tmp :)

BTW, you could of course plain write foo with Crl-x w
but then you'd get interaction that using tee and insert avoids.

Also you could use cat > or cat >> in place of tee and tee -a
respectively, but then your selected region would disappear
because redirected cat effectively returns '' as the filtered region,
unlike tee which makes no mod, just sneaks a copy.

Using cat you'd have to undo with Crl-underscore.
No big deal, but tee avoids it :)

Please excuse that this wasn't on the fseg topic. SFTN.
--
Regards,
Bengt Richter





reply via email to

[Prev in Thread] Current Thread [Next in Thread]