[Top][All Lists]

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

Re: Proposal for DEL to delete the active region

From: Stefan Monnier
Subject: Re: Proposal for DEL to delete the active region
Date: Sat, 01 May 2010 22:54:15 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

> Here is a proposal for DEL to delete the region when transient-mark-mode
> is enabled.  DEL already does this in delete-selection-mode; the idea
> here is to move this behavior into transient-mark-mode proper.

The proposal has the property of being straightforward.  I like that.

> + (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.

> + (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.


PS: We will want to remove mouse-region-delete-keys and related code
ASAP since it is at the root of various known bugs (mostly due to the
fact that it delays the end of the mouse-selection commands to the
beginning of the next command, so post-command-hooks don't get run at
the expected time).

reply via email to

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