diff Misc/python-mode.el @ 6563:2aa13c0c8f2f legacy-trunk

(python-font-lock-keywords): Fix for consecutive keyword font locking, given by Sjoerd Mullender <Sjoerd.Mullender@cwi.nl>.
author Barry Warsaw <barry@python.org>
date Wed, 05 Nov 1997 18:55:50 +0000
parents 53835043528c
children 812aad8c05c2
line wrap: on
line diff
--- a/Misc/python-mode.el	Wed Nov 05 18:41:11 1997 +0000
+++ b/Misc/python-mode.el	Wed Nov 05 18:55:50 1997 +0000
@@ -257,12 +257,8 @@
 		     ))
 	 (kwregex (mapconcat 'identity keywords "\\|")))
     (list
-     ;; keywords not at beginning of line
-     (cons (concat "\\s-\\(" kwregex "\\)[ \n\t(]") 1)
-     ;; keywords at beginning of line.  i don't think regexps are
-     ;; powerful enough to handle these two cases in one regexp.
-     ;; prove me wrong!
-     (cons (concat "^\\(" kwregex "\\)[ \n\t(]") 1)
+     ;; keywords
+     (cons (concat "\\b\\(" kwregex "\\)\\b[ \n\t(]") 1)
      ;; classes
      '("\\bclass[ \t]+\\([a-zA-Z_]+[a-zA-Z0-9_]*\\)"
        1 font-lock-type-face)