logo       

bug#3991: 23.1; autoindent problem with new exception formatting in lisp/pr: msg#00640

bug-gnu-emacs-gnu

Subject: bug#3991: 23.1; autoindent problem with new exception formatting in lisp/progmodes/python.el

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.")






<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | Mail Home | sitemap | FAQ | advertise