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

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

Re: delete-selection-mode and overwrite-mode


From: Juri Linkov
Subject: Re: delete-selection-mode and overwrite-mode
Date: Thu, 11 Aug 2005 04:07:04 +0300
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

> I have a feeling this fix is not enough.  It seems to me
> that if you delete a selection in this way, then type
> several more self-inserting characters, none of them should
> overwrite.  Don't you agree?
>
> At the same time, the most natural way to achieve that result
> is to turn off overwrite.  I have to wonder, is it reasonable
> to turn on both Overwrite mode and Delsel mode?

Overwrite mode is really like a submode of Delsel mode.  In Overwrite
mode, after typing a character it deletes *one* character, and
inserts a typed character.  In Delsel mode, after typing a character
it deletes *many* characters from the selected region, and inserts
a typed character (the main difference between these modes is that
you don't need to select a region with one character in Overwrite mode).

> What was your motive for using them together?

I encountered a situation where I needed to replace characters
one for one (I temporarily enabled Overwrite mode for that), then
I reached a few characters needed to be replaced with one character.
Since I use Delsel mode permanently, it was natural to select a group
of characters and to type a replacement character.  After that,
I planned to continue replacing characters one for one.  But the
deleted character (after the selected region) shifted the text one
character to the left and broke the sequence (I needed to see what
character I replace in Overwrite mode).

So deleting the character after the selected region is a bug for me.
Note that this character becomes deleted even if point is not located
immediately before that character.  This may happen when point is on the
beginning of selected region.  This goes against the logic of Overwrite
mode where characters are replaced under point.

My patch fixes this bug in a way that makes Overwrite mode and Delsel mode
to coexist in a reasonable way.

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





reply via email to

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