From d14ddbf69426bf74b80babe60dbffda4d217870d Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 30 Jun 2024 13:02:27 -0400 Subject: [PATCH] fix(python): ensure anaconda-mode and +lsp are mutually exclusive I'm considering removing anaconda entirely from the module (to lean on LSP), but for the time being, this should help with anaconda taking over ine eglot-enabled buffers. Fix: #7823 --- modules/lang/python/config.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/lang/python/config.el b/modules/lang/python/config.el index 3014db9db..d31a9d735 100644 --- a/modules/lang/python/config.el +++ b/modules/lang/python/config.el @@ -104,6 +104,12 @@ (bound-and-true-p lsp--buffer-deferred) (not (executable-find python-shell-interpreter t))) (anaconda-mode +1)))) + + (add-hook! 'eglot-server-initialized-hook + (defun +python-disable-anaconda-mode-h () + "Ensure `anaconda-mode' doesn't interfere with `eglot'." + (when (bound-and-true-p anaconda-mode) + (anaconda-mode -1)))) :config (set-company-backend! 'anaconda-mode '(company-anaconda)) (set-lookup-handlers! 'anaconda-mode