GNU bug report logs - #8639
23.2; emacs python mode should colorize nonlocal keyword

Previous Next

Package: emacs;

Reported by: Steve Chapel <schapel <at> umich.edu>

Date: Sun, 8 May 2011 23:47:01 UTC

Severity: minor

Found in version 23.2

Done: Juanma Barranquero <lekktu <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


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

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Steve Chapel <schapel <at> umich.edu>
Cc: 8639 <at> debbugs.gnu.org
Subject: Re: bug#8639: 23.2; emacs python mode should colorize nonlocal keyword
Date: Thu, 12 May 2011 00:13:17 +0200
On Mon, May 9, 2011 at 00:56, Steve Chapel <schapel <at> umich.edu> 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




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

Previous Next


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