=== modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2010-02-27 00:19:50 +0000 +++ lisp/progmodes/python.el 2010-07-05 20:13:59 +0000 @@ -93,7 +93,7 @@ (defvar python-font-lock-keywords `(,(rx symbol-start - ;; From v 2.5 reference, § keywords. + ;; From v 2.7 reference, § keywords. ;; def and class dealt with separately below (or "and" "as" "assert" "break" "continue" "del" "elif" "else" "except" "exec" "finally" "for" "from" "global" "if" @@ -102,7 +102,7 @@ ;; Not real keywords, but close enough to be fontified as such "self" "True" "False") symbol-end) - (,(rx symbol-start "None" symbol-end) ; see § Keywords in 2.5 manual + (,(rx symbol-start "None" symbol-end) ; see § Keywords in 2.7 manual . font-lock-constant-face) ;; Definitions (,(rx symbol-start (group "class") (1+ space) (group (1+ (or word ?_)))) @@ -117,47 +117,47 @@ (0+ "." (1+ (or word ?_))))) (1 font-lock-type-face)) ;; Built-ins. (The next three blocks are from - ;; `__builtin__.__dict__.keys()' in Python 2.5.1.) These patterns + ;; `__builtin__.__dict__.keys()' in Python 2.7) These patterns ;; are debateable, but they at least help to spot possible ;; shadowing of builtins. (,(rx symbol-start (or ;; exceptions - "ArithmeticError" "AssertionError" "AttributeError" - "BaseException" "DeprecationWarning" "EOFError" - "EnvironmentError" "Exception" "FloatingPointError" - "FutureWarning" "GeneratorExit" "IOError" "ImportError" - "ImportWarning" "IndentationError" "IndexError" "KeyError" - "KeyboardInterrupt" "LookupError" "MemoryError" "NameError" - "NotImplemented" "NotImplementedError" "OSError" - "OverflowError" "PendingDeprecationWarning" "ReferenceError" - "RuntimeError" "RuntimeWarning" "StandardError" - "StopIteration" "SyntaxError" "SyntaxWarning" "SystemError" - "SystemExit" "TabError" "TypeError" "UnboundLocalError" - "UnicodeDecodeError" "UnicodeEncodeError" "UnicodeError" - "UnicodeTranslateError" "UnicodeWarning" "UserWarning" - "ValueError" "Warning" "ZeroDivisionError") symbol-end) + "ArithmeticError" "AssertionError" "AttributeError" + "BaseException" "BufferError" "BytesWarning" + "DeprecationWarning" "EOFError" "EnvironmentError" + "Exception" "FloatingPointError" "FutureWarning" + "GeneratorExit" "IOError" "ImportError" + "ImportWarning" "IndentationError" "IndexError" + "KeyError" "KeyboardInterrupt" "LookupError" + "MemoryError" "NameError" "NotImplemented" + "NotImplementedError" "OSError" "OverflowError" + "PendingDeprecationWarning" "ReferenceError" + "RuntimeError" "RuntimeWarning" "StandardError" + "StopIteration" "SyntaxError" "SyntaxWarning" + "SystemError" "SystemExit" "TabError" + "TypeError" "UnboundLocalError" "UnicodeDecodeError" + "UnicodeEncodeError" "UnicodeError" "UnicodeTranslateError" + "UnicodeWarning" "UserWarning" "ValueError" + "Warning" "WindowsError" "ZeroDivisionError") symbol-end) . font-lock-type-face) (,(rx (or line-start (not (any ". \t"))) (* (any " \t")) symbol-start (group (or ;; callable built-ins, fontified when not appearing as ;; object attributes - "abs" "all" "any" "apply" "basestring" "bool" "buffer" "callable" - "chr" "classmethod" "cmp" "coerce" "compile" "complex" - "copyright" "credits" "delattr" "dict" "dir" "divmod" - "enumerate" "eval" "execfile" "exit" "file" "filter" "float" - "frozenset" "getattr" "globals" "hasattr" "hash" "help" - "hex" "id" "input" "int" "intern" "isinstance" "issubclass" - "iter" "len" "license" "list" "locals" "long" "map" "max" - "min" "object" "oct" "open" "ord" "pow" "property" "quit" - "range" "raw_input" "reduce" "reload" "repr" "reversed" - "round" "set" "setattr" "slice" "sorted" "staticmethod" - "str" "sum" "super" "tuple" "type" "unichr" "unicode" "vars" - "xrange" "zip")) symbol-end) + "abs" "all" "any" "apply" "basestring" "bin" "bool" "buffer" + "bytearray" "bytes" "callable" "chr" "classmethod" "cmp" + "coerce" "compile" "complex" "copyright" "credits" "delattr" + "dict" "dir" "divmod" "enumerate" "eval" "execfile" "exit" + "file" "filter" "float" "format" "frozenset" "getattr" "globals" + "hasattr" "hash" "help" "hex" "id" "input" "int" "intern" + "isinstance" "issubclass" "iter" "len" "license" "list" "locals" + "long" "map" "max" "memoryview" "min" "next" "object" "oct" + "open" "ord" "pow" "print" "property" "quit" "range" "raw_input" + "reduce" "reload" "repr" "reversed" "round" "set" "setattr" + "slice" "sorted" "staticmethod" "str" "sum" "super" "tuple" + "type" "unichr" "unicode" "vars" "xrange" "zip")) symbol-end) (1 font-lock-builtin-face)) (,(rx symbol-start (or ;; other built-ins "True" "False" "None" "Ellipsis" - "_" "__debug__" "__doc__" "__import__" "__name__") symbol-end) + "_" "__debug__" "__doc__" "__import__" "__name__" "__package__") + symbol-end) . font-lock-builtin-face))) (defconst python-font-lock-syntactic-keywords