Fork me on GitHub
#cider
<
2020-05-18
>
g7s08:05:38

I am changing the :style/indent metadata on a macro defined in a .cljc file and cider is not picking it up. Is it caching it somewhere? I can't find out why is not seeing my updated metadata.. The var has the correct metadata (checked on REPL). Does anyone has any clue?

bozhidar09:05:26

CIDER’s generating some indentation rules for clojure-mode from that metadata, so I’m guessing something there is not getting properly updated. I don’t recall any caching, but I also don’t remember that part of the code well, as it has stayed more or less the same for years.

g7s09:05:00

Thanks @bozhidar I remember having this issue again in the past but somehow got fixed and I didn't bother finding out why. Maybe I will try turning it off and on again 😂

karol.wojcik12:05:45

Hi guys. I would like to bind some Emacs key to a clojure function:

(defn some-function-called-by-keybinding 
   [])
on keybidings pressed I would like the evaluation of the function be sent to repl (some-function-called-by-keybinding). Can someone please guide me how should I do it?

andrzej.fricze13:05:06

you can start with something like:

(defun clj-cmd ()
    (interactive)
    (with-current-buffer (cider-current-repl-buffer)
      (insert "(println {:clojure :data})")
      (execute-kbd-macro (kbd "<return>"))))

andrzej.fricze13:05:27

it should insert Clojure code into cider buffer

zdot10117:05:31

and this is why I love emacs 👀

ericihli18:05:15

I can't get Cider to evaluate forms in my REPL. I'm running (cider-connect-cljs (:host "localhost" :port 9000 :cljs-repl-type shadow))` and it's creating a session with a clj object instead of a cljs object. I think this is the cause because I think Cider searches for CLJS repls from (cider-repls :cljs) and that expression is returning "No :cljs REPLs in current session", but I'm stuck at what to do next. Any thoughts?

CIDER Sessions:

  1: code/video-series:localhost:9000
      linked-to: proj(~/code/video-series/)  
        objects: *cider-repl %s(clj)*  

ericihli19:05:36

I still don't know what was causing this, but I bumped clojurescript from 1.10.520 to 1.10.742 and shadow-cljs from 2.8.52 to 2.8.107 and now cider-connect is working.

frozenlock18:05:41

I'm connecting to a NREPL running on a Windows machine via Vagrant. It kinda works, but CIDER keeps throwing errors related to string-prefix-p

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  compare-strings(nil 0 0 "/home/frozenlock/Docsolver/master/apps/basil/agent/" 0 0 nil)
  string-prefix-p(nil "/home/frozenlock/Docsolver/master/apps/basil/agent/")
  #f(compiled-function (path) #<bytecode 0x1136b4d>)(nil)
  #f(compiled-function (elt) #<bytecode 0x1136b65>)(nil)
  mapc(#f(compiled-function (elt) #<bytecode 0x1136b65>) (nil nil nil nil nil))
  seq-do(#f(compiled-function (elt) #<bytecode 0x1136b65>) (nil nil nil nil nil))
  seq-find(#f(compiled-function (path) #<bytecode 0x1136b4d>) (nil nil nil nil nil))
  #f(compiled-function (system session) #<bytecode 0x1bdf7d5>)(CIDER ("libs/bundle:vagrant-machine:6666" #<buffer *cider-repl libs/bundle:vagrant-machine:6666(clj)*>))
  apply(#f(compiled-function (system session) #<bytecode 0x1bdf7d5>) CIDER ("libs/bundle:vagrant-machine:6666" #<buffer *cider-repl libs/bundle:vagrant-machine:6666(clj)*>))
  sesman-friendly-session-p(CIDER ("libs/bundle:vagrant-machine:6666" #<buffer *cider-repl libs/bundle:vagrant-machine:6666(clj)*>))
I think it's related to this part of the code https://github.com/clojure-emacs/cider/blob/93ff91a1d79ba3094a50a7b01700b02d720e14b8/cider-connection.el#L472 Does it ring any bell?

bozhidar19:05:08

@frozenlock Yeah, seems that path is not something CIDER expects. It’s best to file some ticket for this.

bozhidar19:05:53

I’m happy to report that I finally came up with a simple fix for https://github.com/clojure-emacs/cider/issues/1971 and https://github.com/clojure-emacs/cider/issues/2628. It took me a while, but it gets the job done and adds almost no complexity.

frozenlock19:05:55

@bozhidar Ok, thank you