summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>1998-03-19 21:52:06 +0000
committerBarry Warsaw <barry@python.org>1998-03-19 21:52:06 +0000
commit0d2805b771edf6c62efc268dc9c6499b99abe1d0 (patch)
tree4d390b214bda15a815d6fee0ad97c1fbbc7e0b80
parent677bedab0c82fdec2d2d5b9507a3b05dfb9486f4 (diff)
downloadcpython-git-0d2805b771edf6c62efc268dc9c6499b99abe1d0.tar.gz
(py-tab-face, python-font-lock-keywords): Color all tabs at the start
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".
-rw-r--r--Misc/python-mode.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/Misc/python-mode.el b/Misc/python-mode.el
index 4f53f1fe1e..2e560999ee 100644
--- a/Misc/python-mode.el
+++ b/Misc/python-mode.el
@@ -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))