cider

A channel dedicated to the Clojure Interactive Development Environment that Rocks (aka CIDER). :cider:
bozhidar 2021-02-25T08:31:28.023400Z

> Is there a way to jump to the "code at point" from the stacktrace printed in the REPL buffer using a keyboard shortcut?

bozhidar 2021-02-25T08:31:40.023800Z

Doesn't RET work here?

danielneal 2021-02-25T14:37:17.025900Z

Does anyone know how to clear all the repl output so I get a brand spanking totally clear buffer? I tried C-c C-o but it just prints ;output cleared and leaves all the previous mess I printed.

dpsutton 2021-02-25T14:44:38.026700Z

use a prefix with that. C-u C-c C-o > (cider-repl-clear-output &optional CLEAR-REPL) > Delete the output inserted since the last input. > With a prefix argument CLEAR-REPL it will clear the entire REPL buffer instead.

danielneal 2021-02-25T14:44:53.026900Z

perfect! Thank you 🙂

2021-02-25T15:06:56.029900Z

Hi all, I would like to contribute a documentation change regarding cider-path-translations , the documentation refers to the "In the example above, the .m2 directory is mounted at /root/.m2 and the source at /src" but the example is not correct. What's the best repo to open the issue and a pull request? https://github.com/clojure-emacs/cider/blob/master/doc/modules/ROOT/pages/config/basic_config.adoc#translate-file-paths

enn 2021-02-25T15:08:18.030700Z

@danieleneal there’s also cider-repl-clear-buffer. I’m not sure if it’s bound by default but I have it bound to C-c M-o.

2021-02-25T15:09:10.031200Z

I would also like to extend the example with the use of eval pseudo-variable to use (clojure-project-dir) instead of a fixed project path. This is useful when having the .dir-locals.el shared across a team that have the cloned repo in different locations

dpsutton 2021-02-25T15:10:16.031600Z

yeah i wish there was a second dir-locals that could be gitignored that each person could use

dpsutton 2021-02-25T15:11:00.031800Z

so that kind of thing could go in there. what's wrong with the example though? I thought it was right. root/.m2 and src/ should be translated to users/foo and users/foo/project

2021-02-25T15:13:18.032Z

ah! yeah, you're right, any /root/* will get translated to /Users/someuser/*

2021-02-25T15:13:54.032200Z

I'm more used to translate paths that are meaningful to the development, not any path under /root/

dpsutton 2021-02-25T15:14:34.032400Z

i made that feature and it was pretty tailored to my then current work setup of working in a docker image. if you want to adapt it and make it more flexible/general go for it

2021-02-25T15:14:38.032600Z

after checking https://github.com/clojure-emacs/docs.cider.mx I now understand that the actual documentation comes from cider main repo

dpsutton 2021-02-25T15:14:56.032900Z

i had a very concrete problem at hand so there may be room for more generality

2021-02-25T15:15:37.033100Z

We're using docker too, and a group of Linux and macOS devs, and came with this one - https://gist.github.com/iperdomo/88f3156dbb79fe99bc440d1700bb7162#file-dir-locals-el-L3-L8

2021-02-25T15:17:00.033300Z

in the case of linux users the reported user is not root but akvo ... what I'm proposing is a general example on how to use eval to get clojure-project-dir call working

2021-02-25T15:17:06.033500Z

does it make sense?

dpsutton 2021-02-25T15:18:01.033700Z

in docker i figured the user would be consistent. you are all presumably using the same docker configs

dpsutton 2021-02-25T15:18:24.033900Z

and i think we ended up just making a template file that was committed and then having everyone make their own (git ignored) dir locals

dpsutton 2021-02-25T15:18:37.034100Z

as i think eval runs on every new buffer rather than just once

2021-02-25T15:19:46.034300Z

I'm a basic emacs user (use it for CIDER only), so the whole eval and .dir-locals.el is new to me

dpsutton 2021-02-25T15:21:58.034500Z

yeah. i'm not a big fan of it

2021-02-25T15:22:08.034700Z

note that eval is also mentioned in other config documentation - https://github.com/clojure-emacs/cider/blob/master/doc/modules/ROOT/pages/config/project_config.adoc#project-specific-configuration

dpsutton 2021-02-25T15:22:31.035Z

yeah. its an option. we just went with the far simpler template and make your own dir locals

2021-02-25T15:24:34.035200Z

do you think it would be interesting/beneficial to contribute that approach of using eval?

dpsutton 2021-02-25T15:31:39.035400Z

sure

2021-02-25T15:33:51.035600Z

I'll open an issue and a PR, thanks

2021-02-25T15:51:25.035900Z

re-reading the documentation again, what confused me was this In the example above, the .m2 directory is mounted at /root/.m2 but the example is the root folder is mounted as the host's home folder

2021-02-25T15:52:22.036100Z

perhaps making explicit reference to /root/.m2 -> /Users/foo/.m2 makes that sentence less confusing?

dpsutton 2021-02-25T15:56:39.036300Z

sure. fundamentally its just prefix matching. so whatever prefix you want, go for it

2021-02-25T16:15:01.036500Z

Ok, issue and pr open - happy to change, improve it if needed - https://github.com/clojure-emacs/cider/pull/2989