bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#2421: 23.0.90; python-mode: Indent commands behavior


From: Milan Zamazal
Subject: bug#2421: 23.0.90; python-mode: Indent commands behavior
Date: Wed, 04 Mar 2009 17:42:16 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.90 (gnu/linux)

>>>>> "mr" == martin rudalics <address@hidden> writes:

    mr> I don't know whether `python-shift-left' and
    mr> `python-shift-right' are of any use without a prefix argument.

    >> 
    >> They are, I often use them after adding or removing a statement
    >> in a code.

    mr> I'm confused.  Why don't you use TAB in that case?

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

Neither repeated pressing of C->:

  def foo():
      for i in range(3):
      print i
      print i + 1
      print i + 2

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'.

    >> It would be more logical if they indented by (* python-indent
    >> count).

    mr> It might be even more logical to restrict ourselves to valid
    mr> indentation points only.

Perhaps, but it's not that important.

    mr> In any case we would need some feedback from `python-mode' users
    mr> for such a change.  The same goes for not deactivating the mark.

If people like the current behavior, configuration options may be
introduced.

    mr> I have no idea what TRT is now when `transient-mark-mode' is
    mr> off.  

Neither do I.

Regards,

Milan Zamazal






reply via email to

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