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))