[Top][All Lists]

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

RE: Some developement questions

From: Drew Adams
Subject: RE: Some developement questions
Date: Fri, 7 Sep 2018 15:52:42 -0700 (PDT)

>>>> accident would be the only case in which the selection would be replaced.
>> >
>> > C-y to yank a replacement, possibly followed by M-y to get different
> > replacements.
> That doesn't replace the selection but disables it and yanks --- and it
> would only happen by accident because I don't do such weird things.
> You're probably using a different setting.

Works for me, including from `emacs -Q'. Perhaps you are using a different 

1. emacs -Q

2. M-x delete-selection-mode ; Turn it on

3. Select a word in the first line of buffer *scratch*, say `The', and then 
`M-w' to copy it to the kill-ring. Do that a few times, with different words, 
say `buffer', `is', and `for'. So the kill-ring is populated with a few kills.

4. Select some text in the second line.

5. `C-y' replaces that selected text with `for'. `M-y' replaces `for' with 
`is'. `M-y' replaces `is' with `buffer'.

> > And if, like me, you have a key that yanks the secondary selection,
> > yank it to replace the region.

FWIW, that's is a frequent use case for me. Select some text, then `C-M-y' to 
replace it with the secondary selection. Do that wherever, whenever. Replace 
anything with the same bit of text. (Or you can do the same kind of thing using 
a register instead of the secondary selection.)

> > It's no different from what you do now, except that you precede
> > such operations by explicit C-w to first delete the region.
> It is different because the way you do something makes a difference.

The result is the same; that was the point: With `delete-selection-mode' you 
can easily replace selected text with other text. The way you do that without 
`d-s-mode' is the same, except you explicitly use `C-w' to kill the text before 

That's the only difference, except that `d-s-mode' doesn't always kill (`C-w'). 
What it does depends on the command used when the region is active, and that 
behavior is configurable.

> The result may be identical until you hit the wrong key and something
> gets replaced or de-selected by mistake.  It's ok if you want that; I'd
> rather have strict-mode.
> I don't want anything to happen to a selection just because I pressed
> the wrong key. 

Nor do I. Who does?

Have you never hit `C-w' by mistake, i.e., as "the wrong key"? Did you get 
excited about that, or did you just undo the mistake?

> Having selections randomly replaced or disabled ... makes things difficult, 
> confusing and errorenous.

Hyperbole. `delete-selection-mode' does not randomly replace or disable 

You're not used to it perhaps. And you don't like it. Leave it at that. People 
are different. It's no harder for you to turn `d-s-mode' off in your init file 
than it is for me to turn it on. This discussion is about what the default 
behavior should be.

reply via email to

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