]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
(py-tab-face, python-font-lock-keywords): Color all tabs at the start
authorBarry Warsaw <barry@python.org>
Thu, 19 Mar 1998 21:52:06 +0000 (21:52 +0000)
committerBarry Warsaw <barry@python.org>
Thu, 19 Mar 1998 21:52:06 +0000 (21:52 +0000)
of a line in py-tab-face to aid in seeing mixed tab/space indentation.
This face defaults to the `default' face so it is unobtrusive until
you `M-x customize-face' py-tab-face to something obnoxious like
"Yellow".

Misc/python-mode.el

index 4f53f1fe1e79e67a03f35f95a0171b339fcf74ca..2e560999ee759b838b3954a1dde8ad23875c2d30 100644 (file)
@@ -306,6 +306,12 @@ source code of the innermost frame.")
   :type 'function
   :group 'python)
 
+(defface py-tab-face nil
+  "Face that tabs are displayed in.
+To quickly see mixed tabs/spaces, use \\[customize-face] and set the
+background of `py-tab-face' to something obnoxious (like \"Yellow\")."
+  :group 'python)
+
 ;; Not customizable
 (defvar py-master-file nil
   "If non-nil, execute the named file instead of the buffer's file.
@@ -368,6 +374,8 @@ support for features needed by `python-mode'.")
      ;; functions
      '("\\bdef[ \t]+\\([a-zA-Z_]+[a-zA-Z0-9_]*\\)"
        1 font-lock-function-name-face)
+     ;; tabs
+     '("^[\t]+" 0 py-tab-face)
      ))
   "Additional expressions to highlight in Python mode.")
 (put 'python-mode 'font-lock-defaults '(python-font-lock-keywords))