GNU bug report logs - #3991
23.1; autoindent problem with new exception formatting in lisp/progmodes/python.el

Previous Next

Package: emacs;

Reported by: Chris Foote <chris <at> foote.com.au>

Date: Fri, 31 Jul 2009 07:25:05 UTC

Severity: normal

Tags: patch

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Chris Foote <chris <at> foote.com.au>
To: bug-gnu-emacs <at> gnu.org
Subject: 23.1; autoindent problem with new exception formatting in lisp/progmodes/python.el
Date: Fri, 31 Jul 2009 16:52:32 +0930
Python2.5 introduced the available use of "finally" with
"except" in the same "try" exception handling block.  The
standard GNU Emacs Python mode (python.el) won't perform an
autoindent correctly when the code reaches the "finally"
clause - e.g.:

def myfunc():
    try:
        foo()
    except Bar, e:
        pass
    else:
        foo()
finally:


this patch fixes the problem for me:

--- python.el.orig	2009-06-21 14:08:04.000000000 +0930
+++ python.el.new	2009-07-31 16:27:27.000000000 +0930
@@ -748,7 +748,7 @@
   '(("else" "if" "elif" "while" "for" "try" "except")
     ("elif" "if" "elif")
     ("except" "try" "except")
-    ("finally" "try" "except"))
+    ("finally" "else" "try" "except"))
   "Alist of keyword matches.
 The car of an element is a keyword introducing a statement which
 can close a block opened by a keyword in the cdr.")






This bug report was last modified 14 years and 329 days ago.

Previous Next


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