Skip to content

Commit

Permalink
Explain direnv scenario in back end scenarios example of Guide
Browse files Browse the repository at this point in the history
Extra documentation for issue #706.
  • Loading branch information
greghendershott committed Apr 16, 2024
1 parent a0d0566 commit 7f2a6a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion doc/racket-mode.org
Expand Up @@ -412,12 +412,14 @@ In the common case there is only one back end, on the same local host as Emacs,

{{{img(scenario-0, Emacs front end and one local back end)}}}

However you can configure using any number of back ends on any number of local or remote hosts.
However you can configure using any number of back ends on any number of local or remote host paths.

As one example, you can have multiple back ends on the local host. One back end is used for a project under a specific subdirectory, and the other back end for all others. (Perhaps one project needs Racket built from source, and everything else uses an installed, older version of Racket. By using different back ends, not only will ~racket-run~ use the desired version of Racket for a file, so will commands for documentation or visiting definitions.)

{{{img(scenario-1, Emacs front end and two local back ends --- one for a project path)}}}

(Note: If you use various versions of Racket via [[https://direnv.net/][~direnv~]] combined with the [[https://github.com/purcell/envrc][~envrc~ Emacs package]], you still need a distinct back end for each project. To arrange this, add or modify a ~.dir-locals.el~ file next to each ~.envrc~ file; {{{see(racket-add-back-end)}}}.)

Furthermore, you could work with a project located on a remote host, whose files you edit using TRAMP. You also want the back end to run there. For a remote host, Racket Mode copies its back end source files to the remote when necessary, and runs the back end using ssh.

{{{img(scenario-2, Emacs front end and a back end on a remote host)}}}
Expand Down
4 changes: 3 additions & 1 deletion doc/racket-mode.texi
Expand Up @@ -868,12 +868,14 @@ In the common case there is only one back end, on the same local host as Emacs,

@image{scenario-0,,, Emacs front end and one local back end. Command I/O via pipe (local) or ssh (remote). Each back end provides zero or more REPLs.,.svg}

However you can configure using any number of back ends on any number of local or remote hosts.
However you can configure using any number of back ends on any number of local or remote host paths.

As one example, you can have multiple back ends on the local host. One back end is used for a project under a specific subdirectory, and the other back end for all others. (Perhaps one project needs Racket built from source, and everything else uses an installed, older version of Racket. By using different back ends, not only will @code{racket-run} use the desired version of Racket for a file, so will commands for documentation or visiting definitions.)

@image{scenario-1,,, Emacs front end and two local back ends --- one for a project path. Command I/O via pipe (local) or ssh (remote). Each back end provides zero or more REPLs.,.svg}

(Note: If you use various versions of Racket via @uref{https://direnv.net/, @code{direnv}} combined with the @uref{https://github.com/purcell/envrc, @code{envrc} Emacs package}, you still need a distinct back end for each project. To arrange this, add or modify a @code{.dir-locals.el} file next to each @code{.envrc} file; @xref{racket-add-back-end}.)

Furthermore, you could work with a project located on a remote host, whose files you edit using TRAMP@. You also want the back end to run there. For a remote host, Racket Mode copies its back end source files to the remote when necessary, and runs the back end using ssh.

@image{scenario-2,,, Emacs front end and a back end on a remote host. Command I/O via pipe (local) or ssh (remote). Each back end provides zero or more REPLs.,.svg}
Expand Down

0 comments on commit 7f2a6a8

Please sign in to comment.