unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Chris Foote <chris@foote.com.au>
To: bug-gnu-emacs@gnu.org
Subject: bug#3991: 23.1; autoindent problem with new exception formatting in lisp/progmodes/python.el
Date: Fri, 31 Jul 2009 16:52:32 +0930	[thread overview]
Message-ID: <4A729BB8.9070702@foote.com.au> (raw)

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








             reply	other threads:[~2009-07-31  7:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-31  7:22 Chris Foote [this message]
2010-08-23  0:45 ` bug#3991: 23.1; autoindent problem with new exception formatting in lisp/progmodes/python.el Chong Yidong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A729BB8.9070702@foote.com.au \
    --to=chris@foote.com.au \
    --cc=3991@emacsbugs.donarmstrong.com \
    --cc=bug-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).