Subject: bug#18843: closed (Invalid block indentation in Python mode)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 15 Nov 2014 21:22:02 +0000

Your bug report

#18843: Invalid block indentation in Python mode

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
18843: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18843
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Invalid block indentation in Python mode
From: [email-masked] (Fabián Ezequiel Gallina)
To: [email-masked]
Date: Sat, 15 Nov 2014 18:21:22 -0300
List-Id: <debbugs-submit.debbugs.gnu.org>

Fixed at 89ebffc in the emacs-24 branch.

`python-indent-region` region now follows saner approach, it uses
`python-indent-line` and skips special cases: namely block starts,
enders and dedenters.

The idea is that those mark the base indentation and stuff within them
could be re-indented.

I tested this approach in few large codebases and the results are quite
promising, in fact I found several bad indented stuff thanks to this.

PS: I unmerged this from #18796, it's not really the same thing.

Thanks for the report,
Fabián

Subject: Invalid block indentation in Python mode
From: Paul Pogonyshev <[email-masked]>
To: [email-masked]
Date: Sun, 26 Oct 2014 15:18:08 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Block indentation in Python mode often gives silly results. For example,
with 'emacs -q' create a Python buffer and type this:

def foo ():
    try:
        pass
    except:
        pass

Now 'C-x h TAB' gives something that is not valid at all:

def foo ():
    try:
        pass
except:
    pass

Note that if you go to the 'except:' line and press 'TAB', 'except:' is
indented back to its proper position. Further 'TAB's don't change this,
i.e. mode understands that it cannot place 'except:' at any other
indentation level.

Emacs version (just compiled):
GNU Emacs 25.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.9) of
2014-10-26

Paul