1
0
Fork 0

Set fill-column for Python mode

This commit is contained in:
Tom Willemse 2019-01-31 15:43:14 -08:00
parent 98f723cb40
commit 13cc5160fa

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org> ;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local ;; Keywords: local
;; Version: 20190130014834 ;; Version: 20190131153854
;; Package-Requires: (company-jedi fill-column-indicator flycheck rainbow-delimiters reformatter) ;; Package-Requires: (company-jedi fill-column-indicator flycheck rainbow-delimiters reformatter)
;; This program is free software; you can redistribute it and/or modify ;; This program is free software; you can redistribute it and/or modify
@ -39,6 +39,13 @@
(autoload 'hl-indent-mode "hl-indent-mode") (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) (add-to-list 'company-backends 'company-jedi)
(reformatter-define python-black (reformatter-define python-black
@ -54,6 +61,7 @@
(add-hook 'python-mode-hook 'company-mode) (add-hook 'python-mode-hook 'company-mode)
(add-hook 'python-mode-hook 'rainbow-delimiters-mode) (add-hook 'python-mode-hook 'rainbow-delimiters-mode)
(add-hook 'python-mode-hook 'python-black-on-save-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)) ;;;###autoload(with-eval-after-load 'python (require 'oni-python))