Fork me on GitHub
#conjure
<
2020-07-26
>
dominicm09:07:19

@nate fwiw, vim-jack-in can open the repl in tmux

dave12:07:10

I think it might even be able to figure out that it's inside tmux and use tmux automagically? I remember using vim-jack-in inside tmux and being pleasantly surprised that my REPL opened in a tmux window

dominicm07:07:50

It does, yep!

dave14:07:35

💯

uwo15:07:04

Is there a way to configure pretty printing at the moment? At first, I thought conjure was leveraging nrepl-middleware to print to the log buffer, but i haven't been able to do (set! nrepl.middleware.print/*print-fn* zprint.core/zprint) so perhaps not?

Olical15:07:03

It is indeed using nREPL for pprint

Olical15:07:07

One sec will check

Olical15:07:32

Conjure sends conjure.internal/pprint to the REPL on connection and sets nrepl.middleware.print/print for each eval

Olical15:07:54

I don't think you can just set the print-fn to any old fn, I think it has to have a certain signature

Olical15:07:11

:code (.. "(ns conjure.internal"
               "  (:require [clojure.pprint :as pp]))"
               "(defn pprint [val w opts]"
               "  (apply pp/write val"
               "    (mapcat identity (assoc opts :stream w))))")}

Olical15:07:21

So I think it needs to take value, writer and options map.

Olical15:07:45

Pretty sure if you don't meet that contract it silently fails and just falls through to a default?

Olical15:07:17

Including the zprint-pprint wrapper function?

uwo15:07:38

it's funny they give an example of setting print-fn and then afterwards explain the wrapper. sorry if the error is between the keyboard and computer here!

Olical15:07:19

Yeah, maybe the docs could be improved there :thinking_face: I remember being thoroughly confused when I was first implementing the print option at the nREPL message level

uwo15:07:21

I tried using the wrapper, but to no effect. None of the changes seem to affect the log printing

Olical15:07:30

:thinking_face:

Olical15:07:15

Not really sure what's going on right now but I'm off to cook some dinner, might be worth running it past #cider or #nrepl? I feel like it's more a problem with getting that config exactly right

Olical15:07:25

Oops I accidentally slipped and made it configurable on develop with g:conjure#client#clojure#nrepl#eval#print_function. Feel free to give that a go!

uwo15:07:44

Thanks, I'll give it a go!

uwo16:07:57

Thanks a bunch. I was able to get it to work with that configuration. I'll continue to investigate doing it with nrepl directly though, because I wouldn't want for you to add unnecessary configuration bloat if you don't have to!

Olical09:07:14

Nice! Glad to hear it! Should have it released this week too 😄