Fork me on GitHub
#cider
<
2018-02-11
>
bozhidar05:02:39

@doglooksgood Why do you want to do this?

tianshu07:02:09

emacs lisp debugger do like this, I think it's good. the commands in debugger are all single key command, if I press a wrong key, the buffer will change.

bozhidar12:02:57

I see your point. We’ve borrowed a lot of the design from Edebug, but I don’t recall how exactly did we came to the current state of affairs. I have some vague memory that in the beginning this was working more or less like edebug, but we ha some reason to change this. @malabarba might remember more and there might also be something in the commit logs.

zalky17:02:47

Hi, does anyone know how to turn off the printing of namespaced maps in the cider repl? I've tried the following hack recommended elsewhere, and it seems inconsistent:

(defmethod print-method clojure.lang.IPersistentMap
  [m, ^java.io.Writer w]
  (#'clojure.core/print-meta m w)
  (#'clojure.core/print-map m #'clojure.core/pr-on w))
Is there a way to configure what bindings the cider repl re-binds? Specifically *print-namespace-maps*? I find they make the output really difficult to read.

dpsutton17:02:33

i don't believe that CIDER has anything to do with this. it certainly isn't formatting the output once it comes back from the middleware. in a clojure 1.9 project, both lein repl and CIDER act the same:

{:a/a 1 :a/b 2}
; ==> #:a{:a 1, :b 2}

dpsutton17:02:25

probably best to ask in #clojure or #clojure-dev

dpsutton18:02:22

also

clj -e "{:a/a 1 :a/b 2}"
#:a{:a 1, :b 2}

zalky18:02:33

@dpsutton: thanks for the response. I was aware of *print-namespace-maps*, and I guess my problem is that I don't know how to prevent what the doc-string says, which is that the repl re-binds it to true. I thought that maybe in cider there is some control over this, though I admit I don't have great insight into how cider and the repl work together.

zalky18:02:52

Otherwise, I'm not sure where else the point of control would be to prevent the repl from doing this, or to just re-binding it back to false.

dpsutton18:02:37

might be able to use this var

(defcustom cider-connected-hook nil
  "List of functions to call when connected to Clojure nREPL server."
  :type 'hook
  :group 'cider
  :package-version '(cider . "0.9.0"))

dpsutton18:02:40

i'm guessing its pretty low down that it gets rebound to true by the repl (out of CIDER's control) and you would just need to rebind to false manually

zalky18:02:56

Hmm, thanks for the help, I assume the above hook loads elisp fns, and I'd have to figure out how to load clojure code?

dpsutton18:02:57

correct. her's an example from cider-create-sibling-cljs-repl (the callback to startup that creates the second repl for cljs

(cider-nrepl-send-request
       `("op" "eval"
         "ns" ,(cider-current-ns)
         "code" ,cljs-repl-form)
       (cider-repl-handler (current-buffer)))

dpsutton18:02:16

and here "code" would just be whatever form sets the dynamic var to false

dpsutton18:02:00

check out cider-interactive-eval

zalky18:02:47

Awesome, thanks, this is a great option if I can't figure out an more idiomatic way to set *print-namespace-maps* at outside cider.

dpsutton18:02:55

are you using lein? doesn't lein have some config for this as well?

zalky18:02:03

I'm using boot

zalky18:02:23

hmm, maybe that's another avenue

dpsutton18:02:29

i don't know boot well but my mental model of it makes me think you just put this form in one of your repl tasks

dpsutton18:02:51

ok if you are working in lein it looks like this option exists

:global-vars {*warn-on-reflection* true
                *assert* false}
for boot it should be pretty simple but i don't know

zalky18:02:46

Thanks for pointing me in the right direction!

dpsutton18:02:08

for sure. happy coding

dpsutton18:02:28

i think $BOOT_HOME/.profile.boot can handle this for you and make all of your projects behave as you want them

dpsutton18:02:42

and it won't add this to the repo to disturb other's workflow so its a win win

gganley18:02:07

I saw Alex amending a bunch of github repos with “deps.edn”. I assume that is for project depenedencies. Could anyone point me to a resource explaining this?