From cfc1161822b5a6fde54b457cd16f5687cf12ce00 Mon Sep 17 00:00:00 2001 From: Gerard Vermeulen Date: Thu, 29 Dec 2022 08:52:38 +0100 Subject: [PATCH] Make the minimal `eglot' setup show more options --- README.org | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/README.org b/README.org index 260ed60..8472c3e 100644 --- a/README.org +++ b/README.org @@ -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 programming modes). -#+caption[Ensure =eglot= installation with minimal configuration]: -#+caption: Ensure =eglot= installation with minimal configuration. +#+caption[Ensure =eglot= installation with minimal setup]: +#+caption: Ensure =eglot= installation with minimal setup. #+name: lst:minimal-eglot-setup #+begin_src emacs-lisp (with-eval-after-load 'emacs @@ -3852,13 +3852,16 @@ mode independent [[https://github.com/joaotavora/eglot][Eglot]] configuration: ;; Replace `nil' with `t' for debugging. (when nil - (defvar eglot-server-programs - `(((python-ts-mod python-mode) . ("pylsp" "-vv"))) - "Shadow the definition of `eglot-server-programs' in `eglot'.")) + (when (require 'eglot nil t) + (setq eglot-server-programs + `(((python-ts-mod python-mode) + . ,(eglot-alternatives + '(("pylsp" "-vv") + ("ruff-lsp")))))))) (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 p") #'flymake-goto-prev-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 r") 'eglot-rename))) #+end_src