diff options
author | Franck Cuny <franck@fcuny.net> | 2022-10-14 17:43:47 -0700 |
---|---|---|
committer | Franck Cuny <franck@fcuny.net> | 2022-10-14 17:43:47 -0700 |
commit | 22a17046e5aed40366881e7d2a66355597937f21 (patch) | |
tree | 697c65d6124179b11121dc6416a931ee1a61b135 /emacs | |
parent | ref(org-mode): drop references to notmuch (diff) | |
download | emacs.d-22a17046e5aed40366881e7d2a66355597937f21.tar.gz |
ref(python): use black when available
Use python3 for the interpreter. Change-Id: Ib3193cb73b1303de543d8dc1873f1efe2320cd20
Diffstat (limited to 'emacs')
-rw-r--r-- | emacs/custom/my-lang-python.el | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/emacs/custom/my-lang-python.el b/emacs/custom/my-lang-python.el index 74da80b..c5f612a 100644 --- a/emacs/custom/my-lang-python.el +++ b/emacs/custom/my-lang-python.el @@ -5,11 +5,15 @@ ;;; Code: +(require 'python) (require 'python-mode) -(require 'blacken) -;; enable black when we are in python-mode -(add-hook 'python-mode-hook 'blacken-mode) +;; if black is present, enable it +(when (executable-find "black") + (require 'blacken) + (add-hook 'python-mode-hook 'blacken-mode)) + +(setq python-shell-interpreter "python3") (provide 'my-lang-python) |