Fork me on GitHub

I use :repl-options :init in my ~/.lein/profiles.clj like so:


    {:init (do (set! *print-length* 500)
               (set! *print-level* 10))}}}

Drew Verlee01:12:10

When i run cider-jack-in from spacemacs, its seems to be reading a different file then my .lein/profiles.clj. Any idea how i can figure out what the location of the file is?


cider doesn't read that file at all. lein should read that file


what makes you think that the wrong one is being read?


ie, what symptoms are you seeing


and does it read the correct one if you just run lein repl?

Drew Verlee01:12:12

hmm. What i’m seeing is when i run cider-jack-in. There is a some string output at the bottom of the screen that has what looks like information from a profiles.clj. Only it doesn’t have the same versions as are in my ~/.lein/profiles.clj. I haven’t had to look into this before so i have been happy ignorant.


can you post the string? that's not sounding familiar


and if you run lein deps :tree does it output the correct versions?


it should be in the *Messages* buffer. what is the wrong version?

Drew Verlee01:12:42

This version in my ~/.lein/profiles.clj is [cider/cider-nrepl “0.16.0-SNAPSHOT”]. That one is 0.15. Whats troubling me is more that i can’t jack-in at all. When I try, i’m meet with a long wait an exception about like this:

java.lang.RuntimeException: Unable to resolve var: cider.nrepl.middleware.test/wrap-test in this context
I poked around and this problem seems to be resolved on later versions or cider.


if you are using cider-jack-in, it manages its own dependencies so you don't need to specify one. have you updated cider in emacs? it always brings in the version of cider-nrepl that matches itself


and these should basically always go in lockstep

Drew Verlee01:12:06

i’m on Cider 0.15snapshot and emacs 24.5 on spacemacs release 0.200.9 . Not sure thats relevant. I don’t recall manually messing with cider. I’m only having this issue on my mac, my desktop works fine. I recall trying to do a clean install of spacemacs, which i assume includes Cider and it not resolving the issue (repl not connecting, the above error message). To make things more confusing (to me) the error only appears in certain clojure projects.

Drew Verlee01:12:33

im going to figure out how to get the message buffer, as that might help.


i'm still not following. why are you specifying a cider-nrepl version at all

Drew Verlee01:12:02

in my profiles.clj?


and it looks like this works in clojure 1.8 and not clojure 1.9


it was an abuse of the reader in 1.8 that no longer worked in 1.9


you should be able to upgrade cider and it will work


as far as I'm aware, you don't need to specify either cider-nrepl or refactor-nrepl anywhere. cider will take care of them


im sorry you're running into these issues 🙂


if you are using cider-jack-in. if you are using cider-connect, then it is just connecting to an existing repl and you have to make sure the middle ware are there yourself. does that make sense?


recent versions should be 0.16-snapshot which will get the cider-nrepl version automatically


here's a ticket about what I think is happening to you

Drew Verlee01:12:16

Yes. Though i need a better mental model for the REPL at some point. In your past message you said that if i upgrade cider then it should correct the problem (a symtom of which is the NullPointer Exception).


so here's how it works


when you say cider-jack-in, cider will crank up lein and make sure the right nrepl middlleware are present


and it just dictates a version of cider-nrepl that matches itself


so if you have cider 0.15, it asks for cider-nrepl 0.15


and 0.15 nrepl has a bug in it so if you get a newer cider it will ask for a newer cider nrepl


sorry it's so confusing but it's trying to "do what you need"


And the symptom you are seeing is it not knowing what a function is (wrap-test) because that code has invalid syntax in clojure 1.9

Drew Verlee01:12:03

I updated everything and i’m connected. 🙂


Awesome! Glad it worked and sorry it was a pain

Drew Verlee01:12:20

Well, i’m fairly sure i got myself into that mix. There was an issue with my emacs config so it wasn’t updating. Actually, what confused me the most was that when i went to update emacs i thought it was saying i was already on the latest version.

New To Clojure17:12:24

Is there a way to have different highlighting of function and macros names?


based on `cider-mode.el line 597:

,@(when macros
          `((,(concat (rx (or "(" "#'")) ; Can't take the value of macros.
                      "\\(" (regexp-opt macros 'symbols) "\\)")
             1 (cider--unless-local-match font-lock-keyword-face))))
      ,@(when functions
          `((,(regexp-opt functions 'symbols) 0
             (cider--unless-local-match font-lock-function-name-face))))


it looks like macros get font-lock-keyword-face and functions get font-lock-variable-name-face. so there are two different ones for them


in the theme i'm using, brin, these are defined and can be adjusted


and these can be modified in the source they are defined in or in M-x customize-group faces, custom faces


that's really confusing looking elisp in the cider font lock compile function


feel free to look at that source to see what other faces are used


cider--compile-font-lock-keywords and emacs should let you jump there with C-h C-f