Subject: bug#6956: 24.0.50; pasting mouse selection in other session pastes only first word

From: "Drew Adams" <[email-masked]>
Date: Mon, 20 Sep 2010 15:24:22 -0700

> > No, it does not now work exactly as it did in Emacs 23.
> > 
> > Even setting `mouse-drag-copy-region' to nil in two 
> > sessions of `emacs -Q', one for Emacs 22 and the other
> > for Emacs 23 (for example), there is still no problem
> > selecting with the mouse and pasting into the other session. 
> 
> Emacs 24 did change the default behavior, so in Emacs 24, you _must_
> set mouse-drag-copy-region non-nil to get the pre-Emacs 24 behavior.
> 
> If you can point out what is different in the behavior of Emacs 24
> _after_ setting mouse-drag-copy-region wrt double-clicking mouse-1,
> please do.  Otherwise, this bug is done.

A user in Emacs 20, 21, 22, 23 could have `mouse-drag-copy-region' nil, and thus
not have mouse selection touch the kill ring - in principle (even if not in
fact, because of a bug), and yet s?he was still able to select and paste using
the mouse - between sessions, including sessions with different Emacs versions.

That ability is lost. This is a regression wrt the advertised behavior for Emacs
22 through 23 (ever since that user option has existed).

Or if it is not lost, tell me how s?he can do that in Emacs 24.

> > > > What's needed is here is the ability to mouse-select in one 
> > > > Emacs session and paste to another Emacs session, even if
> > > > they are in different Emacs versions.
> > > > That needs to be possible (and it should also be the 
> > > > default behavior BTW) without users also needing to pollute
> > > > their kill ring with the selection.
> 
> It wasn't possible to do this in Emacs 23 without "polluting the kill
> ring", AFAICS. In Emacs 23, double-clicking mouse-1 would copy the
> text to the kill ring even if mouse-drag-copy-region was nil.  If you
> know otherwise, please show how to achieve that (in Emacs 23).

Yes. But what matters is not just "AFAICS" but what the product was _supposed_
to do, what `mouse-drag-copy-region' advertised that it did, even if it did not
actually do that on some (all?) platforms.

IOW, you seem to be just pointing out that there was an Emacs 22/23 bug here, in
that `mouse-drag-copy-region' polluted the kill ring even when it was nil.

We're not about to fix Emacs 22 or 23 bugs now, but we can at least make it work
as advertised/intended for Emacs 24.  I report the bug for Emacs 24, even if it
is also a bug for 22 and 23.

> > They need to be able to get this select+paste independently of
> > whether mouse selection is copied to the kill ring.
> 
> Since this wasn't possible in Emacs 23, you are in effect asking for a
> new feature.

That "new feature" was implicitly available before, even if it was prevented
from working for nil `mouse-drag-copy-region' because that option always acted
as non-nil.

> The old behavior is completely restored by customizing
> mouse-drag-copy-region; 

Not the intended, advertised behavior, but a buggy behavior.
`mouse-drag-copy-region' was a no-op option.  Now it works, but when it is nil
select+paste does not work between sessions with different Emacs versions.

> after that Emacs behaves on Windows in a way
> that is 100% compatible with what it did in Emacs 23 and before.  If
> you can show the difference in behavior, please do.  The fact that a
> variable needs to be customized is not in itself a change in behavior.

The problem is not needing to customize the behavior.  The problem is that the
nil value does not work wrt mouse select+paste.  The option was not created to
prevent select+paste between sessions (and only when those sessions are for
different versions!?). It was created only to choose whether the kill ring is
affected by mouse selection.  Mouse selection + paste should not depend on the
kill ring.

Users should be able to get the behavior that we claimed they could get in Emacs
22/23.  We never said that you could mouse-select + paste between sessions of
different versions only if the selection was copied to the kill ring. So let's
please find a way to let users do what was intended to be allowed in the past,
even if a bug prevented it back then.

The bug in the past was that `mouse-drag-copy-region' was a no-op.  That's fixed
now.  But a different bug now shows up, whether it was latently present before
or is new due to the change in selection in Emacs 24.  That new bug is the one I
reported: "pasting mouse selection in other session".