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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 3991 in the body.
You can then email your comments to 3991 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3991; Package emacs. (Fri, 31 Jul 2009 07:25:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Chris Foote <chris <at> foote.com.au>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Fri, 31 Jul 2009 07:25:06 GMT) Full text and rfc822 format available.

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






Added tag(s) patch. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 26 Jan 2010 23:31:01 GMT) Full text and rfc822 format available.

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#3991; Package emacs. (Mon, 23 Aug 2010 00:45:02 GMT) Full text and rfc822 format available.

Message #10 received at 3991 <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Chris Foote <chris <at> foote.com.au>
Cc: 3991 <at> debbugs.gnu.org
Subject: Re: 23.1; autoindent problem with new exception formatting in
	lisp/progmodes/python.el
Date: Sun, 22 Aug 2010 20:45:35 -0400
> 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
>
> this patch fixes the problem for me:

Thanks.  I've checked it into the repository.




bug closed, send any further explanations to Chris Foote <chris <at> foote.com.au> Request was from Chong Yidong <cyd <at> stupidchicken.com> to control <at> debbugs.gnu.org. (Mon, 23 Aug 2010 00:45:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 20 Sep 2010 11:24:04 GMT) Full text and rfc822 format available.

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

Previous Next


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