Make the minimal `eglot' setup show more options

This commit is contained in:
Gerard Vermeulen 2022-12-29 08:52:38 +01:00
parent a60623b44c
commit cfc1161822

View File

@ -3842,8 +3842,8 @@ mode independent [[https://github.com/joaotavora/eglot][Eglot]] configuration:
file [[info:emacs#Directory Variables][.dir-locals.el]] in the root directory of any project using proper file [[info:emacs#Directory Variables][.dir-locals.el]] in the root directory of any project using proper
programming modes). programming modes).
#+caption[Ensure =eglot= installation with minimal configuration]: #+caption[Ensure =eglot= installation with minimal setup]:
#+caption: Ensure =eglot= installation with minimal configuration. #+caption: Ensure =eglot= installation with minimal setup.
#+name: lst:minimal-eglot-setup #+name: lst:minimal-eglot-setup
#+begin_src emacs-lisp #+begin_src emacs-lisp
(with-eval-after-load 'emacs (with-eval-after-load 'emacs
@ -3852,13 +3852,16 @@ mode independent [[https://github.com/joaotavora/eglot][Eglot]] configuration:
;; Replace `nil' with `t' for debugging. ;; Replace `nil' with `t' for debugging.
(when nil (when nil
(defvar eglot-server-programs (when (require 'eglot nil t)
`(((python-ts-mod python-mode) . ("pylsp" "-vv"))) (setq eglot-server-programs
"Shadow the definition of `eglot-server-programs' in `eglot'.")) `(((python-ts-mod python-mode)
. ,(eglot-alternatives
'(("pylsp" "-vv")
("ruff-lsp"))))))))
(with-eval-after-load 'eglot (with-eval-after-load 'eglot
(define-key eglot-mode-map (kbd "C-c n") #'flymake-goto-next-error) (define-key eglot-mode-map (kbd "C-c n") 'flymake-goto-next-error)
(define-key eglot-mode-map (kbd "C-c p") #'flymake-goto-prev-error) (define-key eglot-mode-map (kbd "C-c p") 'flymake-goto-prev-error)
(define-key eglot-mode-map (kbd "C-c r") 'eglot-rename))) (define-key eglot-mode-map (kbd "C-c r") 'eglot-rename)))
#+end_src #+end_src