From: Barry Warsaw Date: Wed, 5 Nov 1997 18:55:50 +0000 (+0000) Subject: (python-font-lock-keywords): Fix for consecutive keyword font locking, X-Git-Tag: v1.5b1~118 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ef3c891773c129273fa9f39d96993d37c8b56c86;p=python (python-font-lock-keywords): Fix for consecutive keyword font locking, given by Sjoerd Mullender . --- diff --git a/Misc/python-mode.el b/Misc/python-mode.el index dc6e738af0..ebcb1397a0 100644 --- a/Misc/python-mode.el +++ b/Misc/python-mode.el @@ -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)