[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: delete-selection-mode
From: |
Drew Adams |
Subject: |
RE: delete-selection-mode |
Date: |
Tue, 23 Mar 2010 11:09:06 -0700 |
> What do you think about marking commands that should delete the active
> region with a new interactive character (like "^" is used to call
> `handle-shift-selection'), so e.g. a new function
> `handle-delete-region' could delete the active region before
> running a command?
Delete-selection mode has just such a property: `delete-selection'. (But it is
simply a symbol property.)
This is precisely how it allows control over which commands delete the active
region and what behavior that deletion entails. It is the basis/essence of
`delete-selection-mode'.
The possible values of property `delete-selection' are:
kill - kill region
yank - delete region; adjust kill-ring for the yank
supersede - delete region only (ignore current command)
t (non-nil) - delete region (current command inserts text)
Property values for the commands handled by default:
kill: open-line
yank: (clipboard-)yank
t: self-insert-(command|iso)
insert-register
newline(-and-indent)
As an example of how users can take advantage of this, I put a value of t also
on `insert-parentheses' and
`completion-separator-self-insert-(command|autofilling)' (from completion.el).
- Re: delete-selection-mode, (continued)
- Re: delete-selection-mode, Chong Yidong, 2010/03/22
- Re: delete-selection-mode, Lennart Borgman, 2010/03/22
- Re: delete-selection-mode, Lennart Borgman, 2010/03/22
- Re: delete-selection-mode, Miles Bader, 2010/03/23
- Re: delete-selection-mode, David Kastrup, 2010/03/23
- Re: delete-selection-mode, Miles Bader, 2010/03/23
- Re: delete-selection-mode, Chong Yidong, 2010/03/23
- Re: delete-selection-mode, David Kastrup, 2010/03/23
- Re: delete-selection-mode, Chong Yidong, 2010/03/23
- Re: delete-selection-mode, Juri Linkov, 2010/03/23
- RE: delete-selection-mode,
Drew Adams <=
- Re: delete-selection-mode, Juri Linkov, 2010/03/24
- Re: delete-selection-mode, Stefan Monnier, 2010/03/24
- Re: delete-selection-mode, Juri Linkov, 2010/03/25
- Re: delete-selection-mode, Stefan Monnier, 2010/03/25
- Re: delete-selection-mode, Juri Linkov, 2010/03/26
- Re: delete-selection-mode, Stefan Monnier, 2010/03/26
- Re: delete-selection-mode, Kevin Rodgers, 2010/03/26
- Re: delete-selection-mode, Daniel Colascione, 2010/03/26
- Re: delete-selection-mode, Juri Linkov, 2010/03/26
- Re: delete-selection-mode, David Kastrup, 2010/03/26