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: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Glenn Morris <rgm <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#8797: closed (Incorrect Python Indentation)
Date: Mon, 18 Jun 2012 21:40:01 +0000
[Message part 1 (text/plain, inline)]
Your message dated Mon, 18 Jun 2012 17:36:11 -0400
with message-id <bi62aowbec.fsf <at> fencepost.gnu.org>
and subject line Re: bug#8797: Incorrect Python Indentation
has caused the debbugs.gnu.org bug report #8797,
regarding Incorrect Python Indentation
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
8797: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8797
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Adrian Parker <adrian.l.parker <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Incorrect Python Indentation
Date: Fri, 3 Jun 2011 18:41:28 -0400
[Message part 3 (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 4 (text/html, inline)]
[Message part 5 (message/rfc822, inline)]
From: Glenn Morris <rgm <at> gnu.org>
To: 8797-done <at> debbugs.gnu.org
Subject: Re: bug#8797: Incorrect Python Indentation
Date: Mon, 18 Jun 2012 17:36:11 -0400
Version: 24.2

Thanks for the report. The Emacs trunk has a new python.el, and it seems
your problem is fixed there. This should appear in Emacs 24.2.


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.