emacs-devel
[Top][All Lists]
Advanced

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

Re: Selection changes in revno 100822


From: Stephen J. Turnbull
Subject: Re: Selection changes in revno 100822
Date: Mon, 16 Aug 2010 02:36:42 +0900

Eli Zaretskii writes:

 > >  > I wasn't talking about clipboard pasting, I was talking about
 > >  > pasting from the primary selection.

 > > AFAIK you can't copy/paste from the Windows primary selection
 > > (unless it's a situation where moving doesn't make sense, such as
 > > between disks in Explorer), although you can drag it somewhere
 > > else.

 > You are confused (not that it's hard to become one in this thread).
 > I was talking about X here, not about Windows.

Perhaps I was not being sufficiently explicit.  There *is* an analogue
to the primary selection on Windows, but it is (at least) as limited
as the primary selection on X, although in a different way.  (Although
it would seem from discussion in this thread that Windows programmers
don't think of it that way.)

Because of this, it makes sense to look for a common interface that is
natural to Windows users, and is not unnatural (because not commonly
used for something else) to X11 users.  That something is drag and
drop, which happens to work on Mac as it does on Windows AFAIK.

It doesn't hurt if mouse-2 is enabled as paste-the-primary on X11.  In
fact, I would really like that combination.  Drag to move and mouse-2
to copy, without polluting the kill ring, would be a killer feature
IMHO.  Sometimes I want to move once, sometimes I want to copy one or
more times.  This gives me both.

 > You are confused.  The "as far as Windows use patterns" part is
 > about my past disagreements with David regarding how to map 3
 > selection types on X to a single clipboard on Windows.

Sure, but the reason you give is wrong.  There is a clipboard, and
there is the selection, which *can* but does not *always* interact
with the clipboard.  These can be distinguished by the user on Windows
as well as in X11.  If you drag a file in Explorer, it does not end up
on the clipboard.

 > The "give me some credit" part is about the distinction between
 > these 3 selection types on X: somehow, David thought I didn't
 > understand that, and that I needed a lecture about it.

Well, you may understand it, but you do not write in a way that would
allow someone familiar with X conventions and terminology to guess
that you do.  If you're going to consistently use terms that have a
specific definition in X ("selection", "primary") in a different way,
then you have a choice: be misunderstood, or repeatedly provide your
definitions.

Asking people who know X well to forget all the definitions they know
*when talking about X* is not an option.  The human mind is flexible
enough to use X definitions in the X world and Emacs definitions in
the Emacs world, but it is not going to successfully adapt to loss of
the familiar vocabulary that is *needed* for this kind of discussion,
just because you don't feel like learning to speak intelligibly to an
audience of Xperts.

 > You are talking about drag'n'drop, which does have a direct analog
 > on X.  I don't think drag'n'drop, in its current shape, could or
 > should be regarded as a kind of ``primary selection'' on Windows,
 > that would just make this discussion more confusing.

Drag and drop is not a primary selection, it is a way of manipulating
the primary selection (or its Windows analog).  The primary selection
is a set of objects contained in an area on the screen, normally
indicated by highlighting, which in practice can manipulated
ephemerally with the mouse, or which can be more durably handled by
placing them (as a group) on the clipboard.

 > > Some experienced X users use the "drag to select, middle button
 > > to paste" and "drag to select, drag again to move" gestures a lot
 > > (when available, drag to move isn't standard part of toolkits
 > > AFAIK, although some apps implement it).  If available, Windows
 > > users might like to use it too.

 > But it isn't available on Windows, not without overwriting the
 > clipboard with selected text.

Drag and drop *is* available, and I explained elsewhere a reasonable
compromise semantics (copy between apps, move within a document,
context-dependent for separate buffers within Emacs) which gives
Windows most of what I would want.  X11 can have full mouse-based
functionality by also binding mouse-2 to paste-primary-selection.

Of course the drop targets need to accept what Emacs has to offer, but
that's not Emacs's problem, I suspect most drop targets that should
accept dropped text do accept dropped text, and the user can always
fall back on C-c/C-v to work via the clipboard.

 > The only issue that still needs to be discussed (IMO) is which
 > gestures should cause PRIMARY to be set with the selected text and
 > which shouldn't.

Hey, Eli, you're the one who said, "let's talk about X first".  Well,
in X, that needs zero discussion.  In X, PRIMARY *is* the set of
objects in the selected (highlighted) area of the screen (which might
be text or a widget or an icon, or sets of the above).  I don't know
of any programs where this is not true.  And the program should not do
something different unless explicitly asked by the user.  It would be
insane on X if PRIMARY was not set (by default) when something is
selected.

If by "selected" you mean the Emacs region, that does need discussion,
but you've got the wrong idea.  It's not "which gestures," it's "which
face."  I would say that if you highlight the region with the same
face used to highlight an area selected by the mouse, then Emacs
should own PRIMARY and associate the region with it.  If the region is
not highlighted, or highlighted with a distinctive face different from
the one used to indicate the X selection, then Emacs should not own
primary for that region.

Of course you can then say, "which gestures should be associated with
which face".  On that, IMO the region should be either highlighted or
not, and when it is highlighted, it should be highlighted with the "X
selection face", and it should be associated with the PRIMARY
selection.  Regardless of the gesture(s) used to select the region.
IIUC, that is Miles's position, too.

N.B. 15 years of experience with that policy in XEmacs say it works
well, including the last ten years when selection by mouse, selection
by C-SPC, and selection by shifted motion have all been available (by
default).




reply via email to

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