From 9feb0bfa452e9e84c4cb3a698631aeb42f38797d Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Fri, 1 Feb 2019 14:04:30 -0800 Subject: [PATCH] Enable whitespace-mode for Python --- oni-python.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 ;; 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))