unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Milan Zamazal <pdm@zamazal.org>
Cc: 2421@emacsbugs.donarmstrong.com
Subject: bug#2421: 23.0.90; python-mode: Indent commands behavior
Date: Thu, 05 Mar 2009 19:58:09 +0100	[thread overview]
Message-ID: <49B020C1.5020501@gmx.at> (raw)
In-Reply-To: <87tz69w87r.fsf@blackbird.nest.zamazal.org>

 > Well, actually TAB runs indent-region.  But I need simple shift instead.
 > Consider the following example:
 >
 >   def foo():
 >       for i in range(3):
 >   print i
 >   print i + 1
 >   print i + 2
 >
 > I just pasted the print lines from a differently indented code and want
 > to fix the indentation by shifting the region of the print lines:
 >
 >   def foo():
 >       for i in range(3):
 >           print i
 >           print i + 1
 >           print i + 2
 >
 > TAB can't do it:
 >
 >   def foo():
 >       for i in range(3):
 >           print i
 >   print i + 1
 >   print i + 2

We could pass the prefix argument to `indent-region' with the semantics
that the latter ignores the mode-specific `indent-region-function' and
calls `indent-line' for each line in the region instead.

Alternatively, `python-indent-region' could, like `python-indent-line',
remember whether the last command was an `indent-for-tab-command' and
call `python-indent-line-1' with no argument for each line in the
region.  Obviously, the region would have to stay to make this
practical.  And in some pathological cases it might be hard to find the
appropriate indentation points.

Anyhow, I'm afraid that people won't approve such changes.

 > To get what I want I have to press `C-8 C->'.  I don't like it, I'd like
 > to call `M-x SOMETHING-shift-right' twice or
 > `M-2 M-x SOMETHING-shift-right'.

That's why I earlier said that some rectangle code should handle this.

martin






  reply	other threads:[~2009-03-05 18:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-21 10:25 bug#2421: 23.0.90; python-mode: Indent commands behavior Milan Zamazal
2009-02-21 14:10 ` martin rudalics
2009-02-21 14:59   ` Milan Zamazal
2009-02-22 18:29     ` martin rudalics
2009-02-23 18:25       ` Milan Zamazal
2009-02-24 13:40         ` martin rudalics
2009-02-24 14:58           ` Milan Zamazal
2009-03-04 16:42           ` Milan Zamazal
2009-03-05 18:58             ` martin rudalics [this message]
2009-03-06  8:24               ` Milan Zamazal
2012-10-08 21:43 ` Fabián Ezequiel Gallina

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=49B020C1.5020501@gmx.at \
    --to=rudalics@gmx.at \
    --cc=2421@emacsbugs.donarmstrong.com \
    --cc=pdm@zamazal.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).