From 13cc5160fa5c7d17ccef078830f15759dc1fd7e0 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 31 Jan 2019 15:43:14 -0800 Subject: Set fill-column for Python mode --- oni-python.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'oni-python.el') diff --git a/oni-python.el b/oni-python.el index 4748b42..7f3ca7f 100644 --- a/oni-python.el +++ b/oni-python.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 20190130014834 +;; Version: 20190131153854 ;; Package-Requires: (company-jedi fill-column-indicator flycheck rainbow-delimiters reformatter) ;; This program is free software; you can redistribute it and/or modify @@ -39,6 +39,13 @@ (autoload 'hl-indent-mode "hl-indent-mode") +(defun oni-python-set-fill-column () + "Set the `fill-column' and `comment-fill-column' for the current buffer. + +The values are taken from the PEP8 coding standard for Python." + (setq-local fill-column 80) + (setq-local comment-fill-column 72)) + (add-to-list 'company-backends 'company-jedi) (reformatter-define python-black @@ -54,6 +61,7 @@ (add-hook 'python-mode-hook 'company-mode) (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) ;;;###autoload(with-eval-after-load 'python (require 'oni-python)) -- cgit v1.2.3-54-g00ecf