summaryrefslogtreecommitdiffstats
path: root/lisp/init-python.el
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2020-02-01 23:35:23 +0100
committerMartin Polden <mpolden@mpolden.no>2020-02-01 23:37:27 +0100
commit8644265551ee36c0ba8624e668a49542be2fa6da (patch)
treeaac3ee6cce8c55ab6d76c4b3227f94218e8c97e5 /lisp/init-python.el
parentbf6902c6da2c72df399f8136c9511bde7c2b4783 (diff)
Replace add-hook calls with :hook
Diffstat (limited to 'lisp/init-python.el')
-rw-r--r--lisp/init-python.el20
1 files changed, 10 insertions, 10 deletions
diff --git a/lisp/init-python.el b/lisp/init-python.el
index d3ed060..ec6c741 100644
--- a/lisp/init-python.el
+++ b/lisp/init-python.el
@@ -1,16 +1,16 @@
+(defun python-mode-buffer-local-variables ()
+ ;; highlight lines longer than 88 characters
+ (setq-local fill-column 88)
+ ;; use flat index in imenu
+ (setq-local imenu-create-index-function
+ 'python-imenu-create-flat-index))
+
(use-package python
:ensure nil ;; package is bundled with emacs
-
+ :commands python-mode
+ :hook (python-mode . python-mode-buffer-local-variables)
:config
;; use flake8 as flymake backend
- (setq python-flymake-command '("flake8" "-"))
- ;; set buffer local variables
- (add-hook 'python-mode-hook
- (lambda ()
- ;; highlight lines longer than 88 characters
- (setq-local fill-column 88)
- ;; use flat index in imenu
- (setq-local imenu-create-index-function
- 'python-imenu-create-flat-index))))
+ (setq python-flymake-command '("flake8" "-")))
(provide 'init-python)