summary refs log tree commit diff
path: root/emacs
diff options
context:
space:
mode:
Diffstat (limited to 'emacs')
-rw-r--r--emacs/custom/my-lang-python.el10
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)