lang/python: use anaconda-mode for non-project files

This commit is contained in:
Henrik Lissner 2019-04-25 22:20:05 -04:00
parent eb62dde5d3
commit c79cf3c820
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -56,8 +56,7 @@ called.")
(def-package! anaconda-mode (def-package! anaconda-mode
:unless (featurep! +lsp) :hook (python-mode-local-vars . +python|init-anaconda-mode-maybe)
:hook python-mode-local-vars
:init :init
(setq anaconda-mode-installation-directory (concat doom-etc-dir "anaconda/") (setq anaconda-mode-installation-directory (concat doom-etc-dir "anaconda/")
anaconda-mode-eldoc-as-single-line t) anaconda-mode-eldoc-as-single-line t)
@ -70,6 +69,10 @@ called.")
:documentation #'anaconda-mode-show-doc) :documentation #'anaconda-mode-show-doc)
(set-popup-rule! "^\\*anaconda-mode" :select nil) (set-popup-rule! "^\\*anaconda-mode" :select nil)
(defun +python|init-anaconda-mode-maybe ()
(unless (bound-and-true-p lsp-mode)
(anaconda-mode +1)))
(defun +python|auto-kill-anaconda-processes () (defun +python|auto-kill-anaconda-processes ()
"Kill anaconda processes if this buffer is the last python buffer." "Kill anaconda processes if this buffer is the last python buffer."
(when (and (eq major-mode 'python-mode) (when (and (eq major-mode 'python-mode)