emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: CUA mode incompatibility


From: Stefan Monnier
Subject: Re: CUA mode incompatibility
Date: Sun, 01 Apr 2007 20:52:06 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.96 (gnu/linux)

>> In the C-x/C-c/C-v (CUA ?) mode just selecting something with a mouse should
>> not have the effect of the C-c "copy". The existing behaviour prevents the
>> following (standard in the C-x/C-c/C-v world) sequence of events:
>> 1) select some text A, "copy" it with C-c
>> 2) select some other text B, press C-v ("paste"), replacing B with A
>> 3) select some more text C, press C-v ("paste") again, replacing C with A
>> 4) ...
>> 
>> In current emacs in point 3, C is replaced by B instead of A.

> This is not specific to CUA; that's how Emacs mouse drag works BY DEFAULT.
> You can customize mouse-drag-copy-region to get your preferred behaviour.

I'm not sure I understand, partly because I don't use CUA.
But here's the behavior without CUA:
1) select text A (copies it implicitly)
2) select text B, press C-y, which inserts B.
3) select text C, press C-y, which inserts C.

So there are 3 steps I can see to get the behavior he expects:
a - use a behavior similar to delete-selection-mode, such that C-y after
    mouse-drag replaces the marked text.  But this just changes the "insert"
    into "replace", which means that B replaces B, and C replaces
    B.  Bummer!
b - when C-y ends up replacing B for B, use the previous kill-ring entry.
    This fixes step 2 to replace B with A, but still leaves step
    3 replacing C with B.
c - rather than using the previous entry, C-y could just *drop* the latest
    entry.
All this without directly affecting mouse-drag-copy-region.

>From the scenario he describes, it seems that CUA already does steps `a' and
`b'.  Whether step `c' is desirable or not, I don't know.


        Stefan "whose local hacks also implement steps a and b but not c"




reply via email to

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