Switch to `eglot-jl' from MELPA

This commit is contained in:
Gerard Vermeulen 2024-03-19 21:16:46 +01:00
parent c83ece0889
commit c03da09ede

View File

@ -4528,15 +4528,16 @@ out of your way. [[info:eglot#Top][Eglot (info)]] is a builtin since Emacs-29.1
listings contribute to a programming language mode independent [[https://github.com/joaotavora/eglot][Eglot]]
configuration:
1. Listing [[lst:minimal-eglot-setup][minimal Eglot setup]] adds key bindings to =eglot-mode-keymap=.
2. Listing [[lst:setup-oglot]] uses [[https://github.com/gav451/oglot#][oglot]] to enable using [[https://github.com/joaotavora/eglot][Eglot]] in =org-src-mode=
Julia and Python buffers.
2. Listing [[lst:setup-eglot-jl]] adds [[https://julialang.org/][Julia]] support to [[info:eglot#Top][Eglot (info)]].
3. Listing [[lst:cli-eglot-jl-setup]] shows how to setup [[https://github.com/non-Jedi/eglot-jl][eglot-jl]] from the command
line.
4. Listing [[lst:eglot-maybe-ensure]] starts [[https://github.com/joaotavora/eglot][Eglot]] in case of proper programming
4. Listing [[lst:setup-oglot]] uses [[https://github.com/gav451/oglot#][oglot]] to enable using [[https://github.com/joaotavora/eglot][Eglot]] in =org-src-mode=
Julia and Python buffers.
5. Listing [[lst:eglot-maybe-ensure]] starts [[https://github.com/joaotavora/eglot][Eglot]] in case of proper programming
modes and proper directory local variables (meaning in presence of a proper
file [[info:emacs#Directory Variables][.dir-locals.el]] in the root directory of any project using proper
programming modes).
5. Listing [[lst:whiten-black]] defines Emacs Lisp functions to undo (whiten) some
6. Listing [[lst:whiten-black]] defines Emacs Lisp functions to undo (whiten) some
output of [[https://black.readthedocs.io/en/stable/][Black]] after src_emacs-lisp[:results silent]{(org-babel-tangle)}.
#+caption[Ensure =eglot= installation with minimal setup]:
@ -4549,27 +4550,31 @@ configuration:
(keymap-set eglot-mode-map "C-c r" 'eglot-rename))
#+end_src
#+caption: Setup ~oglot~ for ~python-mode~.
#+name: lst:setup-oglot
#+caption: Setup ~eglot~ for ~julia-mode~.
#+name: lst:setup-eglot-jl
#+begin_src emacs-lisp -n :results silent
(when (and (package-installed-p 'oglot)
(require 'oglot nil 'noerror))
(push (expand-file-name "~/VCS/eglot-jl") load-path)
(require 'eglot-jl)
(eglot-jl-init)
(setopt oglot-maybe-ensure-modes '(julia-mode python-mode)))
(when (ensure-package-installation 'eglot-jl)
(eglot-jl-init))
#+end_src
#+caption[Setup =eglot-jl= from the command line]:
#+caption: Setup =eglot-jl= from the command line.
#+name: lst:cli-eglot-jl-setup
#+begin_src shell :eval never
# Run this from the directory containing the local eglot-jl clone:
julia --project=eglot-jl/ eglot-jl/eglot-jl.jl
# Run this from `package-user-dir':
julia --project=eglot-jl-20240318.1159/ eglot-jl-20240318.1159/eglot-jl.jl
# The SymbolServer is ready caching dependencies when it displays:
# [ Info: Received new data from Julia Symbol Server.
#+end_src
#+caption: Setup ~oglot~ for ~julia-mode~ and ~python-mode~.
#+name: lst:setup-oglot
#+begin_src emacs-lisp -n :results silent
(when (and (package-installed-p 'oglot)
(require 'oglot nil 'noerror))
(setopt oglot-maybe-ensure-modes '(julia-mode python-mode)))
#+end_src
#+caption[Start =eglot= in case of a proper =dir-local-variables-alist=]:
#+caption: Start =eglot= in case of a proper =dir-local-variables-alist=.
#+name: lst:eglot-maybe-ensure