From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: python-mode (python.el): python-backspace Date: 27 May 2004 14:24:25 -0400 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1085685755 15858 80.91.224.253 (27 May 2004 19:22:35 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 27 May 2004 19:22:35 +0000 (UTC) Cc: Karl Chen , rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu May 27 21:22:25 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BTQSO-00014a-00 for ; Thu, 27 May 2004 21:22:24 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BTQSO-00017t-00 for ; Thu, 27 May 2004 21:22:24 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BTPbQ-0001aO-6Y for emacs-devel@quimby.gnus.org; Thu, 27 May 2004 14:27:40 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.34) id 1BTPZ6-00019U-Bl for emacs-devel@gnu.org; Thu, 27 May 2004 14:25:16 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.34) id 1BTPYX-00011L-Hj for emacs-devel@gnu.org; Thu, 27 May 2004 14:25:13 -0400 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BTPYW-00010w-VV; Thu, 27 May 2004 14:24:41 -0400 Original-Received: from asado.iro.umontreal.ca (asado.iro.umontreal.ca [132.204.24.84]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 7E5B6B30279; Thu, 27 May 2004 14:24:26 -0400 (EDT) Original-Received: by asado.iro.umontreal.ca (Postfix, from userid 20848) id 0E16E8CA23; Thu, 27 May 2004 14:24:26 -0400 (EDT) Original-To: Dave Love In-Reply-To: Original-Lines: 39 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=0, requis 5) X-MailScanner-From: monnier@iro.umontreal.ca X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:24032 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:24032 >> - delete hungrily all whitespace. >> - delete to previous level of indentation. >> Both of those are conceptually mode-independent > I don't think they are. Most modes have only a single `valid' > indentation for any line (according to their indentation rules), and > it may not be clear how to define a `level of indentation' > (e.g. Lisp). That's not the case in Python and Haskell, for instance, > where deleting a level of indentation is well-defined and either > meaningful or syntactically invalid. Hmm... in my world, only Python and Haskell have a notion of a "valid" indentation. All others all any indentation whatsoever. In most modes, it is true that the syntax is redundant enough that there is little choice given a particular indentation style, but indentation style is not always followed, and auto-indentation doesn't always work correctly. Several major modes use a M-TAB binding to "delete one level of indentation". I remember writing a generic "delete to previous level of indentation" because someone asked for it on gnu.emacs.help... yes, here it is: http://groups.google.com/groups?selm=5lbrx8e1rc.fsf%40rum.cs.yale.edu&output=gplain I think binding such a command to DEL makes perfect sense. But it would be good to allow modes like python-mode to tune its behavior to be more correct. >> There is already the "untabify" version of backspace and I think we should >> make it easier for people to change such things globally. > What's wrong with `backward-delete-char-untabify-method' for that? Nothing, other than the fact that it does not include "delete to prev level of indent". Oh and that you first have to bind backward-delete-char-untabify globally and then set the variable (and that some major modes might then "gratuitously" override the binding locally, of course). Stefan