Fork me on GitHub
#cider
<
2017-06-09
>
jsa-aerial00:06:35

You can jump to source of function from a call site easy enough, but is there a 'find all call sites' of a function?

dominicm07:06:44

jsa-aerial: in refactor el there is

jsa-aerial17:06:13

cljr-find-usages seems to be it, is that what you meant?

danieleneal10:06:26

Is there any simple thing I'm missing that would explain why cider-pprint-eval-last-exp prints in one long line to the repl. I'm using spacemacs....cider 0.15-SNAPSHOT

dpsutton11:06:57

what are you trying to print @danieleneal

danieleneal12:06:08

comes out like this:

dpsutton12:06:36

that's not the repl. i think pprint-last-sexp will pretty print in the repl

dpsutton12:06:11

but it for sure should pretty print it

dpsutton12:06:14

looking into it now

dpsutton12:06:47

can you tell me what your value for fill-column is?

dpsutton12:06:55

(defun cider--pretty-print-width ()
      "Return the width to use for pretty-printing."
      (or cider-repl-pretty-print-width
          fill-column
          80))

dpsutton12:06:15

you can check those values and see if they affect your results

danieleneal12:06:07

#("fill-column is a variable defined in ‘C source code’.
Its value is 80
Original value was 70

danieleneal12:06:39

#("cider-repl-pretty-print-width is a variable defined in ‘cider-repl.el’.
Its value is nil

dpsutton12:06:08

can you navigate to cider--pprint-eval-form?

dpsutton12:06:20

in that defun, there's a form (cider--nrepl-pprint-request-plist (cider--pretty-print-width))

dpsutton12:06:23

see what that results

dpsutton12:06:10

("pprint" "true" "pprint-fn" "clojure.pprint/pprint" "print-right-margin" 80)

danieleneal12:06:29

mm mine is exactly the same

dpsutton12:06:18

well let me see if it works for me. i was assuming it does since the repl pprinting does, but i haven't actually checked

danieleneal12:06:42

ah cool thanks!

danieleneal12:06:23

it's my favourite way of looking at a form C-c C-p bang boom there it is

dpsutton12:06:04

can you C-c C-p this form? (into {} (map (fn [k v] [k v]) (range 0 13) (range 0 13)))

dpsutton12:06:15

that for me was printed on several new lines

danieleneal12:06:30

mm that was printed on one line for me. How strange

dpsutton12:06:39

cljs by any chance?

dpsutton12:06:44

forgot from your screenshot

danieleneal12:06:57

I'm just restarting spacemacs

danieleneal12:06:07

mm still the same

dpsutton12:06:50

i'm never sure of people's proficiencies here. do you know how to debug elisp code?

danieleneal12:06:23

haha sadly not at all I can just about manage to set a variable in emacs but that's about it

dpsutton12:06:55

sounds good

dpsutton12:06:02

i'm still looking

dpsutton12:06:34

shot in the dark

dpsutton12:06:49

so you told me the value of fill-column but it can be different by buffer

dpsutton12:06:09

can you go to the results buffer where you expect it to be pretty printed and tell me the value of fill-column there?

dpsutton12:06:22

in emacs parlance its a buffer-local var

dpsutton12:06:55

hypothesis is that when you're getting that popup buffer, its value is either nil or really large

danieleneal12:06:37

hmmm fill column still 70 in that buffer

dpsutton12:06:24

let's see if this stuff is working in the repl

dpsutton12:06:05

you can enable [spc] [spc] cider-repl-toggle-pretty-printing

dpsutton12:06:14

i think space space is spacemacs for M-x

dpsutton12:06:21

let's just see if the repl is pretty printed

dpsutton12:06:02

examples.exploring> (into {} (map (fn [k v] [k v]) (range 0 13) (range 0 13)))
{0 0, 7 7, 1 1, 4 4, 6 6, 3 3, 12 12, 2 2, 11 11, 9 9, 5 5, 10 10, 8 8}
examples.exploring> (into {} (map (fn [k v] [k v]) (range 0 13) (range 0 13)))
{0 0,
 7 7,
 1 1,
 4 4,
 6 6,
 3 3,
 12 12,
 2 2,
 11 11,
 9 9,
 5 5,
 10 10,
 8 8}

dpsutton12:06:12

these are my "before" and "after" toggling that feature

danieleneal12:06:51

ahh it has no effect even there

dpsutton12:06:02

well that's some useful information

dpsutton12:06:29

you're working with ouroborous

dpsutton12:06:37

doesn't that do a lot of funky stuff with jvm internals?

danieleneal12:06:48

haha sorry this is just the name of my current clojure project using as a scratchpad, I've noticed this in all my projects

dpsutton12:06:35

i had it confused with something else

dpsutton12:06:53

when you jack-in, do you get a warning that cider and cider-nrepl versions don't match?

danieleneal12:06:06

just jacking out

danieleneal12:06:31

so I can jack in again

danieleneal12:06:47

hmm no messages like that

dpsutton12:06:38

does your project use spec?

danieleneal12:06:41

thanks for your help by the way, I think I've used up my quota of free assistance by now 🙂

dpsutton12:06:54

i've got a little more time until i need to go if you want to try a few more things

danieleneal12:06:24

if you have any thoughts about what it could be that would be cool

danieleneal12:06:28

but no pressure

dpsutton12:06:37

i'm wondering if dropping clojure down to 1.8 might resolve it

dpsutton12:06:44

maybe there's an issue with cider and 1.9

danieleneal12:06:49

I'll have a quick go

dpsutton12:06:00

that's why i was asking about spec. if you've got it in there 1.9 won't work

dpsutton12:06:35

but you could crank a repl either way and try our little map function

danieleneal12:06:12

oh weird, cider-jack-in is opening up a clojure 1.9.0-alpha16 project even though project is 1.8.0

danieleneal12:06:55

I had [venantius/ultra "0.5.1"] in my plugins

danieleneal12:06:58

I've taken that out

danieleneal12:06:46

It was that mismatched clojure version that indicated something weird was going on there

danieleneal12:06:54

Thanks so much

dpsutton12:06:22

a plugin was breaking it?

danieleneal12:06:52

I commented it out, jacked in again and the clojure version matched and it started working

dpsutton12:06:07

without the plugin, if you jack in with clojure 1.9 can you pretty print?

danieleneal12:06:12

will just try

dpsutton12:06:10

ok. it looks like that lib tries to do its own pretty printing

dpsutton12:06:17

i wonder if there was an epic battle going on there

danieleneal12:06:23

yeah it works with 1.9 too

danieleneal12:06:41

haha "STEP ASIDE LIBRARY I SHALL TAKE CARE OF THE PRETTY PRINTING HERE"

dpsutton12:06:06

ok so it was just those two jockeying for who was prettier

dpsutton12:06:23

it looks like that lib is useful on a bare repl but maybe not so much in CIDER

dpsutton12:06:26

can't tell though

dpsutton12:06:37

either way it seems we've tracked it down

dpsutton12:06:45

maybe open an issue with them?

danieleneal12:06:50

cool, thanks again, so glad to have that sorted, it was one of those little things that was a daily irritation but not big enough to look into

dpsutton12:06:01

happy coding!