emacs-devel
[Top][All Lists]
Advanced

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

Re: Yanking wrong text


From: Juri Linkov
Subject: Re: Yanking wrong text
Date: Sat, 23 Jun 2007 12:45:23 +0300
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux)

>> The comment in the implementation says that this was done because
>> otherwise yank would be a no-op.  So what?  I still need to insert
>> the last copied region even if it happens to be the same as the selected
>> region, and not insert some arbitrary text from the rest of the kill ring.
>
> I do not understand.  Please explain in more details your scenario.  I don't
> really understand what you're trying to do and what you're getting instead.

I'll describe step by step what I do.  Let's suppose that I have some
text (e.g. "garbage") on the top of the kill ring.  I copied this text
to the kill ring long ago (with e.g. M-w or C-w) and forgot about its
existence in the kill ring.

Now I want to copy some region to another place (no matter in the
same buffer or another buffer).  I select this region and add it
to the kill ring with M-w.  Now I go to another place, select a region
I want to replace with the text added to the kill ring from the first
region.  Now I select this region, and I expect that typing C-y will
replace it with the text of the first region from the kill ring.
When delete-selection-mode and cua-selection-mode are enabled, and
transient-mark-mode is also enabled, then yanked text from the top of the
kill ring replaces the active selection.  But really C-y replaces the
selection not with the text of the first region from the top of the kill
ring, but with the text "garbage" which is the second element of the kill
ring.  That's because the selected region happens to be the same as the
first region added to the top of the kill ring, and due to optimization
C-y inserts the second element of the kill ring.

You may ask why do I want to replace a region with exactly same text.
Usually text is very large, so I don't see that these regions have
no differences.  My goal is to copy the region to another place regardless
of the fact that it happens to be the same as the selected region to be
replaced in another place.

-- 
Juri Linkov
http://www.jurta.org/emacs/




reply via email to

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