[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: python-mode: keep mark when shifting [patch]

From: Dave Love
Subject: Re: python-mode: keep mark when shifting [patch]
Date: Mon, 13 Mar 2006 00:22:49 +0000
User-agent: Gnus/5.11 (Gnus v5.11)

Richard Stallman <address@hidden> writes:

> In C or Lisp I
> would use C-u TAB to shift a subexpression to the proper position.
> (There's no need to specify left or right, because the command figures
> that out.)  Could that work in Python mode?

There isn't a single correct indentation in general.  (TAB cycles
between the valid values.)

Note that Python mode obeys the Emacs conventions for indentation
commands, unlike Lisp mode.  It just binds `indent-line-function',
which doesn't take an arg.  It would probably make sense for C-u TAB
to re-indent the rest of a block rigidly when used on the head line of
the block, and/or to have TAB act on the region when it's active, but
there are better things to spend time on.

The shift-region functions are inherited from the old python-mode.el
and may or may not really be a good idea.

> I recall Python is weird in regard to indentation.  Maybe it simply
> needs different kinds of commands from those needed by other
> languages.

Python uses something like Landin's offside rule to define blocks by
indentation.  I don't think it needs different commands, though the
behaviour of TAB is unusual -- successive use cycles between the valid
indentations for a line (like in Haskell mode).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]