Subject: bug#6774: Cut and paste with C-w/mouse-2 not working?

From: Jan Djärv <[email-masked]>
Date: Mon, 16 Aug 2010 10:51:03 +0200

2010-08-16 10:16, Kenichi Handa skrev:
> In article<[email-masked]>, Stefan Monnier<[email-masked]>  writes:
>
>>> And, first of all, from a user point of view, as these two
>>> highlights a region exactly the same way (with the default
>>> setting),
>>>    (1) S-C-n
>>>    (2) C-@ C-n
>>> it's very confusing that they behave differently as to
>>> selection.
>
>> I haven't seen any report indicating that users really get confused
>> by that.
>
> As I don't like transient-mark-mode (both the default one
> and the temporary one), I have not used it.  But, for the
> discussion of this thread, I tried it and found the current
> behaviour is confusing.
>
>> But I'm not opposed to eliminating this confusion.  I just
>> really don't want to see it implemented in set_point_both, and I'm not
>> excited to seeing it in command_loop_1 either.
>
> How about this?
>
> We own the primary selection when mark is activated by C-@
> in transient-mark-mode or C-@ C-@ not in
> transient-mark-mode, and record somehow that selection is
> owned that way (i.e. selection contents is a text in the
> region).  At that time the contents is null, but I think
> it's not the problem.  We do nothing special for all point
> moving commands (except for highlighting the region).  When
> Emacs receives selection request, it returns the text in the
> region if the selection is still owned as the above way.  We
> disown the selection when mark is deactivated.
>

I though we where moving away from special cases?  Anyway, empty selection do 
matter.  Consider this case:

I select a lot of code in another application.
I go to Emacs and set mark, then paste the code with mouse-2 and then M-x 
indent-region.

With your scheme, mouse-2 would fail to paste, which would be a nasty surprise.

	Jan D.