Fork me on GitHub
#cider
<
2019-03-29
>
bozhidar07:03:14

@bfay Happy to hear this!

bozhidar07:03:26

> @bozhidar hello! many thanks for cider! is there any way to do something like cider-pprint-eval-last-sexp-to-repl but printing the result in the REPL instead of adding it as input in the REPL?

bozhidar07:03:02

@stathissideris Do you want just the result printed there? Or you want the form added and the result printed?

stathissideris07:03:00

@bozhidar just the result please

bozhidar07:03:09

Those two come to mind:

bozhidar07:03:11

["Eval last sexp to REPL" cider-eval-last-sexp-to-repl]
    ["Eval last sexp and pretty-print to REPL" cider-pprint-eval-last-sexp-to-repl]

stathissideris09:03:06

@bozhidar cider-pprint-eval-last-sexp-to-repl inserts the result as an expression in the prompt, not above it (or below it)

stathissideris09:03:56

so I mean it’s printed as input, not as output

bozhidar10:03:21

I don’t think we have something to just display eval results in the REPL, but that’s certainly doable. Why do you need something like this? Won’t it be a bit hard to follow as results would have appeared out of nowhere?

conan10:03:22

Hi lovely people, do any of you have a .dir-locals.el file that you use for a combined clj/cljs tools.deps project that you'd be prepared to share with me? i'm not an Emacs user (shoo! shoo!) but I'm trying to set up a build that will work happily with cider jack-in for my colleagues, so i'd really appreciate the help. Thanks!

dominicm10:03:27

The edge one is pretty advanced at this point, that's the one I'd recommend

conan10:03:58

oh cool, i didn't realise there was one in there

conan10:03:16

do you have a link by any chance? i'm basically trying to learn the syntax

conan10:03:51

yeah, that's fine =D i saw this, but i guess it's not exactly what i'm after, as it contains (what i understand to be) only a single, global configuration section, whereas i'm after an example with separate clojure-mode and clojurescript-mode sections - or to find i'm barking up the wrong tree?

conan10:03:08

the long-term thing i'd like to learn is how to set up a clj/cljs project that works for all ides without any custom configuration for each, which means now i need to understand what the custom configuration actually does.

dominicm10:03:51

I think you're barking up the wrong tree

conan11:03:22

haha, ok thanks, that's good to know!

dominicm11:03:48

I don't understand what you're looking for with clojure-mode and clojurescript-mode sections, there's nothing to really put in a .dir-locals.el related to them afaik. The bulk of what a cider user is looking for is making jack-in work, after that they want cljs-jack-in to work.

conan16:03:46

trying to apply a different profile when kicking off jack-in for clojure and clojurescript

conan16:03:22

i'll fully admit i don't really know what jack-in is exactly

dominicm17:03:47

jack-in is done to create a single JVM, so the settings have to be shared between them

dominicm17:03:05

Jack-in is about starting a JVM with the right dependencies loaded.

stathissideris10:03:44

@bozhidar The workflow I’d like to try is type long multi-line expressions in a .clj file and eval+pretty-print their results in the REPL where the results accumulate. I saw that something similar would be possible with getting the results in a popup buffer, but I prefer to see a “log” of results. If the inputs are also shown (as you said it may be a bit hard to follow otherwise) I think it would be even more usable, but I’d be happy with just the outputs

plexus10:03:16

How do I tell CIDER again not to take over *out* and *err*? My google fu is failing me...

plexus10:03:32

I'm starting my nREPL outside of Emacs, and I want all output to go to that terminal, instead of to the *cider-repl* buffer

plexus11:03:38

found it I think, cider-redirect-server-output-to-repl

plexus11:03:56

there's no substitute for grepping the source 🙂

bozhidar11:03:39

@plexus Yep, that’s the magic option.

bozhidar11:03:19

@stathissideris Got it. It makes sense to me, so I’d suggest filing a ticket about this so I won’t forget to look into it.

bozhidar11:03:34

> I saw that something similar would be possible with getting the results in a popup buffer,

bozhidar11:03:16

Yeah, I’m thinking we can probably add another option for the result destinations. I’d be wary of adding dedicated commands for something like this.

orestis12:03:31

I would love the workflow that @stathissideris is talking about. If you are tweaking data, it’s very helpful to have a history that you can just scroll back and see.

❤️ 4
dpsutton13:03:03

can you get this with the insert commands? > if the eval'ed expression is also added as if it was typed in the prompt of the REPL check out the map under C-c C-j for the insert commands

dpsutton13:03:22

(setq cider-switch-to-repl-on-insert nil)
(setq cider-invert-insert-eval-p t)

dpsutton13:03:27

these 1) prevent jumping to the repl buffer on insert and 2) eval it rather than wait for more input

stathissideris13:03:42

haven’t seen these before, reading docs…

stathissideris13:03:45

@dpsutton that would actually cover my use case exactly! but I don’t seem to have cider-switch-to-repl-on-insert

dpsutton13:03:56

i think that's new

stathissideris13:03:59

I’m on CIDER 0.21.0 (New York)

dpsutton13:03:09

the current one is cider-switch-to-repl-after-insert

stathissideris13:03:58

works! with a slight problem: it seems that if cider-switch-to-repl-after-insert-p is true, the REPL scrolls to the end of the result, if it’s nil it doesn’t 🙂

stathissideris13:03:59

thanks @dpsutton, I’ll see if I can script it to scroll somehow (didn’t know about the insert commands)

bozhidar13:03:50

Even I had forgotten about those two options. 😄

dpsutton14:03:33

i remember working on something like this

dpsutton14:03:44

there were subleties of buffer focused, visible, etc