diff --git a/README.org b/README.org index 09e200a..e095c8c 100644 --- a/README.org +++ b/README.org @@ -69,3 +69,35 @@ displays: #+begin_quote [ Info: Received new data from Julia Symbol Server. #+end_quote + +*** How can I work over TRAMP? +~eglot~ supports working with projects on remote machines using TRAMP; +we just need to inform ~eglot~ where to find ~julia~ and ~eglot-jl~ on +the remote machine. This can be done in the minibuffer by issuing ~C-u +M-x eglot~, which will ask for all paths. It is however, more +convenient to store these values in a ~.dir-locals.el~ file in the +same directory as ~Project.toml~, with the following contents: +#+BEGIN_SRC emacs-lisp + ((julia-mode . ((eglot-jl-base . "/path/to/eglot-jl/") + (eglot-jl-julia-command . "/path/to/julia/bin/julia") + (eglot-jl-language-server-project . "/path/to/eglot-jl/"))) + (julia-ts-mode . ((eglot-jl-base . "/path/to/eglot-jl/") + (eglot-jl-julia-command . "/path/to/julia/bin/julia") + (eglot-jl-language-server-project . "/path/to/eglot-jl/")))) + +#+END_SRC +We need to inform Emacs to load local variables on remote machines in +our ~init.el~, and mark these particular values as safe for those +variables: +#+BEGIN_SRC emacs-lisp + ;; https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html + (setq enable-remote-dir-locals t) + + ;; https://emacs.stackexchange.com/a/10989 + (add-to-list 'safe-local-variable-values + '(eglot-jl-base . "/path/to/eglot-jl/")) + (add-to-list 'safe-local-variable-values + '(eglot-jl-julia-command . "/path/to/julia/bin/julia")) +#+END_SRC +Alternatively, it may be preferable to set these variables using +[[https://www.gnu.org/software/emacs/manual/html_node/elisp/Connection-Local-Variables.html][connection local variables]] instead.