From c79cf3c82004775c0d25bbd6415ea248723f6b12 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 25 Apr 2019 22:20:05 -0400 Subject: [PATCH] lang/python: use anaconda-mode for non-project files --- modules/lang/python/config.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/lang/python/config.el b/modules/lang/python/config.el index 403071e64..3ccbd46f1 100644 --- a/modules/lang/python/config.el +++ b/modules/lang/python/config.el @@ -56,8 +56,7 @@ called.") (def-package! anaconda-mode - :unless (featurep! +lsp) - :hook python-mode-local-vars + :hook (python-mode-local-vars . +python|init-anaconda-mode-maybe) :init (setq anaconda-mode-installation-directory (concat doom-etc-dir "anaconda/") anaconda-mode-eldoc-as-single-line t) @@ -70,6 +69,10 @@ called.") :documentation #'anaconda-mode-show-doc) (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 () "Kill anaconda processes if this buffer is the last python buffer." (when (and (eq major-mode 'python-mode)