GNU bug report logs - #18843
Invalid block indentation in Python mode

Previous Next

Package: emacs;

Reported by: Paul Pogonyshev <pogonyshev <at> gmail.com>

Date: Sun, 26 Oct 2014 14:19:01 UTC

Severity: normal

Tags: patch

Merged with 18796

Found in versions 24.4, 24.4.50

Done: fgallina <at> gnu.org (Fabián Ezequiel Gallina)

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Paul Pogonyshev <pogonyshev <at> gmail.com>
Subject: bug#18843: closed (Invalid block indentation in Python mode)
Date: Sat, 15 Nov 2014 21:22:02 +0000
[Message part 1 (text/plain, inline)]
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 18843 <at> debbugs.gnu.org.

-- 
18843: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18843
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: fgallina <at> gnu.org (Fabián Ezequiel Gallina)
To: 18843-done <at> debbugs.gnu.org
Subject: Invalid block indentation in Python mode
Date: Sat, 15 Nov 2014 18:21:22 -0300
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

[Message part 3 (message/rfc822, inline)]
From: Paul Pogonyshev <pogonyshev <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Invalid block indentation in Python mode
Date: Sun, 26 Oct 2014 15:18:08 +0100
[Message part 4 (text/plain, inline)]
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
[Message part 5 (text/html, inline)]

This bug report was last modified 10 years and 193 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.