cider

A channel dedicated to the Clojure Interactive Development Environment that Rocks (aka CIDER). :cider:
jumar 2021-02-16T04:46:17.300300Z

How can I make the repl buffer (after cider-jack-in open on the right (vertical split of the current window) instead of at the bottom (horizontal split)?

dpsutton 2021-02-16T05:17:36.301400Z

cider uses either display-buffer or pop-to-buffer which are C emacs functions. I don't see any information about how to affect it. From experience if the window is wide it will split vertically and if tall will split horizontally. I don't know if there's a way to force that or not

jumar 2021-02-16T08:18:50.303Z

Yeah, I'm using 27# monitor and Cider alwasys considers it "tall" enough to split horizontally

dpsutton 2021-02-16T05:20:56.301800Z

https://stackoverflow.com/questions/20167246/emacs-open-buffer-in-vertical-split-by-default has some tricks to set the knobs for how the heuristics work

dpsutton 2021-02-16T05:23:06.302600Z

this works for me (let ((split-height-threshold nil) (split-width-threshold 0)) (pop-to-buffer (get-buffer-create "random"))). so you could make your own jack-in-function and instead of calling pop-to-buffer call cider-jack-in

dpsutton 2021-02-16T05:23:20.302900Z

or if you think those are sensible defaults you could just set them in your config

jumar 2021-02-16T08:18:50.303Z

Yeah, I'm using 27# monitor and Cider alwasys considers it "tall" enough to split horizontally

jumar 2021-02-16T08:19:32.303900Z

Is there a way to switch the REPL buffer to a more leightweight mode (something like Fundamental) to improve performance, especially when writing a lot of text into the buffer (like big data structures or logs)?

bozhidar 2021-02-16T08:50:16.304200Z

If you change the mode this will break everything in the REPL.

bozhidar 2021-02-16T08:51:42.305400Z

For logs I've long advised to be written to files instead of to the REPL, at least during development. At some point I wanted to implemented some output redirection logic, but this was hard to do in combination with streaming so I abandoned the idea.

1πŸ‘
bozhidar 2021-02-16T08:56:20.306200Z

One nuclear solution would be to redirect all output to some dedicated buffer, which you can achieve via cider-interactive-eval-output-destination.

bozhidar 2021-02-16T08:56:44.306700Z

In my mind that's better than switch the REPL mode, as it least it won't affect your REPL.

bozhidar 2021-02-16T08:57:19.307400Z

(But this works only on interactive eval output, as I thought it'd be weird if REPL output went to a different buffer)

bozhidar 2021-02-16T10:34:59.308600Z

I've cut a small update to clj-refactor today. Nothing fancy, but at least you'll be getting refactor-nrepl with all deps updated to their current versions.

1πŸ‘
jumar 2021-02-16T12:30:21.308800Z

Yeah, having a dedicated buffer would be great.

jumar 2021-02-16T12:31:05.309Z

I do this for DEBUG logs, but I want INFO and stdout in the REPL so it's right in front of me instead of having to reach out to the terminal, copying useful values from logs, etc.

gdanov 2021-02-16T12:40:47.310700Z

I just got the hunch that Cider does not integrate with imenu. After looking in the documentation and googling I'm convinced there's no integration. Is this correct?

gdanov 2021-02-16T12:41:33.310800Z

as a background: I've been using cider for 4 years and always rely on imenu or helm-imenu and always thought Cider provides the symbols

gdanov 2021-02-16T12:43:28.311Z

the repl buffer (and emacs) have problem with long lines. when you need to dump big structures always use pprint which splits them into separate lines

1πŸ‘
gdanov 2021-02-16T12:44:06.311200Z

as long as the lines are not too long 4-5 thousand lines within ~10secs are not an issue

gdanov 2021-02-16T12:44:31.311400Z

the nrepl also adds to the performance issues btw

dpsutton 2021-02-16T13:36:36.313Z

@jumar one thing you can do is just not subscribe to out. Makes the repl a little less good but if you’re drowning in logs it can make the experience pleasant