[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: |
Fri, 7 Sep 2018 09:27:04 -0700 (PDT) |
> I call it a design flaw because if whoever made it this way had given
> any thought to it, it would at least be customizable
Actually, beyond being customizable by configuring it to be on or
off by default, it is customizable (but not just by using Customize),
in a fine-grained way.
You can easily configure the behavior to use for any given command,
by putting a particular `delete-selection' property value on its symbol.
These are the possible `delete-selection' property values:
* `yank' - For commands that do a yank. Ensures that the region
about to be deleted is not yanked.
* `supersede' - Delete the active region and ignore the current
command: the command just deletes the region.
* `kill' - `kill-region' is used on the selection, rather than
`delete-region'. (Text selected with the mouse is
typically yankable anyway.)
* anything else non-nil - Deletes the active region prior to
executing the command, which inserts replacement
text. This is the usual case.
Commands that insert text but do not have property
`delete-selection' (or commands for which it's value is nil)
do not delete the selection.
For example:
;; Don't let `insert-char' delete the selection.
(put 'insert-char 'delete-selection nil)
More typically is the case where a library defines a new
editing command that it wants to make susceptible to
`delete-selection-mode'. For example:
;; Let delete-selection mode delete the region.
(put 'icicle-delete-char 'delete-selection 'supersede)
Simple, elegant command-specific behavior. Trivial to
configure - for both users and libraries.
- RE: delete-selection-mode as default, (continued)
- RE: delete-selection-mode as default, Drew Adams, 2018/09/09
- Re: delete-selection-mode as default, Juri Linkov, 2018/09/16
- RE: delete-selection-mode as default, Drew Adams, 2018/09/16
- Re: delete-selection-mode as default, Juri Linkov, 2018/09/17
- RE: delete-selection-mode as default, Drew Adams, 2018/09/17
- Re: delete-selection-mode as default, Juri Linkov, 2018/09/17
- RE: delete-selection-mode as default, Drew Adams, 2018/09/17
- Re: delete-selection-mode as default, Jostein Kjønigsen, 2018/09/19
- Re: delete-selection-mode as default, Juri Linkov, 2018/09/19
- Re: delete-selection-mode as default, hw, 2018/09/07
- RE: delete-selection-mode as default,
Drew Adams <=
- Re: delete-selection-mode as default, Clément Pit-Claudel, 2018/09/08
- Re: delete-selection-mode as default, hw, 2018/09/10
- Re: delete-selection-mode as default, Richard Stallman, 2018/09/08
- Re: delete-selection-mode as default, Elias Mårtenson, 2018/09/08
- Re: delete-selection-mode as default, Eli Zaretskii, 2018/09/08
- Re: delete-selection-mode as default, hw, 2018/09/08
- Re: delete-selection-mode as default, Charles A. Roelli, 2018/09/08
- RE: delete-selection-mode as default, Drew Adams, 2018/09/08
- Re: delete-selection-mode as default, Richard Stallman, 2018/09/09
- RE: delete-selection-mode as default, Drew Adams, 2018/09/09