diff options
author | Martin Polden <mpolden@mpolden.no> | 2020-02-01 23:35:23 +0100 |
---|---|---|
committer | Martin Polden <mpolden@mpolden.no> | 2020-02-01 23:37:27 +0100 |
commit | 8644265551ee36c0ba8624e668a49542be2fa6da (patch) | |
tree | aac3ee6cce8c55ab6d76c4b3227f94218e8c97e5 /lisp/init-python.el | |
parent | bf6902c6da2c72df399f8136c9511bde7c2b4783 (diff) |
Replace add-hook calls with :hook
Diffstat (limited to 'lisp/init-python.el')
-rw-r--r-- | lisp/init-python.el | 20 |
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) |