Re: Programs that don't do X primary selection right

[prev] [thread] [next] [lurker] [Date index for 2004/10/11]

From: Zack Weinberg
Subject: Re: Programs that don't do X primary selection right
Date: 17:56 on 11 Oct 2004
Aaron Crane <hateful@xxxxxxxxxx.xx.xx> writes:

> Moreover, if application A owns the PRIMARY selection, it should offer a
> 'Copy' operation which copies it to the CLIPBOARD selection, so that it
> survives after you've selected something else.  And applications should
> distinguish middle-click paste (for the PRIMARY selection) and menu-item
> paste (for the CLIPBOARD selection).
>
> This is how it's meant to work.
>
>   http://www.freedesktop.org/standards/clipboards-spec/clipboards.txt

That looks accurate but for one thing: it doesn't clearly specify that
you're not supposed to drop PRIMARY if the visible selection goes away
for any other reason than someone else asserting PRIMARY.  In an
abstract user-interface design sort of way, I'm not sure whether
that's the Right Thing - but I do know that that's what's wired into
my fingers.

> Oh, there's way more than that to hate in GNU Emacs's selection
> handling.  The most insane bit is that M-Backspace (the obvious and
> natural way of deleting the word to the left of point) actually
> steals the PRIMARY selection.  This is because Emacs has an
> incredibly half-baked idea that the PRIMARY selection should be
> unified with the top of the kill-ring.  This doesn't work.  For
> example, even with transient-mark mode, selecting a region doesn't
> assert the PRIMARY selection.  No, you have to M-w (the equivalent
> of menu-item Copy) to do that.  Duh.

If you click through the reference to
<http://www.jwz.org/doc/x-cut-and-paste.html>; at the bottom of the
document you referenced, there's a long long rant about Emacs down at
the bottom of it.

I think what Emacs should be doing is unifying PRIMARY with the
region, but *only* in transient mark mode; leaving use of CLIPBOARD to
the clipboard-* menu commands; and not making any connection
whatsoever between the top of the kill ring and any X selection.
Yeah, that means sometimes I'll hit C-y and get some junk instead of
the PRIMARY text that I wanted, but I think I can get used to that.

Another irritating thing which I noticed just now while composing this
message - if you select text in Mozilla, and then you go type awhile
in Emacs and hit M-backspace incidentally while doing that, other X
clients definitely think Emacs has the primary selection now, but
Mozilla DOESN'T DESELECT THE TEXT.  Hate.

zw
There's stuff above here

Generated at 18:01 on 11 Oct 2004 by mariachi 0.52