all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dave Love <fx@gnu.org>
Cc: David Reitter <david.reitter@gmail.com>,
	emacs-devel@gnu.org, henrik.enberg@telia.com
Subject: Re: python-mode: keep mark when shifting [patch]
Date: Mon, 13 Mar 2006 00:22:49 +0000	[thread overview]
Message-ID: <rzqy7zf6vmu.fsf@loveshack.ukfsn.org> (raw)
In-Reply-To: Richard Stallman's message of "12-Mar-2006 12:47"

Richard Stallman <rms@gnu.org> 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	other threads:[~2006-03-13  0:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-13  0:22 Dave Love [this message]
2006-03-13 11:34 ` python-mode: keep mark when shifting [patch] David Reitter
2006-03-13 22:42   ` Richard Stallman
  -- strict thread matches above, loose matches on Subject: below --
2006-03-12 13:02 Dave Love
2006-03-10 15:17 Dave Love
2006-03-09 18:31 David Reitter
2006-03-10 20:40 ` Henrik Enberg
2006-03-11 17:12   ` David Reitter
2006-03-12 12:47     ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=rzqy7zf6vmu.fsf@loveshack.ukfsn.org \
    --to=fx@gnu.org \
    --cc=david.reitter@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=henrik.enberg@telia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.