From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: Proposal for DEL to delete the active region Date: Sun, 02 May 2010 10:34:24 -0400 Message-ID: <87y6g274pb.fsf@stupidchicken.com> 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 1272810880 31217 80.91.229.12 (2 May 2010 14:34:40 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 2 May 2010 14:34:40 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun May 02 16:34:39 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 1O8aFh-0007he-Tg for ged-emacs-devel@m.gmane.org; Sun, 02 May 2010 16:34:38 +0200 Original-Received: from localhost ([127.0.0.1]:43353 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O8aFh-0003U1-5G for ged-emacs-devel@m.gmane.org; Sun, 02 May 2010 10:34:37 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O8aFb-0003Tt-Rm for emacs-devel@gnu.org; Sun, 02 May 2010 10:34:31 -0400 Original-Received: from [140.186.70.92] (port=52494 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O8aFZ-0003Tl-8c for emacs-devel@gnu.org; Sun, 02 May 2010 10:34:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O8aFX-0000gd-6f for emacs-devel@gnu.org; Sun, 02 May 2010 10:34:28 -0400 Original-Received: from pantheon-po38.its.yale.edu ([130.132.50.97]:49654) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O8aFX-0000gO-4O for emacs-devel@gnu.org; Sun, 02 May 2010 10:34:27 -0400 Original-Received: from furry (adsl-99-75-106-162.dsl.wlfrct.sbcglobal.net [99.75.106.162]) (authenticated bits=0) by pantheon-po38.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id o42EYPIX030853 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 2 May 2010 10:34:26 -0400 Original-Received: by furry (Postfix, from userid 1000) id 0AFECC055; Sun, 2 May 2010 10:34:24 -0400 (EDT) In-Reply-To: (Stefan Monnier's message of "Sat, 01 May 2010 22:54:15 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.96 (gnu/linux) X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 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:124424 Archived-At: Stefan Monnier 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].