mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
lang/python: load anaconda-mode a little sooner
So its hooks take effect in the first buffer.
This commit is contained in:
@ -84,14 +84,10 @@ called.")
|
|||||||
|
|
||||||
|
|
||||||
(use-package! anaconda-mode
|
(use-package! anaconda-mode
|
||||||
:defer t
|
:after python
|
||||||
: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)
|
||||||
(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
|
:config
|
||||||
(add-hook 'anaconda-mode-hook #'anaconda-eldoc-mode)
|
(add-hook 'anaconda-mode-hook #'anaconda-eldoc-mode)
|
||||||
(set-company-backend! 'anaconda-mode '(company-anaconda))
|
(set-company-backend! 'anaconda-mode '(company-anaconda))
|
||||||
@ -101,6 +97,12 @@ 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)
|
||||||
|
|
||||||
|
(add-hook! 'python-mode-local-vars-hook
|
||||||
|
(defun +python-init-anaconda-mode-maybe-h ()
|
||||||
|
"Enable `anaconda-mode' if `lsp-mode' isn't."
|
||||||
|
(unless (bound-and-true-p lsp-mode)
|
||||||
|
(anaconda-mode +1))))
|
||||||
|
|
||||||
(defun +python-auto-kill-anaconda-processes-h ()
|
(defun +python-auto-kill-anaconda-processes-h ()
|
||||||
"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)
|
||||||
|
Reference in New Issue
Block a user