Fork me on GitHub
#cider
<
2017-09-08
>
richiardiandrea05:09:54

Hi folks! What is the binding/command I need for dumping the nRepl activity again (all the commands sent and received) ?

benedek07:09:50

nrepl-toggle-message-logging ?

nooga12:09:26

I have auto complete in my repl but I don’t in clj files (clojure-mode), how do I find out why?

richiardiandrea14:09:26

@nooga C-h m should give you the list of all the active modes for a buffer

alpox15:09:25

Hi all! Has anyone encountered the problem that cider just doesn’t open a cider-repl buffer and also does not connect to the nrepl-server even though that one is running? (All after a call to cider-jack-in)

dpsutton15:09:50

is there anything in the *Messages* buffer?

alpox15:09:44

@dpsutton It ends with >Starting nREPL server via /Users/Elias/.local/bin/lein update-in :dependencies conj \[org.clojure/tools.nrepl\ \"0.2.12\"\ \:exclusions\ \[org.clojure/clojure\]\] -- update-in :plugins conj \[refactor-nrepl\ \"2.4.0-SNAPSHOT\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.15.1-SNAPSHOT\"\] -- repl :headless :host ::...

alpox15:09:50

After this is nothing

alpox15:09:04

And nothing more seems to come

dpsutton15:09:48

is there a buffer created *nrepl-server [project-name]*?

alpox15:09:59

yes that one is working

alpox15:09:06

It evaluated my file

dpsutton15:09:09

and nothing in there giving any info?

alpox15:09:20

Only a warning about something in my code

alpox15:09:54

>WARNING: or already refers to: #‘clojure.core/or in namespace: clojure-org.visualization.svg, being replaced by: #‘clojure-org.visualization.svg/or

alpox15:09:02

From some testing around - i redefined or as macro

dpsutton15:09:06

yeah that's not blocking this. hmm

dpsutton15:09:21

do you have a lein profiles file or anything?

dpsutton15:09:32

is this recent or have you been using cider for a while?

alpox15:09:50

Yes i do but its only {:user {:plugins [[lein-exec "0.3.6"]]}}

alpox15:09:41

I have been using cider for a while - it stopped working today after i tried out some code, mainly trying to get data from google/bing through slurp - working through clojure for the brave and true atm.

dpsutton15:09:29

after you tried out some code?

alpox15:09:45

Seems weird but yes

dpsutton15:09:52

elisp or clojure?

alpox15:09:56

(defn google-search-url
  [term]
  (str "" term))

(defn bing-search-url
  [term]
  (str "" term))

(defn search
  [term]
  (doseq [url [google-search-url bing-search-url]]
    (let [result (promise)]
      (future (if-let [answer (slurp (url term))]
                (deliver result answer)))
      @result)))

(search "golf")

alpox15:09:04

I ran this clojure code in the repl and after that cider broke

alpox15:09:17

And i couldn’t get it to work anymore with reinstalling everything, restart… etc.

alpox15:09:50

I somehow don’t think that the code could have broken cider - its just when it happened somehow

dpsutton15:09:03

yeah it looks innocent enough

dpsutton15:09:05

do you have any java processes running?

alpox15:09:14

Not that i recall, no

dpsutton15:09:16

can you kill any you see and then try jacking in again

alpox15:09:25

The only things running are chrome, terminal, slack and emacs

dpsutton15:09:13

are you able to crank up a lein repl outside of cider?

dpsutton15:09:20

maybe things are borked lower than we are looking?

alpox15:09:50

I just killed all processes which are not crucial and tried again - to no avail.

alpox15:09:56

Do you think it could be something OSX specific?

alpox15:09:05

Yes lein repl runs nicely in terminal

dpsutton15:09:05

have you nuked CIDER and reinstalled/

alpox15:09:00

Inside, emacs, yes, i did

alpox15:09:18

I once even threw out the whole emacs configuration with all packages and reinstalled everything

alpox15:09:00

This bugs me a little that that didn’t even work ^^

alpox15:09:44

I would like to see at least an error message somewhere - but i’m not familiar enough with emacs yet to find any 😄

dpsutton15:09:12

(shell-command "lein repl") can you try that? is it possible that emacs can't see lein on your path?

alpox15:09:46

Hmm where can i try that command? (Sry, really not so familiar with emacs)

alpox15:09:57

Should i just put it in the config?

dpsutton15:09:29

no, you can eval arbitrary emacs lisp by M-:

dpsutton15:09:38

it'll ask you for the input in the minibuffer

dpsutton15:09:49

or just (cider--lein-resolve-command)

dpsutton15:09:54

to see if its on your path

alpox15:09:31

I’ll try it 🙂 just my emacs is stuck atm

dpsutton15:09:01

sorry to hear that. i know that's frustrating

alpox15:09:22

Well it stuck after the shell command 😄 i guess lein repl was running in the background and held the process

alpox15:09:49

Yea its on the path

alpox15:09:56

(cider--lein-resolve-command) found it

dpsutton15:09:03

have you ever debugged emacs lisp code?

alpox15:09:28

Not really 😄 i have not written any either except some small configurations

dpsutton15:09:35

that's fine. it'll be straight forward

dpsutton15:09:40

and i have a suspect in the code

dpsutton15:09:49

(when-let ((repl-buff (cider-find-reusable-repl-buffer nil project-dir)))
                    (let ((nrepl-create-client-buffer-function  #'cider-repl-create)
                          (nrepl-use-this-as-repl-buffer repl-buff))
                      (nrepl-start-server-process
                       project-dir cmd
                       (when cljs-too #'cider-create-sibling-cljs-repl))))

dpsutton15:09:10

that's a part of the cider-jack-in function. and if that when-let isn't satisfied, it would just error out

dpsutton15:09:26

so my guess is that emacs isn't finding a repl buffer and there's no code for that case

alpox15:09:58

Hmm but that used to work before and it started a repl buffer

alpox16:09:08

So i wonder why it should suddenly be broken

alpox16:09:23

Anyways, how can i debug this?

dpsutton16:09:36

it's easy to instrument emacs lisp

dpsutton16:09:15

to evaluate elisp you run C-M-x. To debug it you instrument it with C-u C-M-x (the prefix in emacs lingo)

dpsutton16:09:47

and when you run cider jack in, it'll bring you to the emacs code with a little mark where evaluation is and you can hit n for next, c for continue, etc

alpox16:09:17

Hmm i cannot really use any C-M commands, because on my mac, the meta key is somehow broken 😄 i use spacemacs with SPC-something-something

alpox16:09:24

Do you know the names of these commands?

dpsutton16:09:02

eval-defun with a prefix argument

alpox16:09:55

When i run cider jack in it doesn’t sadly bring me to any code 😕

dpsutton16:09:27

navigate to it

dpsutton16:09:36

there may be a mark showing that youre in the debugger

dpsutton16:09:57

find-function and then cider-jack-in will navigate right to it

alpox16:09:17

I don’t get to the code o.O >condition-case: Symbol’s value as variable is void: helm-bookmark-map

dpsutton16:09:02

can you navigate to the cider.el buffer in the cider package?

dpsutton16:09:07

i don't know what's going on with your emacs

alpox16:09:16

Me neither

alpox16:09:29

But i’ve seen Symbol's value as variable is void quite some times now >.<

alpox16:09:39

Okay i found cider-jack-in

dpsutton16:09:51

run eval-buffer on this file

dpsutton16:09:18

have you installed any packages recently?

alpox16:09:28

Well, all packages i use, yes 😄

alpox16:09:36

Because i reinstalled them all

dpsutton16:09:43

any new ones recently?

dpsutton16:09:54

around the time this stopped working?

alpox16:09:55

No, they are stable since some time

alpox16:09:03

But it stopped working today

dpsutton16:09:11

but either way after evaling the file, try cider jack in now

alpox16:09:29

No wait, it was yesterday… but i didn’t add any packages

alpox16:09:06

I did, to no avail 😞

dpsutton16:09:58

ok. now that you know where cider-jack-in is defined, want to try debugging it again?

dpsutton16:09:23

or if you want you can print debug it but putting (message "some message here") and it will print them for you

alpox16:09:12

I put it in when-let and it shows in the message buffer after cider-jack-in

alpox16:09:23

Seems to be working so far

alpox16:09:00

I wonder what

(let ((nrepl-create-client-buffer-function  #'cider-repl-create)
      (nrepl-use-this-as-repl-buffer repl-buff))

are for. These variables don’t seem to be used

dpsutton16:09:50

dynamic vars. used lower down the call stack

alpox16:09:05

Ouch that sounds dangerous

michaelwfogleman17:09:15

@magnars @dpsutton @jumar I filed an issue because this has also affected me, please pipe in to add details if needed 🙂 https://github.com/clojure-emacs/cider/issues/2084

alpox17:09:04

@dpsutton i dropped it for now - going to take another try on time. I hope i don’t have to switch the editor because of this

dpsutton17:09:16

For sure. Sorry we couldn't get it right now