lang/python: kill anaconda processes after killing last python buffer
This commit is contained in:
parent
e16ec5ae94
commit
4dbca5b21f
1 changed files with 10 additions and 1 deletions
|
@ -84,7 +84,16 @@ environment variables."
|
||||||
:definition #'anaconda-mode-find-definitions
|
:definition #'anaconda-mode-find-definitions
|
||||||
:references #'anaconda-mode-find-references
|
:references #'anaconda-mode-find-references
|
||||||
:documentation #'anaconda-mode-show-doc)
|
:documentation #'anaconda-mode-show-doc)
|
||||||
(advice-add #'anaconda-mode-doc-buffer :after #'doom*anaconda-mode-doc-buffer))
|
(advice-add #'anaconda-mode-doc-buffer :after #'doom*anaconda-mode-doc-buffer)
|
||||||
|
|
||||||
|
(defun +python|auto-kill-anaconda-processes ()
|
||||||
|
"Kill anaconda processes if this buffer is the last python buffer."
|
||||||
|
(when (and (eq major-mode 'python-mode)
|
||||||
|
(not (delq (current-buffer)
|
||||||
|
(doom-buffers-in-mode 'python-mode (buffer-list)))))
|
||||||
|
(anaconda-mode-stop)))
|
||||||
|
(add-hook! 'python-mode-hook
|
||||||
|
(add-hook 'kill-buffer-hook #'+python|auto-kill-anaconda-processes nil t)))
|
||||||
|
|
||||||
|
|
||||||
(def-package! company-anaconda
|
(def-package! company-anaconda
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue