[Top][All Lists]

[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 22:28:08 +0700

On Sun, Sep 16, 2018 at 8:51 PM hw <address@hidden> wrote:

> Emacs has point and (the end of) the region (selection) always entangled
> with no way to separate them or to disable the region.  That is what I
> dislike so much, and it causes all kinds of issues.
> Can we have a mode or something in which there is no association between
> point and the end of the region?  Or can I just configure that
> association away?

That would be hard. You’d probably want it to work for all commands,
including third-party packages. Pretty much every command that acts on
a block will assume it to be between point and mark. And a
hypothetical wordstar-like-block-mode would not know if a command
accesses point and mark as region boundaries or as a navigation stack.

A serious approach to making persistent blocks a reality would
probably involve the following:

1. Define a couple of functions, say ‘region-start’ and ‘region-end’.
Initially, make them return (min (point) (mark)) and (max (point)
(mark)), respectively.

2. Redefine (interactive "r") to use region-start and region-end.

3. Go through every function that uses (point) and (mark) to mean
region boundaries, and change them to use region-start and region-end,

4. After that, make the behavior of region-start and region-end
customizable, and have wordstar-like-mode customize them to return the
appropriate marker values.

5. Do something about functions that activate the mark
(shift-selection, mark-word, mark-sexp, mark-defun, …) so that they do
the right thing to region markers.

(No, I’m not going to work on that. But someone who Really Wanted to
have a wordstar-like Emacs could try.)

reply via email to

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