From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Proposal for DEL to delete the active region Date: Sat, 01 May 2010 22:54:15 -0400 Message-ID: References: <87iq78uwyd.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1272768871 10663 80.91.229.12 (2 May 2010 02:54:31 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 2 May 2010 02:54:31 +0000 (UTC) Cc: emacs-devel@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun May 02 04:54:30 2010 connect(): No such file or directory Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O8PK9-0001LX-UM for ged-emacs-devel@m.gmane.org; Sun, 02 May 2010 04:54:30 +0200 Original-Received: from localhost ([127.0.0.1]:49021 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O8PK6-0002c7-Ur for ged-emacs-devel@m.gmane.org; Sat, 01 May 2010 22:54:26 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O8PK1-0002b7-QM for emacs-devel@gnu.org; Sat, 01 May 2010 22:54:21 -0400 Original-Received: from [140.186.70.92] (port=59940 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O8PK0-0002af-Jo for emacs-devel@gnu.org; Sat, 01 May 2010 22:54:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O8PJz-0006SN-9A for emacs-devel@gnu.org; Sat, 01 May 2010 22:54:20 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.183]:65478 helo=ironport2-out.pppoe.ca) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O8PJz-0006SG-60 for emacs-devel@gnu.org; Sat, 01 May 2010 22:54:19 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAOuF3EvO+KoL/2dsb2JhbACdLHK4f4USBIwo X-IronPort-AV: E=Sophos;i="4.52,311,1270440000"; d="scan'208";a="63057325" Original-Received: from 206-248-170-11.dsl.teksavvy.com (HELO pastel.home) ([206.248.170.11]) by ironport2-out.pppoe.ca with ESMTP; 01 May 2010 22:54:16 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id D2F9682C3; Sat, 1 May 2010 22:54:15 -0400 (EDT) In-Reply-To: <87iq78uwyd.fsf@stupidchicken.com> (Chong Yidong's message of "Fri, 30 Apr 2010 23:23:22 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:124408 Archived-At: > 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. Stefan 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).