]> granicus.if.org Git - python/commitdiff
(python-font-lock-keywords): Fix for consecutive keyword font locking,
authorBarry Warsaw <barry@python.org>
Wed, 5 Nov 1997 18:55:50 +0000 (18:55 +0000)
committerBarry Warsaw <barry@python.org>
Wed, 5 Nov 1997 18:55:50 +0000 (18:55 +0000)
given by Sjoerd Mullender <Sjoerd.Mullender@cwi.nl>.

Misc/python-mode.el

index dc6e738af0a7e89c9933b0d17a4a7ba96d514429..ebcb1397a047523b0505969e1609975d7384f601 100644 (file)
@@ -257,12 +257,8 @@ features supporting those needed by CC Mode.")
                     ))
         (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)