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 12:42:32 +0900

Drew Adams writes:
 > >  > Mouse-2 _was_ pasting until very recently.
 > > That's because of the (bogus) historical association of the
 > > selection with the kill-ring in Emacs.  Good riddance, IMO.

 > Reason?  Emacs has always had that feature (as long as I can
 > remember, at least).  And IMO it is a positive, handy feature.  I
 > take advantage of it all the time.
 > 
 > Why is it "bogus"?  What is gained by losing the ability to yank
 > from the kill ring using the mouse?

Who's suggesting you lose that ability?  If you want that ability,
that's fine with me.

;; This works in XEmacs, I dunno about Emacs
(define-key global-map 'mouse-2 #'mouse-yank)

The "bogus association" I'm referring to is where Emacsen copy the X
primary selection to the kill ring under certain circumstances.  This
tends to pollute the kill ring (or other clipboard feature) with
ephemeral text.

 > Why care so much about X11 (or Windows or...)?  Why not define the
 > best interaction for _Emacs_ itself?  From the descriptions here of
 > the X behavior, I see no advantage over the traditional Emacs
 > behavior regarding selection, copying, killing, and yanking.

I understand that.  But then, you're Helen Keller, a genius, but blind
nevertheless.  If you had the X behavior available, I suspect you
would use it increasingly frequently and come to appreciate it.

 > I don't think anyone has explained the advantage for Emacs users
 > _in Emacs_.

There are two kinds of copying, cutting, and pasting.  The first is
ephemeral, for example twiddling text.  In my global-map, this is
a single operation, bound to C-t, M-t, C-M-t, etc.  The obvious (to
me, anyway) mouse gesture to implement transpositions is drag and
drop.  This should not affect the kill ring.  Similarly, I'd like a
non-kill-ring-polluting copy/paste, which is what binding mouse-2 to
x-insert-selection should do IMO.

 > Why should it be all-important for Emacs to limit its user
 > interaction to what X11 defines?

Please reread the thread.  Eli asked us to focus on X Windows behavior
because (1) it's the most flexible, and (2) it's the window system
implemented as free software.

I believe that (1) is a *fact*; X11 is capable of implementing, using
standardized protocols, all of the selection-oriented capabilities of
both Windows and Mac OS X that I know of.  If you know otherwise,
please inform me.

 > It is far more important that Emacs user interaction be useful and
 > _internally_ consistent than that it be the same as what some app
 > or window mgr might define.

That's disingenuous, Drew, and you should know better.  In fact in
modern environments certain conventions are *extremely* widespread and
accurately implemented by almost all applications.  In the case of the
PRIMARY selection on X, *all* applications (except Emacsen, to my
knowledge) *implement* the lightweight model of the PRIMARY selection.
Those that want to emphasize the clipboard can (and do) do so, via the
standardized CLIPBOARD selection.

 > X-standardization of Emacs is not my goal.  If it is the proposed
 > goal here, then please provide some user-oriented arguments.  Tell
 > us what _users_ gain and what they lose by such a change.

Conformance to X behavioral standards is not an Emacs goal, as stated
by anyone in this thread AFAICR.  What Eli requested is that we
discuss what behavior should be implemented in terms of targeting the
X platform, and worry about translating that to the other platforms.
Of course it is a *very* good idea to conform to various X standards
for *implementation* of the chosen behavior, because that maximizes
the ability to communicate what Emacs needs and offers to other apps.

 > "Supposed" by whom?  That question seems to be the elephant in the
 > room.

You obviously haven't read and comprehended my posts.  The _primary
selection_ on X is *defined* by the X protocol to be a _region_ on a
_screen_ of a _display_.  The underlined terms are all terms of art in
X with precise definitions, and I'm using them that way.  I made that
pretty clear, but I guess not clear enough.  Read my lips: in this
post, and in preceding posts, when talking about terms with precise
definitions in the X Window System, I use those definitions.

All of the window systems I use (X, MS Windows, Mac OS X) have a
protocol analogous to the X primary selection.  In the X standards,
the protocol deliberately makes no provision for automatic persistence
of the primary selection in the face of changes.  It's WYSIWYG, and
therefore ephemeral: if the highlighted part of the screen changes or
moves, so does the selection.  A separate selection, the CLIPBOARD
selection, is provided for users who want some degree of automatic
persistence.  (Unlike Windows and Mac, the X protocol for CLIPBOARD is
very abstract; the various X desktop environments have more or less
sensibly settled on imitating Windows and Mac clipboard protocols for
concrete implementations.)

In the case of drag and drop, *all* of the window systems do treat
the (analogue to the) primary selection as emphemeral; they do not
copy to a clipboard or other persistence mechanism (except in the case
of the drop target being a clipboard, of course).  This is an
observable fact, not an opinion or suggested policy.

 > X11 has not bought Emacs, AFAIK, so why act as if Emacs is being
 > swallowed?

Drew, you're hallucinating.  Calm down, and throw that blotter in the
shredder.  Focusing on X has two purposes: figuring out what *can* be
implemented, and working out the implementation on the free platform.
That's what Eli said, and AFAIK nobody has said differently, although
several people advocate the position that "it would be nice if" Emacs
could conform to traditional X practice in this regard, especially
where it doesn't conflict with desired Emacs practice.

Granted, I'm willing to go somewhat farther and say that the
traditional Emacs practice is relatively undesirable, and should be
made a non-default option.  Nothing wrong with me having an opinion
and expressing it, is there?

 > Who says so?  Not Emacs.  Not until now.  Emacs has traditionally
 > associated mouse-2 pasting with yanking the head of the kill ring.

And it still can.  What I object to is the automatic association of
the content of the primary selection with the kill ring.  It's a
bloody annoyance to some users, hard to specify sanely, and really
difficult to implement correctly and efficiently even if you have a
precise specification, even on X where "primary selection" is a
defined concept, and not a mere analogue to a concept from an alien
window system.

It is true that Emacs users on X learn to stop using the selection as
it was designed to be used.  Their heads stop hurting, the blood on
the hammer dries, and they even convince themselves they like the
change.

 > That might not be what is interesting to X11, but it is interesting
 > to Emacs and Emacs users.

To some of them.  To others, it's a bloody annoyance, and has been,
for decades.  I won't repeat what Jamie Zawinski had to say about it,
but leave it up to your imagination.  It was, uh, colorful but
uninformative.

 > > Since your hand is already on the mouse in most cases, why would
 > > you use a different interface to manipulate the selection?

 > For one thing, your hand might no longer be on the mouse when you
 > want to do that.  You seem to have a simplistic idea of mouse use.
 > 
 > Do you (Stephen) actually use both the mouse and the keyboard for
 > selecting and yanking/pasting?  Maybe not.  I do.

Yes, I do.  Until I disabled the automatic insertion of the primary
selection into the kill ring, however, the ratio was 60-40, at best
50-50, in favor of the keyboard.  Once I did that, however, I'd say I
use the mouse about 3:2 over the keyboard, and almost all of that is
due to an increase in use of the mouse to manipulate the primary
selection, not to a shift from keyboard to mouse.  If I had good DND
support within XEmacs, it would surely increase even more.

 > In fact, yanking with C-y is so handy,

Agreed.  And believe me, I've noticed how much you love repetition.  I
think we all have.  But you're unusual in that respect.

Sometimes, frequently, I want the selection on the kill ring for
various reasons, which is why in my XEmacs the popup menu has
#'copy-primary-selection as its default entry.  Click-drag-1 to select
text, mouse-3 to popup the menu, mouse-1 to copy, and Bob's your
uncle.  But I don't want everything I select and insert on the kill
ring; in fact, mostly I don't want the stuff I select and copy on the
kill ring.  Thus that's relegated to the popup menu.

FWIW, this is one of the few customizations I permit myself.  If I
allow myself to use customizationg not in the mainline, I find that I
get even more out of touch with the pain we inflict on our users.  But
this one is sufficiently important to me to break the rules.

 > even when the selection might have been made previously using the
 > mouse, that I personally do the same thing for the _secondary_
 > selection.

"Secondary selection" is a term of art in X, and in XEmacs there is no
way to access the X secondary selection in the default keymaps,
although the necessary commands are defined and I believe they work.
Is X secondary selection available by default in Emacs?  Did you
implement it?  Do you mean something else?

 > (And in Emacs, at least, the secondary selection definitely _is_
 > less ephemeral than the region, primary, and clipboard.)

If you mean the X secondary selection, that's *really* weird.  In X,
it's called "secondary" precisely because it mostly doesn't exist at
all, let alone persist.[1]  So I'd appreciate it if you'd define what you
mean by "secondary selection".

 > There seems to be an assumption here that mouse and keyboard do not
 > mix.

Not on my part.  The mouse and the keyboard are different, and
switching between them involves a small cost.  Switching often would
involve a big cost, so it's worthwhile duplicating the features
available from the keyboard on the mouse if the number of switches can
be dramatically reduced.  On the other hand, there are subtle
differences in how efficiently they can be used for different
purposes, and the default bindings should be tuned to take advantage
of those efficiencies.

 > At the very least, the traditional (superior) Emacs way should
 > still be available.

Superior to what?  Traditional X ca. 1995, with no common conventions
for clipboard use except Motif's execrably expensive protocol and the
very weak MIT xclipboard implementation?  Current Windows, with no way
to paste from the clipboard with a mouse click?  Agreed, it's superior
to those.  Superior to what could be?  Not in my experience; the
traditional Emacs way strongly discouraged me from using the mouse,
without substantially increasing the usability of the keyboard.

 > So far, all I've heard (I have not studied each mail in detail,

It would repay you in saved misunderstandings if you would do so.

Footnotes: 
[1]  AIUI, the design rationale in X was to allow you to exchange two
discontiguous selections, or copy the primary selection over the
secondary selection, obliterating the latter in the process.  AFAIK
it's rarely implemented by applications.




reply via email to

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