lang/python: ensure anaconda-mode in first python buffer

This commit is contained in:
Henrik Lissner 2019-07-28 02:30:45 +02:00
parent afc22e4265
commit 059030be49
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -84,10 +84,14 @@ called.")
(use-package! anaconda-mode
:hook (python-mode-local-vars . +python-init-anaconda-mode-maybe-h)
:defer t
:init
(setq anaconda-mode-installation-directory (concat doom-etc-dir "anaconda/")
anaconda-mode-eldoc-as-single-line t)
(add-hook! 'python-mode-local-vars-hook
(defun +python-init-anaconda-mode-maybe-h ()
(unless (bound-and-true-p lsp-mode)
(anaconda-mode +1))))
:config
(add-hook 'anaconda-mode-hook #'anaconda-eldoc-mode)
(set-company-backend! 'anaconda-mode '(company-anaconda))
@ -97,10 +101,6 @@ called.")
:documentation #'anaconda-mode-show-doc)
(set-popup-rule! "^\\*anaconda-mode" :select nil)
(defun +python-init-anaconda-mode-maybe-h ()
(unless (bound-and-true-p lsp-mode)
(anaconda-mode +1)))
(defun +python-auto-kill-anaconda-processes-h ()
"Kill anaconda processes if this buffer is the last python buffer."
(when (and (eq major-mode 'python-mode)