GNU bug report logs - #8797
Incorrect Python Indentation

Previous Next

Package: emacs;

Reported by: Adrian Parker <adrian.l.parker <at> gmail.com>

Date: Fri, 3 Jun 2011 23:03:02 UTC

Severity: normal

Fixed in version 24.2

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Adrian Parker <adrian.l.parker <at> gmail.com>
To: 8797 <at> debbugs.gnu.org
Subject: bug#8797: Incorrect Python Indentation
Date: Fri, 3 Jun 2011 18:41:28 -0400
[Message part 1 (text/plain, inline)]
Version: Emacs 23.3.1

Steps to reproduce:

   1. Open a Python file
   2. Starting in the first column type: def some_func(
   3. Press ENTER key
   4. Press TAB key

Expected result:
The cursor should be in column 9. Under the "Code lay-out" heading at
http://www.python.org/dev/peps/pep-0008/ please see the suggestions
regarding continuation lines (note: its a very new change).

Actual result:
The cursor is in column 5.


turbofail in #emacs on Freenode suggested I edit my python.el and:

Replace this line:
(+ (current-indentation) (* (car syntax) python-indent))))

with this line:
(+ (current-indentation) (* 2 (car syntax) python-indent))))

That fixed the issue using an older version of Emacs at work.

Note: Sorry, I'd provide a patch but I'm on windows, and haven't diff or
patch installed.


Adrian Parker
[Message part 2 (text/html, inline)]

This bug report was last modified 12 years and 346 days ago.

Previous Next


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