Fork me on GitHub
#cider
<
2016-05-27
>
myguidingstar04:05:13

basically I start cljs repl by typing (start-repl) in a clj repl

myguidingstar04:05:57

the problem is when I try to evaluate a cljs buffer, it yells ... needs a cljs repl

myguidingstar04:05:29

I guess it's b/c the repl is detected as clj

myguidingstar04:05:20

and the (start-repl) didn't change (of course it couldn't) the emacs buffer's info that it's become a cljs repl

myguidingstar04:05:28

how can I fix this?

richiardiandrea04:05:45

@myguidingstar: there was an issue open some time ago and I discovered that I did not configure cider (or nrepl cannot remember) correctly

myguidingstar04:05:31

hmm, I think I followed the instructions

myguidingstar05:05:39

Oh I remember hardcoding .cljs files

myguidingstar05:05:31

hmm, I used to do that, but no longer

myguidingstar05:05:43

so that's not the problem

malabarba06:05:07

> and the (start-repl) didn't change (of course it couldn't) the emacs buffer's info that it's become a cljs repl Actually, if you have the cider midddleware properly set up, it should detect the repl type automatically.

malabarba06:05:49

@myguidingstar: how do you start your repl?

pataprogramming13:05:27

Any known issues with cider 20160524.714? I just pulled new packages in Emacs and am now getting Wrong number of arguments: when-let, 1

pataprogramming13:05:39

That's when I do a cider-connect.

dpsutton13:05:02

what version of emacs are you running?

dpsutton13:05:38

I was just reading malabarba's blog and saw that when-let is a macro in emacs 25.1 and which is in prerelease.

dpsutton13:05:18

nah. they make sure its bound if its not already

pataprogramming13:05:17

Backtrace:

Debugger entered--Lisp error: (wrong-number-of-arguments when-let 1)
  signal(wrong-number-of-arguments (when-let 1))
  #[(&rest body) "^H\203\f^@^H\211A^P@\202^S^@\304\305\306^HGD\"\211^YG\307U\203#^@	\211A^Q@\202*^@\304\305\306	GD\"^z	@^[\310\n^KDC\311\n^HBBE+\207" [body --cl-rest-- var value signal wrong-number-of-arguments when-let 2 let when] 6 ("/home/pls/.emacs.d/elpa/scion-20130315.555/scion.elc" . 1787)](((port (and d (nrepl-extract-port (cider--file-path d))))) (list (file-name-nondirectory (directory-file-name d)) port))
  (when-let ((port (and d (nrepl-extract-port (cider--file-path d))))) (list (file-name-nondirectory (directory-file-name d)) port))
  (closure ((paths) (dir . "/home/pls/work/oboe/src/clj/oboe/") t) (d) (when-let ((port (and d (nrepl-extract-port (cider--file-path d))))) (list (file-name-nondirectory (directory-file-name d)) port)))("~/work/oboe/")
  mapcar((closure ((paths) (dir . "/home/pls/work/oboe/src/clj/oboe/") t) (d) (when-let ((port (and d (nrepl-extract-port (cider--file-path d))))) (list (file-name-nondirectory (directory-file-name d)) port))) ("~/work/oboe/"))
  (let* ((paths (cider--running-nrepl-paths)) (proj-ports (mapcar (lambda (d) (when-let ((port ...)) (list (file-name-nondirectory ...) port))) (cons (clojure-project-dir dir) paths)))) (seq-uniq (delq nil proj-ports)))
  cider-locate-running-nrepl-ports("/home/pls/work/oboe/src/clj/oboe/")
  (let* ((change-dir-p (file-remote-p default-directory)) (default-directory (if change-dir-p "~/" default-directory))) (cider-locate-running-nrepl-ports (if change-dir-p nil default-directory)))
  (if localp (let* ((change-dir-p (file-remote-p default-directory)) (default-directory (if change-dir-p "~/" default-directory))) (cider-locate-running-nrepl-ports (if change-dir-p nil default-directory))) (let ((vec (vector "sshx" nil host "" nil)) (dir (if (file-remote-p default-directory) (progn (let* (... ... ... ... ... ...) (ignore cur-method cur-user cur-host cur-localname cur-hop) (if ... ...)))))) (tramp-maybe-open-connection vec) (save-current-buffer (set-buffer (tramp-get-connection-buffer vec)) (cider-locate-running-nrepl-ports dir))))
  (let ((localp (or (nrepl-local-host-p host) (not (assoc-string host ssh-hosts))))) (if localp (let* ((change-dir-p (file-remote-p default-directory)) (default-directory (if change-dir-p "~/" default-directory))) (cider-locate-running-nrepl-ports (if change-dir-p nil default-directory))) (let ((vec (vector "sshx" nil host "" nil)) (dir (if (file-remote-p default-directory) (progn (let* ... ... ...))))) (tramp-maybe-open-connection vec) (save-current-buffer (set-buffer (tramp-get-connection-buffer vec)) (cider-locate-running-nrepl-ports dir)))))
  cider--infer-ports("localhost" (("core") ("zuul") ("xl2") ("xl1") ("xz2") ("xz1")))
  (cider--completing-read-port host (cider--infer-ports host ssh-hosts))
  (or (cadr sel-host) (cider--completing-read-port host (cider--infer-ports host ssh-hosts)))
  (let* ((ssh-hosts (cider--ssh-hosts)) (hosts (seq-uniq (append (if cider-host-history (progn (list ...))) (list (list (cider-current-host))) cider-known-endpoints ssh-hosts (if (file-remote-p default-directory) (progn (quote ...)))))) (sel-host (cider--completing-read-host hosts)) (host (car sel-host)) (port (or (cadr sel-host) (cider--completing-read-port host (cider--infer-ports host ssh-hosts))))) (list host port))
  cider-select-endpoint()
  call-interactively(cider-connect nil nil)
  command-execute(cider-connect)

pataprogramming13:05:58

Failure comes after hitting enter at the host prompt.

dpsutton13:05:28

i looked at the scion package, and it looks like both scion and cider define a when-let

pataprogramming13:05:57

Ah, I was just noticing that was an odd duck to see in this trace.

pataprogramming13:05:21

Well, I'm not doing much Haskell at the moment. I'll trying disabling it.

dpsutton13:05:23

and the scion one is simpler

dpsutton14:05:01

i think it can only take a single binding whereas the traditional when-let can take a seq of them and only invoke its clause when all are bound

dpsutton14:05:43

yeah, that seems to be what's up.

pataprogramming14:05:08

Yep, that did it.

malabarba14:05:36

Would be nice to report this to them 😉

dpsutton14:05:08

@malabarba: nice articles on upcoming features. read it this morning and already put the knowledge to use

danielsz20:05:18

@adamfrey: Same here. I get this error as well.

danielsz20:05:16

Did you discover anything new?

adamfrey20:05:40

no. you can use M-x toggle-debug-no-error and you can get an elisp stack trace that shows the path to that error, but I haven’t gotten the chance to look into it yet

danielsz20:05:14

@adamfrey: I did that. It seems to be related with company mode, in particular the company-capf backend. Do you remember when the problem started? What version of cider started to display this behavior?

adamfrey20:05:05

I update my snapshot pretty frequently, and I changed to using company mode recently, so I don’t know when it appeared

danielsz20:05:45

OK, I'm filing an issue, I guess

danielsz20:05:16

@adamfrey: Please feel free to add your own observations.