From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?B?QW5kcmVhcyBSw7ZobGVy?= Newsgroups: gmane.emacs.devel Subject: Re: hungry-delete Date: Mon, 04 Apr 2011 20:54:45 +0200 Message-ID: <4D9A13F5.7040702@online.de> References: <4D99FDB8.6040708@online.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1301942853 22804 80.91.229.12 (4 Apr 2011 18:47:33 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 4 Apr 2011 18:47:33 +0000 (UTC) Cc: Sam Steingold To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 04 20:47:29 2011 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 1Q6ooD-0006UP-1z for ged-emacs-devel@m.gmane.org; Mon, 04 Apr 2011 20:47:29 +0200 Original-Received: from localhost ([127.0.0.1]:52568 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q6ooC-0000rp-Lq for ged-emacs-devel@m.gmane.org; Mon, 04 Apr 2011 14:47:28 -0400 Original-Received: from [140.186.70.92] (port=40001 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q6oo7-0000rZ-9B for emacs-devel@gnu.org; Mon, 04 Apr 2011 14:47:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q6oo5-0000T1-PV for emacs-devel@gnu.org; Mon, 04 Apr 2011 14:47:23 -0400 Original-Received: from moutng.kundenserver.de ([212.227.126.186]:50487) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q6oo5-0000SV-9e; Mon, 04 Apr 2011 14:47:21 -0400 Original-Received: from [192.168.178.29] (brln-4dbc7f42.pool.mediaWays.net [77.188.127.66]) by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis) id 0McitZ-1QOlKY0AbZ-00I7Qo; Mon, 04 Apr 2011 20:47:19 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 In-Reply-To: X-Provags-ID: V02:K0:qEFMpqyu6SRdjWMVZ3UBoeDgHjpd1BOPAYi86rAH7ZP 07CMzTg6H8wYVdEf0Y3oLPawSB4+c1kARZQ1oIMBVCwzmfICro Cr+H3JN3I7ofW6ScoxlS4C/WL6X56Az/Biua5Rz4RbZN+G/PXC Rx/zfwtRsRTqET4t/3YNDTlgNzWwSIAAYwsf8z4Zc1P8NiRfZI 0cIs5lUh703YATAFeuDzZuH6nxG8i32S+xLyzjRxWU= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 212.227.126.186 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:138142 Archived-At: Am 04.04.2011 20:20, schrieb Sam Steingold: >> * Andreas Röhler [2011-04-04 19:19:52 +0200]: >> >> https://bugs.launchpad.net/python-mode/+bug/328853 >> >> "I really love the hungry-delete feature of Emacs' >> c-mode. It would be great to have hungry-delete for >> python-mode as well." > > DEL (translated from) runs the command > backward-delete-char-untabify, which is an interactive compiled Lisp > function in `simple.el'. > > It is bound to DEL. > > (backward-delete-char-untabify ARG&optional KILLP) > > Delete characters backward, changing tabs into spaces. > The exact behavior depends on `backward-delete-char-untabify-method'. > Delete ARG chars, and kill (save in kill ring) if KILLP is non-nil. > Interactively, ARG is the prefix arg (default 1) > and KILLP is t if a prefix arg was specified. > > backward-delete-char-untabify-method is a variable defined in `simple.el'. > Its value is all > Original value was untabify > > Documentation: > The method for untabifying when deleting backward. > Can be `untabify' -- turn a tab to many spaces, then delete one space; > `hungry' -- delete all whitespace, both tabs and spaces; > `all' -- delete all whitespace, including tabs, spaces and newlines; > nil -- just delete one character. > > You can customize this variable. > > This variable was introduced, or its default value was changed, in > version 20.3 of Emacs. > > > > Hi, thanks for the hint. However don't think customizing DEL does it. In most cases you will use DEL as `untabify'. "Hungry" eates a lot - that's is fine, but not as taking the common DEL. Therefore think a seperate key for hungry-delete is needed. However, seems it must not be copied from the scratch. What about such a thing: (defun hunry-delete (&optional killp) "Delete characters backward, changing tabs into spaces. Kill (save in kill ring) if KILLP is non-nil. " (interactive "P") (let ((backward-delete-char-untabify-method 'all)) (backward-delete-char-untabify 1 killp))) ;;;;;;;;