[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: python-mode (python.el): python-backspace
From: |
Stefan Monnier |
Subject: |
Re: python-mode (python.el): python-backspace |
Date: |
27 May 2004 14:24:25 -0400 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 |
>> - 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
- Re: python-mode (python.el): python-backspace, (continued)
- Re: python-mode (python.el): python-backspace, Stefan Monnier, 2004/05/18
- Re: python-mode (python.el): python-backspace, Karl Chen, 2004/05/18
- Re: python-mode (python.el): python-backspace, Dave Love, 2004/05/18
- Re: python-mode (python.el): python-backspace, Stefan Monnier, 2004/05/18
- Re: python-mode (python.el): python-backspace, Dave Love, 2004/05/27
- Re: python-mode (python.el): python-backspace,
Stefan Monnier <=
- Re: python-mode (python.el): python-backspace, Richard Stallman, 2004/05/28
- Re: python-mode (python.el): python-backspace, Kai Grossjohann, 2004/05/29
- Re: python-mode (python.el): python-backspace, Richard Stallman, 2004/05/30
- Re: python-mode (python.el): python-backspace, Stefan Monnier, 2004/05/30
- Re: python-mode (python.el): python-backspace, Richard Stallman, 2004/05/18
- Re: python-mode (python.el): python-backspace, Richard Stallman, 2004/05/18
Re: python-mode (python.el): python-backspace, Dave Love, 2004/05/18