Pick up local variables before starting the Python IDE
This commit is contained in:
parent
02786dac5c
commit
b2f67e84ee
1 changed files with 5 additions and 4 deletions
|
|
@ -243,16 +243,17 @@
|
||||||
(defun load-python-env ()
|
(defun load-python-env ()
|
||||||
"Set up the Python IDE in the current project."
|
"Set up the Python IDE in the current project."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
(when (derived-mode-p 'python-mode)
|
||||||
(progn
|
(progn
|
||||||
(ignore-errors (poetry-venv-workon))
|
(poetry-venv-workon)
|
||||||
(eglot-ensure)))
|
(eglot-ensure))))
|
||||||
|
|
||||||
(use-package python
|
(use-package python
|
||||||
:bind (:map python-mode-map
|
:bind (:map python-mode-map
|
||||||
("C-c C-p" . nil)
|
("C-c C-p" . nil)
|
||||||
("C-c C-l" . nil)
|
("C-c C-l" . nil)
|
||||||
("C-c t" . elpy-test))
|
("C-c t" . elpy-test))
|
||||||
:hook (python-mode . load-python-env)
|
:hook (hack-local-variables . load-python-env)
|
||||||
:config
|
:config
|
||||||
(load "python-tests.el")
|
(load "python-tests.el")
|
||||||
:custom
|
:custom
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue