Default to eglot for Python programming

This is to ease the configuration, as eglot is built in.  lsp-mode might
provide a better programming experience, but I do not do much Python
programming nowadays.
This commit is contained in:
Daniel Borchmann 2024-12-21 20:51:25 +01:00
parent 2837712f5c
commit f646a2f98a
No known key found for this signature in database
GPG Key ID: 784AA8DF0CCDF625

10
init.el
View File

@ -1362,10 +1362,9 @@ Note that this workaround is incomplete, as explained in this comment."
ediff-show-clashes-only t) ediff-show-clashes-only t)
:config (add-hook 'ediff-after-quit-hook-internal 'winner-undo)) :config (add-hook 'ediff-after-quit-hook-internal 'winner-undo))
;; Inspired by
;; https://andreyor.st/posts/2023-09-09-migrating-from-lsp-mode-to-eglot.
(use-package eglot (use-package eglot
:ensure t :ensure nil
;; Inspired by https://andreyor.st/posts/2023-09-09-migrating-from-lsp-mode-to-eglot.
:init (setq eglot-autoshutdown t :init (setq eglot-autoshutdown t
eglot-extend-to-xref nil eglot-extend-to-xref nil
eglot-stay-out-of '(yasnippet))) eglot-stay-out-of '(yasnippet)))
@ -2898,12 +2897,9 @@ eventuelly be set to nil, however)."
(use-package python (use-package python
:config (progn :config (progn
(unless (require 'lsp-pyright nil :no-error)
(message "`lsp-pyright' not available, using defaults from `lsp'"))
(add-hook 'python-mode-hook #'highlight-indentation-mode) (add-hook 'python-mode-hook #'highlight-indentation-mode)
(add-hook 'python-mode-hook #'company-mode) (add-hook 'python-mode-hook #'company-mode)
(add-hook 'python-mode-hook #'lsp-deferred) (add-hook 'python-mode-hook #'eglot-ensure)
(add-hook 'python-mode-hook #'subword-mode))) (add-hook 'python-mode-hook #'subword-mode)))
;; https://ddavis.io/posts/emacs-python-lsp/ ;; https://ddavis.io/posts/emacs-python-lsp/