emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Proposal for DEL to delete the active region


From: Chong Yidong
Subject: Re: Proposal for DEL to delete the active region
Date: Sun, 02 May 2010 10:34:24 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.96 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>> + (defcustom delete-backward-char-delete-region t
>
> But this doesn't seem right: we're not going to have one such variable
> for delete-backward-char, delete-char, delete-backward-char-untabify,
> and the handful of other commands that
>
>    grep "'delete-selection 'supersede" lisp/**/*.el
>
> indicate will want a similar treatment.

I count ten such commands, all variants of delete-char or
delete-backward-char.  I think these should all obey the same two
variables.  For instance, `c-electric-backspace' should obey
`delete-backward-char-delete-region', and `org-delete-char' should obey
`delete-char-delete-region'.

>> + (defun delete-backward-char (n killflag)
> [...]
>> +   (interactive "p\nP")
>> +   (unless (integerp n)
>> +     (signal 'wrong-type-argument (list 'integerp n)))
>> +   (cond ((and (use-region-p)
>> +          delete-backward-char-delete-region
>> +          (= n 1))
>
> the other problem here is that this change also affects calls from Lisp
> rather than only interactive calls.

Good point.  How about splitting up the functions, similar to next-line
vs forward-line?

So, we'd leave delete-backward-char unchanged, and create a new command
`delete-backward' which is the default binding for [DEL].  Similarly, a
new function `delete-forward', which is the default binding for
[delete].




reply via email to

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