Skip to content

Commit

Permalink
Updated README on how to work over TRAMP
Browse files Browse the repository at this point in the history
  • Loading branch information
jagot committed Apr 12, 2023
1 parent fa408e1 commit 8aef1d2
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit 8aef1d2

Please sign in to comment.