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: Eli Zaretskii
Subject: Re: delete-selection-mode as default
Date: Tue, 18 Sep 2018 19:46:30 +0300

> From: Yuri Khan <address@hidden>
> Date: Tue, 18 Sep 2018 22:28:23 +0700
> Cc: address@hidden, address@hidden, 
>       Joost Kremers <address@hidden>, Noam Postavsky <address@hidden>, 
>       Emacs developers <address@hidden>, Alan Mackenzie <address@hidden>, 
> Drew Adams <address@hidden>, 
>       Phillip Lord <address@hidden>
> 
> On Tue, Sep 18, 2018 at 9:16 PM Eli Zaretskii <address@hidden> wrote:
> 
> > > What changes by delete-selection-mode cannot be worked around by
> > > (temporarily) deactivating the region?
> >
> > Deactivating the region makes it disappear from view, which I think we
> > should avoid.  Users will not expect the region to disappear.
> > Moreover, this is currently impossible, because your fictional C-S-g
> > command doesn't exist.
> 
> Well, your hypothetical “disable-delete-selection-mode-temporarily”
> does not exist either.

Of course, it isn't.  We are discussing what should we add to Emacs to
make such actions possible.  And my point is that as long as we are
adding a feature, it would be better if it did not deactivate region,
because doing so have certain disadvantages.

> > If we are going to introduce a command for temporarily disabling or
> > re-enabling the region, we had better do it without making it
> > disappear from display, IMO.
> 
> As a user of transient-mark-mode, shift-select-mode and
> delete-selection-mode, I’d expect to be among the target audience for
> this facility being discussed. But, strangely, I very rarely find
> myself in a situation where I have an active region that I want to
> preserve for later while wanting to type something. I am certainly
> okay with temporarily deactivating the mark and the region
> highlighting, if I know I’ll be easily able to re-activate it.

Then perhaps we should have 2 variants of such a command, one that
deactivates the region and another that doesn't.

> How would a command to temporarily suspend delete-selection-mode work?
> I assume the user will have to press at least one key to invoke it.
> Then, I expect there will be an unpredictable sequence of self-insert
> and/or yank and/or other editing commands, so the user will also
> indicate the moment when he/she wants delete-selection-mode back. At
> this point, it is not going to be any more efficient than just binding
> delete-selection-mode to an easy key or binding C-S-g to (lambda ()
> (interactive) (activate-mark)); each of these takes one keypress
> before and one keypress after typing-without-replacing-selection.

It is not more efficient, but leaving the region highlighted might be
preferable for use cases you don't care about.

> Also, a user who enables and disables d-s-m often would need some kind
> of indication of its current status — either a modeline lighter or a
> special face for the region when it is active but will not be replaced
> by typing.

Agreed.



reply via email to

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