]> code.delx.au - gnu-emacs/commitdiff
None, True, False, Ellipsis, __debug__, and NotImplemented now use font-lock-constant...
authorFabián Ezequiel Gallina <fgallina@cuca>
Thu, 17 May 2012 03:03:19 +0000 (00:03 -0300)
committerFabián Ezequiel Gallina <fgallina@gnu.org>
Thu, 17 May 2012 03:03:19 +0000 (00:03 -0300)
Also copyright, license, credits, quit, exit are removed from
font-lock since they are added by the site module and only useful for
shell interaction and not programs.

See: http://docs.python.org/release/3.1.3/library/constants.html#constants-added-by-the-site-module

lisp/progmodes/python.el

index 949c112ee757216a4698b15a334dbb5a598a750f..00a6b804e72fe3b5c80efb4a197aabc1e6fb627b 100644 (file)
     (,(rx symbol-start "class" (1+ space) (group (1+ (or word ?_))))
      (1 font-lock-type-face))
     ;; Constants
-    (,(rx symbol-start (group "None" symbol-end))
-     (1 font-lock-constant-face))
+    (,(rx symbol-start
+          ;; copyright, license, credits, quit, exit are added by the
+          ;; site module and since they are not intended to be used in
+          ;; programs they are not added here either.
+          (or "None" "True" "False" "Ellipsis" "__debug__" "NotImplemented")
+          symbol-end) . font-lock-constant-face)
     ;; Decorators.
     (,(rx line-start (* (any " \t")) (group "@" (1+ (or word ?_))
                                             (0+ "." (1+ (or word ?_)))))
               "FutureWarning" "GeneratorExit" "IOError" "ImportError"
               "ImportWarning" "IndentationError" "IndexError" "KeyError"
               "KeyboardInterrupt" "LookupError" "MemoryError" "NameError"
-              "NotImplemented" "NotImplementedError" "OSError" "OverflowError"
+              "NotImplementedError" "OSError" "OverflowError"
               "PendingDeprecationWarning" "ReferenceError" "RuntimeError"
               "RuntimeWarning" "StandardError" "StopIteration" "SyntaxError"
               "SyntaxWarning" "SystemError" "SystemExit" "TabError" "TypeError"
     ;; Builtins
     (,(rx (or line-start (not (any ". \t"))) (* (any " \t")) symbol-start
          (group
-           (or "_" "__debug__" "__doc__" "__import__" "__name__" "__package__"
-               "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" "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"
-               "True" "False" "Ellipsis")) symbol-end)
+           (or "_" "__doc__" "__import__" "__name__" "__package__" "abs" "all"
+               "any" "apply" "basestring" "bin" "bool" "buffer" "bytearray"
+               "bytes" "callable" "chr" "classmethod" "cmp" "coerce" "compile"
+               "complex" "delattr" "dict" "dir" "divmod" "enumerate" "eval"
+               "execfile" "file" "filter" "float" "format" "frozenset"
+               "getattr" "globals" "hasattr" "hash" "help" "hex" "id" "input"
+               "int" "intern" "isinstance" "issubclass" "iter" "len" "list"
+               "locals" "long" "map" "max" "min" "next" "object" "oct" "open"
+               "ord" "pow" "print" "property" "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))
     ;; asignations
     ;; support for a = b = c = 5