Skip to content

Commit 2a46c60

Browse files
iperdomobbatsov
authored andcommitted
[Fix #2988] Explain how to use eval for dynamic path translation
1 parent c59dea7 commit 2a46c60

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

doc/modules/ROOT/pages/config/basic_config.adoc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,21 @@ exist. In the example above, the `.m2` directory is mounted at `/root/.m2`
196196
and the source at `/src`. These translations would map these locations
197197
back to the user's computer so that navigation to definition would work.
198198

199+
Using the `eval` pseudo-variable you can make the translation dynamic, enabling
200+
the possibility of sharing the `.dir-locals.el` across a team of developers with
201+
different configurations.
202+
203+
[source,lisp]
204+
----
205+
((nil . ((eval . (customize-set-variable 'cider-path-translations
206+
(list
207+
(cons "/src" (clojure-project-dir))
208+
(cons "/root/.m2" (concat (getenv "HOME") "/.m2"))))))))
209+
----
210+
211+
In this example, the path `/src` will be translated to the correct path of your
212+
Clojure project on the host machine. And `/root/.m2` to the host's `~/.m2` folder.
213+
199214
== Use a Local Copy of the JDK API Documentation
200215

201216
If you are targeting the JVM and prefer a local copy of the JDK API

0 commit comments

Comments
 (0)