aboutsummaryrefslogtreecommitdiffstats
path: root/oni-python.el
diff options
context:
space:
mode:
authorGravatar Tom Willemse2019-01-31 15:43:14 -0800
committerGravatar Tom Willemse2019-01-31 15:43:14 -0800
commit13cc5160fa5c7d17ccef078830f15759dc1fd7e0 (patch)
treeea58521b4fd32ca3069a32a4431324b2143b94cc /oni-python.el
parent98f723cb4088c3952e872cd787ba8faa5888ab75 (diff)
downloademacs-config-13cc5160fa5c7d17ccef078830f15759dc1fd7e0.tar.gz
emacs-config-13cc5160fa5c7d17ccef078830f15759dc1fd7e0.zip
Set fill-column for Python mode
Diffstat (limited to 'oni-python.el')
-rw-r--r--oni-python.el10
1 files changed, 9 insertions, 1 deletions
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 <tom@ryuslash.org>
;; 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))