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: Drew Adams
Subject: RE: delete-selection-mode as default
Date: Sun, 9 Sep 2018 07:48:05 -0700 (PDT)

>   > > How come it wasn't distinguished between the concept of a region being
>   > > active and the visual aid of marking a region?
> 
>   > Separating these two concepts could be useful, but Emacs would then
>   > need some other way of showing the user that a region is active, like
>   > a mode line indicator.
> 
> We could have another minor mode to control whether Backspace deletes
> an active region.  That would solve the problem for me.  We would still
> have the issue of what the default should be.

1. The behavior you object to here does not come from `d-s-m'.
(I guess you realize that, since you see the behavior and you don't
turn on `d-s-m'.) It comes from option `delete-active-region':

----8<------
delete-active-region is a variable defined in `simple.el'.
Its value is t

Documentation:
Whether single-char deletion commands delete an active region.
This has an effect only if Transient Mark mode is enabled, and
affects `delete-forward-char' and `delete-backward-char', though
not `delete-char'.

If the value is the symbol `kill', the active region is killed
instead of deleted.

You can customize this variable.

This variable was introduced, or its default value was changed, in
version 24.1 of Emacs.
----8<------

So you don't need another mode, to get what you want; just
customize that option.


2. Wrt `d-s-m', you can easily configure `d-s-m' to do what you want
for any given command. For example, if you were seeing the
behavior that you dislike here because `d-s-m' was turned on (and
not because of `delete-active-region') then you could just tell
`d-s-m' not to do anything for the command that you have bound
to <backspace>.

All you need to do, to make `d-s-m' do nothing for a given
command, is to set the `delete-section' property on that
command's symbol to nil. E.g., if `d-s-m' was the culprit in the
behavior you object to here, and if <backspace> was bound to
`delete-backward-char', then you would just do this:

(put 'delete-backward-char 'delete-selection nil)



reply via email to

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