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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 18843 in the body.
You can then email your comments to 18843 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#18843; Package emacs. (Sun, 26 Oct 2014 14:19:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Paul Pogonyshev <pogonyshev <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 26 Oct 2014 14:19:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

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 1 (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 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18843; Package emacs. (Thu, 30 Oct 2014 19:15:02 GMT) Full text and rfc822 format available.

Message #8 received at 18843 <at> debbugs.gnu.org (full text, mbox):

From: Carlos Pita <carlosjosepita <at> gmail.com>
To: 18843 <at> debbugs.gnu.org
Cc: fgallina <at> gnu.org
Date: Thu, 30 Oct 2014 16:13:29 -0300
This is a duplicate of my own report #18796.

Take a look at that report for a very simple fix.

Hope it gets commited soon.




Merged 18432 18796 18843. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 31 Oct 2014 16:39:03 GMT) Full text and rfc822 format available.

Added tag(s) patch. Request was from Carlos Pita <carlosjosepita <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 05 Nov 2014 20:36:02 GMT) Full text and rfc822 format available.

Disconnected #18843 from all other report(s). Request was from fgallina <at> gnu.org (Fabián Ezequiel Gallina) to control <at> debbugs.gnu.org. (Sat, 15 Nov 2014 21:17:02 GMT) Full text and rfc822 format available.

Reply sent to fgallina <at> gnu.org (Fabián Ezequiel Gallina):
You have taken responsibility. (Sat, 15 Nov 2014 21:22:02 GMT) Full text and rfc822 format available.

Notification sent to Paul Pogonyshev <pogonyshev <at> gmail.com>:
bug acknowledged by developer. (Sat, 15 Nov 2014 21:22:02 GMT) Full text and rfc822 format available.

Message #19 received at 18843-done <at> debbugs.gnu.org (full text, mbox):

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




Merged 18796 18843. Request was from fgallina <at> gnu.org (Fabián Ezequiel Gallina) to control <at> debbugs.gnu.org. (Sat, 15 Nov 2014 21:34:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 14 Dec 2014 12:24:04 GMT) Full text and rfc822 format available.

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.