emacs-devel
[Top][All Lists]
Advanced

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

Re: delete-selection-mode as default


From: Yuri Khan
Subject: Re: delete-selection-mode as default
Date: Sun, 16 Sep 2018 15:06:09 +0700

On Sun, Sep 16, 2018 at 10:15 AM hw <address@hidden> wrote:

> In joe, you make a selection by pressing C-k b to mark the beginning and
> C-k k to mark the end of the selection.  The selection is called a block
> in joe. It is highlighted.  You can change it any time by setting the
> marks again.
>
> Now you can copy the block with C-k c, meaning the whole block is
> inserted at point, and the copy is the new selection.  The beginning and
> the end of a block (selection) can both be off screen.

I recognize this as the WordStar block/region/selection model. Yes, I,
too, was quite used to it in my Turbo Pascal years (late ’90s). Later,
I migrated to Windows and got used to its CUA-like model.

(Emacs has a WordStar emulation in obsolete/ws-mode.el, but it is
unusable because of several reasons:

* It is unmaintained and obsolete.
* It is a major mode, meaning no syntax highlight, no
language-specific features, just text editing.
* It does not highlight the block.
* When deleting the block, it does not move point to where it was.
This makes it possible to mark a block, scroll it off the screen, and
delete it without realizing you did it.)


I think it is instructive to compare a few selection/region/block
models, all of which have been quite successful.

* WordStar model: Block is delimited by two markers, and is
highlighted. (Some implementations allow toggling the highlight; when
highlight is off, markers are preserved but block commands are not
available.) Moving the cursor or typing text does not affect block
markers (except to adjust their positions to accommodate length
changes). Basic block operations are: copy to point, move to point,
delete, write to file, read from file. (The latter inserts the
contents of the file at point and puts block markers around it.)

* Brief model: Block is delimited by mark and point (like in Emacs).
Pressing Alt+A starts selecting the corresponding type of block (which
is highlighted); pressing the same key again removes the highlight.
When selecting, newly typed text is inserted normally at point. Block
operations are: cut, copy, paste, delete, write to file. When no block
is highlighted, these act on the current line.

* Windows model: Selection is defined by two positions, one of which
is at point. Unshifted cursor movement cancels the selection, shifted
cursor movement extends or shrinks it, text insertion replaces the
selected text, and both Backspace and Delete delete the selected text.
Selection operations are cut, copy, paste, and delete; when there is
no selection, cut and copy are disabled, and Backspace and Delete act
on one character backward and forward, respectively.



reply via email to

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