Subject: bug#8639: 23.2; emacs python mode should colorize nonlocal keyword

From: Juanma Barranquero <[email-masked]>
Date: Thu, 12 May 2011 00:13:17 +0200

On Mon, May 9, 2011 at 00:56, Steve Chapel <[email-masked]> wrote:

> When editing a Python source file, the nonlocal keyword is not colorized
> as are other keywords.

It's easy to fix (see below), but "nonlocal" is a Python 3.X keyword,
and python-mode does not really support Python 3 at this point, so I
suppose that's not the only inconvenience you find when editing Python
3 code.

    Juanma

=== modified file 'lisp/progmodes/python.el'
--- lisp/progmodes/python.el	2011-04-22 18:44:26 +0000
+++ lisp/progmodes/python.el	2011-05-11 22:08:51 +0000
@@ -100,5 +100,7 @@
 	     "raise" "return" "try" "while" "with" "yield"
              ;; Not real keywords, but close enough to be fontified as such
-             "self" "True" "False")
+             "self" "True" "False"
+             ;; Python 3
+             "nonlocal")
 	 symbol-end)
     (,(rx symbol-start "None" symbol-end)	; see § Keywords in 2.7 manual