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

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

[debbugs-tracker] bug#18843: closed (Invalid block indentation in Python


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#18843: closed (Invalid block indentation in Python mode)
Date: Sat, 15 Nov 2014 21:22:02 +0000

Your message dated Sat, 15 Nov 2014 18:21:22 -0300
with message-id <address@hidden>
and subject line Invalid block indentation in Python mode
has caused the debbugs.gnu.org bug report #18843,
regarding Invalid block indentation in Python mode
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
18843: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18843
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: Invalid block indentation in Python mode Date: Sun, 26 Oct 2014 15:18:08 +0100
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

--- End Message ---
--- Begin Message --- Subject: Invalid block indentation in Python mode Date: Sat, 15 Nov 2014 18:21:22 -0300 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
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


--- End Message ---

reply via email to

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