-
I have the config below: (use-package eglot
:config
(add-to-list 'eglot-server-programs '(rust-mode . ("rust-analyzer")))
(add-to-list 'eglot-server-programs '(python-mode . ("pyls"))))
(use-package rust-mode
:config
(add-hook 'rust-mode-hook (lambda ()
(eglot-ensure))))
(use-package python
:straight (:type built-in)
:config
(add-hook 'python-mode-hook (lambda ()
(elgot-ensure)))) Elgot works when I open a Rust file, but when I open a Python file. I got I try to debug the problem, using the code below: ;; set user-emacs-directory to the directory where this file lives
;; do not read or write anything in $HOME/.emacs.d
(setq user-init-file (or load-file-name (buffer-file-name)))
(setq user-emacs-directory (file-name-directory user-init-file))
;; set custom-file to write into a separate place
(setq custom-file (concat user-emacs-directory ".custom.el"))
(when (file-readable-p custom-file) (load custom-file))
;; configure melpa (and other repos if needed)
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(setq package-enable-at-startup nil)
(package-initialize)
(when (not package-archive-contents)
(package-refresh-contents))
;; bootstrap `use-package'
(setq package-pinned-packages
'((bind-key . "melpa")
(diminish . "melpa")
(use-package . "melpa")))
(dolist (p (mapcar 'car package-pinned-packages))
(unless (package-installed-p p)
(package-install p)))
;; install and configure packages
(use-package eglot
:config
(add-to-list 'eglot-server-programs '(python-mode . ("pyls"))))
(use-package python
:config
(add-hook 'python-mode-hook (lambda ()
(elgot-ensure)))) However, I got: ❯ emacs -q -l init.el --batch
Loading /home/azzamsa/playground/elgot-tmp/.custom.el (source)...
Error (use-package): Cannot load eglot I tried to run remove the In the first case: Elgot is installed via straight.el: it works with Rust but not Python. GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0) of 2021-12-01
c13b49a110 (HEAD -> master, origin/master, origin/HEAD) 2 days ago update_autogen: Remove deprecated -I flag (Stefan Kangas)
OS: Debian GNU/Linux 11 (bullseye)
Kernel: Linux 5.10.0-9-amd64 x86_64 Help is very appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Also (add-hook 'python-mode-hook 'eglot-ensure) |
Beta Was this translation helpful? Give feedback.
elgot
->eglot
?Also
lambda
is not necessary.