aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2010-11-21 12:12:44 -0500
committerChong Yidong2010-11-21 12:12:44 -0500
commit4e2f7d2a68a1849a1b8ef5488afbd2c0dadd1e80 (patch)
tree960dc2d31bd466a29d176d2239b93d95d6733199
parent731e263a732a84174bf324f48720e4645ab4b9b1 (diff)
downloademacs-4e2f7d2a68a1849a1b8ef5488afbd2c0dadd1e80.tar.gz
emacs-4e2f7d2a68a1849a1b8ef5488afbd2c0dadd1e80.zip
Highlight top-level augmented assignments in Python (Bug#6445).
* progmodes/python.el (python-font-lock-keywords): Highlight top-level augmented assignments (Bug#6445).
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/progmodes/python.el3
2 files changed, 7 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 1a4866612dc..39454198a64 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12010-11-21 Deniz Dogan <deniz.a.m.dogan@gmail.com>
2
3 * progmodes/python.el (python-font-lock-keywords): Highlight
4 top-level augmented assignments (Bug#6445).
5
12010-11-21 Jan Djärv <jan.h.d@swipnet.se> 62010-11-21 Jan Djärv <jan.h.d@swipnet.se>
2 7
3 * term/ns-win.el (ns-right-control-modifier) 8 * term/ns-win.el (ns-right-control-modifier)
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 7754dc6c87c..9fe57beec30 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -110,7 +110,8 @@
110 (,(rx symbol-start (group "def") (1+ space) (group (1+ (or word ?_)))) 110 (,(rx symbol-start (group "def") (1+ space) (group (1+ (or word ?_))))
111 (1 font-lock-keyword-face) (2 font-lock-function-name-face)) 111 (1 font-lock-keyword-face) (2 font-lock-function-name-face))
112 ;; Top-level assignments are worth highlighting. 112 ;; Top-level assignments are worth highlighting.
113 (,(rx line-start (group (1+ (or word ?_))) (0+ space) "=") 113 (,(rx line-start (group (1+ (or word ?_))) (0+ space)
114 (opt (or "+" "-" "*" "**" "/" "//" "&" "%" "|" "^" "<<" ">>")) "=")
114 (1 font-lock-variable-name-face)) 115 (1 font-lock-variable-name-face))
115 ;; Decorators. 116 ;; Decorators.
116 (,(rx line-start (* (any " \t")) (group "@" (1+ (or word ?_)) 117 (,(rx line-start (* (any " \t")) (group "@" (1+ (or word ?_))