2
votes

Since I updated cider on my emacs a couple of days ago to CIDER 0.6.0alpha (package: 20140318.1539) I have not been able to run cider-jack-in.

If I try M-x cider-jack-in, I get the following error on the message buffer

 Wrong type argument: stringp, nil

If I run the command from a lisp buffer I get the following backtrace

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  find-file-name-handler(nil file-remote-p)
  file-remote-p(nil)
  start-file-process-shell-command("nrepl-server" "*nrepl-server*<2>" "lein repl :headless")
  cider-jack-in()
  eval((cider-jack-in) nil)
  eval-last-sexp-1(nil)
  eval-last-sexp(nil)
  ad-Orig-call-interactively(eval-last-sexp nil nil)
  call-interactively(eval-last-sexp nil nil)

Looking at the source in the debugger shows that the code for start-file-process-shell-command calls file-remote-p a couple of times with default-directory as its argument.

Now, I'm not sure if this is useful, since I'm getting way out of my depth here. But If I try and evaluate default-directory on the source buffer it returns a non-nil value ("/usr/share/emacs/24.3/lisp/").

I tried wiping out my .emacs.d directory and reinstalling cider and clojure mode, but I still get the same problem, and I have not seen any other thread talking about this specific behavior on the cider github page. So it looks like it's somehow related to my environment.

Any help on how to troubleshoot this issue would be greatly appreciated.

Santi.

1
try to open project file first C-x C-f (src/abcd/core.clj) and then run cider-jack-in C-c M-jedbond
That worked. Now I'm confused. If you asked me before your comment whether I had a leiningen project file open when calling cider, I would have said no. I'm almost certain that I could call cider-jack-in while visiting any clojure file. But then again, I could be wrong.Santino
I think you need to have an opened file of a leiningen project before calling cider-jack-in. Another option to manually run lein repl and connect to it using cider function in emacs and specifying host and port.edbond
I'm cider's maintainer. cider-jack-in doesn't actually require a lein project (just the presence of the lein command). It seems we introduced a regression when we added the ability to do cider-jack-in over tramp. Please, report an issue so I won't forget to fix this.Bozhidar Batsov

1 Answers

6
votes

You were affected by a regression introduced with the addition of the cider-jack-in over tramp feature (commit). I've just fixed the problem here.

In future you'd do better to report problems on the project's issue tracker. You're lucky I'm on stackoverflow as well. :-)