Fork me on GitHub
#cider
<
2018-01-10
>
richiardiandrea00:01:53

ups, is the function cider--get-repl-buffer gone in CIDER? will verify my claim

bozhidar07:01:50

Guess it’s not. 🙂

bozhidar07:01:27

@arrdem No idea if this is feasible or not. If someone has seen some mode doing it we can certainly borrow some inspiration from there.

rickmoynihan12:01:07

What’s the best way to do the equivalent of (set! *print-length* 16) on connection with cider?

rickmoynihan12:01:06

should I add a cider-connected-hook?

rickmoynihan12:01:36

ok following seems to work:

(add-hook 'cider-connected-hook (lambda ()
                                    (cider-interactive-eval
                                     "(set! *print-length* 16)\n")))

dpsutton13:01:00

does it work? also don't need that newline in it

dpsutton13:01:23

ah, there are refresh functions that might work for you

dpsutton13:01:34

i'm not sure if the initial before refresh function is run at start up?

rickmoynihan13:01:47

yeah looks like it works

rickmoynihan13:01:03

there is a \n in there… or do you mean something else?

dpsutton13:01:35

yeah that's what i meant. but i was thinking of something other than cider interactive eval so i see why you did it

rickmoynihan13:01:53

well I’m asking because I was expecting there to be a better way (or a config option for this)

rickmoynihan13:01:09

so open to alternatives

dpsutton13:01:18

i was looking. there's a cider-refresh-after-fn that i was wondering was called on start up

dpsutton13:01:08

not sure if you use cider-refresh much, but maybe you could (setq cider-refresh-after-fn "(set! *print-length*16)") and then add a cider connected hook to eval that function. and then if you refresh it will be called again for you

rickmoynihan13:01:31

I do on some projects… guessing what you’re saying is that a refresh will reset the *print-length*

dpsutton13:01:33

yeah. there are pre and post hook functions on refresh. so if you set this as a post refresh function and then also call it at jack in you should have it at all times

dpsutton13:01:27

not sure if its just as good though, but there is cider-repl-pretty-print-width

bozhidar13:01:35

Isn’t it simpler to just use something like Lein’s :repl-options?

rickmoynihan13:01:51

@bozhidar: I have that set, but it doesn’t seem to be picked up in cider…

bozhidar13:01:55

Perhaps we can have those as defcustoms in CIDER and pass the to lein/`boot` on jack-in, if they support it.

bozhidar13:01:43

That’s odd - I thought this was something global for the REPL. After all it’s not like CIDER creates some different REPL.

rickmoynihan13:01:51

ahh there’s a syntax error in my profiles.clj

bozhidar13:01:08

File some ticket and let’s discuss how we can improve the situation there.

rickmoynihan13:01:10

I had :repl-options { *print-length* 100 }

rickmoynihan13:01:21

instead of having an inner :init

bozhidar13:01:35

So, this works now?

rickmoynihan13:01:51

yes it works 🙂

bozhidar13:01:02

Anyways, file some issue on the subject - we can certainly make this a bit more comfortable to set/change.