aboutsummaryrefslogtreecommitdiffstats
path: root/oni-python.el
diff options
context:
space:
mode:
authorGravatar Tom Willemse2019-02-01 14:04:30 -0800
committerGravatar Tom Willemse2019-02-01 14:06:47 -0800
commit9feb0bfa452e9e84c4cb3a698631aeb42f38797d (patch)
tree92561504e76014929dc3b8a12517e21a237cd238 /oni-python.el
parentd0b5e742d24f2c20400d62c91481768b9958d3a1 (diff)
downloademacs-config-9feb0bfa452e9e84c4cb3a698631aeb42f38797d.tar.gz
emacs-config-9feb0bfa452e9e84c4cb3a698631aeb42f38797d.zip
Enable whitespace-mode for Python
Diffstat (limited to 'oni-python.el')
-rw-r--r--oni-python.el11
1 files changed, 10 insertions, 1 deletions
diff --git a/oni-python.el b/oni-python.el
index f1f310c..1981573 100644
--- a/oni-python.el
+++ b/oni-python.el
@@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local
-;; Version: 20190201004304
+;; Version: 20190201140623
;; Package-Requires: (company-jedi fill-column-indicator flycheck rainbow-delimiters reformatter)
;; This program is free software; you can redistribute it and/or modify
@@ -36,6 +36,7 @@
(require 'company)
(require 'reformatter)
+(require 'whitespace)
(autoload 'hl-indent-mode "hl-indent-mode")
@@ -46,6 +47,13 @@ The values are taken from the PEP8 coding standard for Python."
(setq-local fill-column 80)
(setq-local comment-fill-column 72))
+(defun oni-python-whitespace-mode ()
+ "Set the `whitespace-style' to show the relevat whitespace.
+In Python buffers it should show any tabs being used and and used
+for indentation."
+ (setq-local whitespace-style '(face tabs))
+ (whitespace-mode))
+
(add-to-list 'company-backends 'company-jedi)
(reformatter-define python-black
@@ -62,6 +70,7 @@ The values are taken from the PEP8 coding standard for Python."
(add-hook 'python-mode-hook 'rainbow-delimiters-mode)
(add-hook 'python-mode-hook 'python-black-on-save-mode)
(add-hook 'python-mode-hook 'oni-python-set-fill-column)
+(add-hook 'python-mode-hook 'oni-python-whitespace-mode)
;;;###autoload(with-eval-after-load 'python (require 'oni-python))