Fork me on GitHub
#cider
<
2016-04-27
>
bozhidar01:04:26

did you restart Emacs after doing the package update?

bozhidar01:04:04

@plexus: eldoc is not enabled by default, but just enabling eldoc-mode works out of the box now

bozhidar01:04:12

that’s why we dropped the custom function

bozhidar01:04:37

established practices for the win simple_smile

niquola12:04:38

Hi all, is there some magic config to show ClojureScript/JS exceptions in emacs when evaling expressions by piggyback?

rmuslimov12:04:03

@nicola sorry, I didn’t get that, can you please explain the problem by example?

jonpither12:04:11

Is there a way to prevent closing parens being on their own line? Want to have it automatically enforced.

niquola12:04:08

@rmuslimov: For cljs i see exceptions in repl, but not in error popup (like in clojure)

niquola12:04:05

So i eval expression, awaiting for result, but nothing happens if exception - it would be nice to see red colored popup.

rmuslimov12:04:06

I see, have same behaviour here, actually I would like to make this working too simple_smile

xcthulhu13:04:42

Hey, I was wondering if someone could quickly point me to the font face for inline evaluation? I can't read it right since I'm using a white font

bozhidar14:04:23

@xcthulhu: M-x describe-face

bozhidar14:04:03

this particular face is cider-result-overlay-face

xcthulhu14:04:03

Cool, I'll go hack it and make sure it makes the font black

aaelony17:04:50

arghh, it happened again. I switched to another machine with an existing cider version, removed the ~/.emacs.d dir, pointed to melpa, refreshed packages, and installed cider 12. The repl won't start cider-jack-in though, reporting "Cannot open load file: no such file or directory, cl-generic". This is using Emacs 25.0.50.1. What is the best way to "start fresh" with cider 12?

aaelony18:04:33

it's mostly stating: cider-apropos.el:28:1:Error: Cannot open load file: no such file or directory, cl-generic

aaelony18:04:36

installing cl-generic succeeds but then attempting to install cider yields:

Package 'highlight-0' is unavailable 

aaelony18:04:06

ok, I removed emacs and reinstalled emacs. re-installed cider, and I get a cider repl now... with a warning that the cider version 0.12.0 does not match cider-nrepl's version (nil). Things will break! No hunting around for where in the heck to set cider-nrepl version (thought I didn't need that..)

aaelony18:04:47

ok, nuked all ~/.emacs.d/elpa dirs related to clojure and cider and re-installed, this time via package-list-packages, now everything works again. Maybe there is something weird with package-install, which didn't work for me. All good now.

aaelony18:04:07

huh. Despite the cider repl, it does still say

|WARNING: CIDER's version (0.12.0) does not match cider-nrepl's version (nil). Things will break! 
how to fix that? I don't set that anywhere at all.. http://cider.readthedocs.org/en/latest/installation/ doesn't seem to help

dpsutton18:04:05

@aaelony: what version of clojure is specified in the project?

dpsutton18:04:16

this error appears when a clojure < 1.7 is used in cider 0.12

aaelony18:04:27

[org.clojure/clojure "1.8.0"]

aaelony18:04:41

lein did that

dpsutton18:04:33

lein did what?

aaelony18:04:43

lein chose the version of clojure

aaelony18:04:49

via lein new

aaelony18:04:10

Leiningen 2.6.1 on Java 1.8.0_20 Java HotSpot(TM) 64-Bit Server VM

dpsutton18:04:28

can you post the project.clj file here?

aaelony18:04:38

sure, it's rather bare

aaelony18:04:56

(defproject mapviz "0.0.1-SNAPSHOT"
  :description "FIXME: write description"
  :url ""
  :license {:name "Eclipse Public License"
            :url ""}
  :dependencies [[org.clojure/clojure "1.8.0"]
                 [rhizome "0.2.5"]
                 ]) 

dpsutton18:04:36

ah. i think i might know what's up

xcthulhu18:04:43

rhizome is using Clojure 1.6.0

dpsutton18:04:44

rhizome requires clojure 1.6

aaelony18:04:45

is it rhizome?

aaelony18:04:58

let me remove it and see

xcthulhu18:04:03

Yeah, you need to exclude the clojure that project ropes in

dpsutton18:04:03

i'm not sure what the resolution is when multiple versions of clojure are specified

dpsutton18:04:18

i raised an issue on that with zach to update it but I haven't heard anything back

dpsutton18:04:23

all of the tests pass with clojure 1.8

dpsutton18:04:45

you could create a pull request for him against clojure 1.8

aaelony18:04:54

If I remove rhizome I still get the cider warning though...

xcthulhu18:04:06

[rhizome "0.2.5"] => [rhizome "0.2.5" :exclusions [[org.clojure/clojure]]]

aaelony18:04:24

I've tried:

(defproject mapviz "0.0.1-SNAPSHOT"
  :description "FIXME: write description"
  :url ""
  :license {:name "Eclipse Public License"
            :url ""}
  :dependencies [[org.clojure/clojure "1.8.0"]
                 ;; [rhizome "0.2.5"]
                 ]) 

aaelony18:04:30

maybe I'll delete it entirely

dpsutton18:04:35

don't worry about that

dpsutton18:04:39

how did you restart the repl

dpsutton18:04:47

i'm guessing the artifiact is still laying around

aaelony18:04:02

just did lein clean and the cli

aaelony18:04:24

warning is still there

aaelony18:04:34

I don't think it is rhizome dependent

dpsutton18:04:44

can you restart emacs?

aaelony18:04:55

I've done so (many times)

dpsutton18:04:06

since you removed the rhizome dependency?

xcthulhu18:04:10

Hmm... I wonder what # ls -d ~/.emacs.d/elpa/*cider* says at the CLI

xcthulhu18:04:22

Maybe you have an old version of CIDER kicking around

aaelony18:04:27

wait... the require was still pointing to rhizome... my bad

aaelony18:04:24

nope still gives the warning. project.clj contains only clojure 1.8.0 and the core.clj file contains (ns mapviz.core), and nothing else

aaelony18:04:46

;; Connected to nREPL server - 
;; CIDER 0.12.0 (Seattle), nREPL 0.2.12
;; Clojure 1.8.0, Java 1.8.0_20 

aaelony18:04:59

WARNING: CIDER's version (0.12.0) does not match cider-nrepl's version (nil). Things will break! 

xcthulhu18:04:43

I'm sorry this is so painful dude. Have you tried upgrading JAVA?

aaelony18:04:43

before the connection I see:

Starting nREPL server via lein update-in :dependencies conj \[org.clojure/tools.nrepl\ \"0.2.12\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.12.0\"\] -- repl :headless... 

aaelony18:04:11

I could upgrade java, i guess...

xcthulhu18:04:16

Another idea might be to make sure that ~/.m2/repository/cider/cider-nrepl/ only has one subdirectory 0.12.0

xcthulhu18:04:34

And then wipe your ~/.emacs.d/elpa dir

xcthulhu18:04:10

(I had to program my .emacs.d to auto-detect whether to install stuff because I had to wipe that so many times)

aaelony18:04:15

wow that might be it!

$  ls -1 ~/.m2/repository/cider/cider-nrepl/
0.10.0-SNAPSHOT/
0.10.1/
0.11.0/
0.12.0/
0.2.7/
0.7.0/
0.8.1/
0.8.2/
0.9.1/ 

aaelony18:04:27

I'll nuke that stuff

xcthulhu18:04:11

Sounds like a good idea, all I've got in mine is 0.11.0 and 0.12.0

aaelony18:04:11

no change... 😞

aaelony18:04:33

Interesting though that it believes the version is nil...

WARNING: CIDER's version (0.12.0) does not match cider-nrepl's version (nil). Things will break! 

xcthulhu18:04:49

Where did you get CIDER? MELPA-Stable?

xcthulhu18:04:36

Okay so melpa-stable then

aaelony18:04:52

Opening TLS connection to `'...done 

aaelony18:04:41

there should be some kind of sanity clean everything mode before starting the install...

aaelony18:04:06

I guess I can upgrade java... but doubt that's it

aaelony18:04:18

I can easily get a repl via lein repl

dpsutton18:04:54

i ran into an issue like this and resolved it by edebug instrumenting cider-jack-in

xcthulhu18:04:57

I don't know things only started working for me with 0.12.0 last month I was in your boat

dpsutton18:04:18

step through the jack in function and see what's up

aaelony18:04:23

I've only had issues with boxes that had a previous cider install

aaelony18:04:33

each time it's something different

aaelony18:04:04

this is (now) from mac os 10.9.5

dpsutton18:04:06

particularly the middleware check

aaelony18:04:31

maybe a list of all the things to check...

xcthulhu18:04:38

Sorry buddy. I suppose this is a bridge too far, but here's my Makefile for my .emacs.d file where I wrote "install" to nail this dumb problem

xcthulhu18:04:21

I'd make sure lein and java are upgraded before diving into edebug

aaelony18:04:31

installed java 8 update 91

xcthulhu18:04:52

Hmm... lein --version ?

aaelony19:04:05

Leiningen 2.6.1 on Java 1.8.0_20 Java HotSpot(TM) 64-Bit Server VM

aaelony19:04:15

hmmm, I might have to select that java version

xcthulhu19:04:55

Another thought: try lein deps :tree in your virginal project

xcthulhu19:04:43

In particular if something is depending on tools.nrepl or cider-nrepl then you'll still have lein hit the wrong versions of things

aaelony19:04:00

I also have a ~/lein/profiles.clj that might be interfering...

{:user {:plugins [
                  [lein-ancient "0.5.5"]
                  [criterium "0.3.1"]
                  [http-kit/lein-template "1.0.0-SNAPSHOT"]
                  [lein-gorilla "0.3.4"]
                  [lein-try "0.4.3"]
                 ]
        }
 }

dpsutton19:04:18

the function cider--connected-handler is what sets up the communication. It calls (cider--check-middleware-compatibility) to check the compatibility. This is what prints the message that you are seeing. It may be worth your while to instrument the cider--check-middleware-compatibility function to see what it sees

aaelony19:04:11

still unchanged

xcthulhu19:04:19

aaelony: That might be doing it... what does lein deps :tree spit out?

aaelony19:04:03

after removing the ~/.lein/profiles.clj, it reports now:

$  lein deps :tree
 [clojure-complete "0.2.4" :exclusions [[org.clojure/clojure]]]
 [org.clojure/clojure "1.8.0"]
 [org.clojure/tools.nrepl "0.2.12" :exclusions [[org.clojure/clojure]]] 

aaelony19:04:13

clojure-complete??

xcthulhu19:04:33

One of your plugins I guess

aaelony19:04:04

I'm ok with nuking everything to start fresh

dpsutton19:04:04

can you jack-in without the dependenices?

dpsutton19:04:09

don't do that quite yet

dpsutton19:04:19

and even if you get the warning, jack in and run a command

dpsutton19:04:32

*clojure-version* or (clojure-version)

aaelony19:04:34

how to jack-in without dependencies?

dpsutton19:04:44

i meant removing the lein profiles thing

aaelony19:04:49

that's gone

dpsutton19:04:51

but just run a standard jackin

dpsutton19:04:04

criterium looks outdated. i checked their repo and they are on 0.4.4

aaelony19:04:24

I removed the ~/.lein/profiles.clj entirely

dpsutton19:04:34

ok. what's the result of jacking in now

aaelony19:04:36

then lein clean

aaelony19:04:56

the only dependency is :

:dependencies [[org.clojure/clojure "1.8.0"]]

aaelony19:04:19

same warning... WARNING: CIDER's version (0.12.0) does not match cider-nrepl's version (nil). Things will break!

dpsutton19:04:32

and what's the output of running (clojure-version)

aaelony19:04:42

user> *clojure-version*
{:major 1, :minor 8, :incremental 0, :qualifier nil}
user> (clojure-version)
"1.8.0"
user> 

aaelony19:04:30

tempted to remove then reinstall the packages for clojure and cider

aaelony19:04:20

just did

rm -rf ~/.emacs.d/elpa/
and about to re-install

aaelony19:04:26

thanks... repl is back with the same warning though...

aaelony19:04:52

okay, enough on this.. will have to pursue it later... 😞

dpsutton19:04:46

well i think it is time to edebug the functions i mentioned earlier

aaelony19:04:50

how would I edebug?

dpsutton19:04:43

just go to that function and C-u C-M-x

dpsutton19:04:20

then the next time the function is called it will let you step in

aaelony19:04:58

C-u M-x cider--connected-ha [No match] 

dpsutton19:04:58

however there isn't much in that function

dpsutton19:04:18

its not interactive so M-x shouldn't see it

dpsutton19:04:35

C-h C-f will navigate straight to it

dpsutton19:04:05

the function just takes values out of a dictionary

aaelony19:04:16

which function?

dpsutton19:04:30

cider-check-required-nrepl-version

dpsutton19:04:38

and check-middleware-compatibility

aaelony19:04:16

I'm confused...

user> (cider-check-required-version)
CompilerException java.lang.RuntimeException: Unable to resolve symbol: cider-check-required-version in this context, compiling:(*cider-repl mapviz*:44:6) 

dpsutton19:04:24

those are emacs functions

dpsutton19:04:28

you will be debugging cider

dpsutton19:04:36

you don't run these in clojure

aaelony19:04:42

I don't know elisp

dpsutton19:04:45

when you run cider-jack-in, these functions are called

aaelony19:04:19

I can read up on that, but I fear there is too much there to grok

dpsutton19:04:07

you should be able to just press n to keep stepping next and c to continue or q to quit

dpsutton19:04:23

it'll highlight the expression that its on and display the value. its actually quite nice and easy

aaelony19:04:26

from which starting point?

dpsutton19:04:08

i'm not sure i know what you mean

aaelony19:04:47

where and when should I press n to keep stepping next...?

dpsutton20:04:32

if you instrumented the function with C-u C-M-x then when you run cider-jack-in it will launch the debugger

aaelony20:04:36

I'm basically launching a bare lein project and launching cider, and seeing the warning. that's it.

aaelony20:04:18

I don't know what it means to "instrument a function"

dpsutton20:04:49

navigate to the function you want to debug (cider-jack-in) and run C-u C-M-x

dpsutton20:04:00

you are setting a breakpoint in elisp code that you want to debug

dpsutton20:04:09

then, when that function is called, it lets you step through it

aaelony20:04:22

how do I find cider-jack-in to navigate to it? where is it?

dpsutton20:04:24

instrument is a weird word for set a break point

dpsutton20:04:36

C-h C-f cider-jack-in

dpsutton20:04:49

super cool thing in emacs. that will navigate to the source code

dpsutton20:04:58

C-h f will show the documenation for a function

aaelony20:04:13

No `cider-jack-in' in index

aaelony20:04:37

the C-h f works though

aaelony20:04:02

ah, from *scratch* this works

dpsutton20:04:14

well, the file you want is in cider.el in the elpa directory where emacs downloads its packages

aaelony20:04:40

I see now.. thanks, never done that

aaelony20:04:59

less of a black box now!

dpsutton20:04:02

emacs gets amazing when you learn a few conventions

aaelony20:04:11

it's great

dpsutton20:04:16

absolutely. it seems really complicated but lots of smart and creative people have been working on it for a long time

aaelony20:04:22

knowing where to look is the hardest part

dpsutton20:04:07

the fun thing is that you get used to bouncing around to the source. basically, if emacs knows about it, C-h C-f will navigate to it

aaelony20:04:51

yes, I was in my core.clj file though, and that wouldn't work. From *scratch* it's nice.

aaelony20:04:30

so now, I can step through the code by navigating to cider-jack-in and pressing n ?

aaelony20:04:45

I'll read up... lol

dpsutton20:04:13

not by navigating to cider-jack-in, but just by invoking the function

dpsutton20:04:28

ie, in a clojure project run C-c M-j, the shortcut for cider jack in

dpsutton20:04:38

you "set a breakpoint" on this functino, so when you call it it will debug it

aaelony20:04:41

C-M-x cider-jack-in worked

aaelony20:04:58

cool, I'll tinker with this

dpsutton20:04:43

no problem.

dpsutton20:04:58

you basically have all the tools now. feel free to edit the cider code, etc

aaelony20:04:09

thanks, at some point as a result I'll know elisp 😉

dpsutton20:04:19

then you'll end up cloning the git repo, adding that location to your load path, and then running your own custom cider

aaelony20:04:41

might be a while ...

xcthulhu20:04:02

@aaelony: Happy you figured everything out 😄

aaelony21:04:10

yes, interestingly the cider-repl mostly works (so far) despite the warning. Also interested in digging into understanding cider.el but that will be a slow process to ease into over time

malabarba21:04:20

@aaelony: you're not the first to inexplicably see that warning. Maybe there's something wrong with the checker function.

malabarba21:04:00

Does documentation work for you? Invoke C-c C-d C-d on a symbol.

malabarba21:04:50

Evaluation can work even without the cider midddleware, but if documentation works then you definitely have the midddleware.

aaelony21:04:14

I get a "Doc for:" prompt

malabarba21:04:43

Type inc and hit RET

aaelony21:04:59

Wrong type argument: stringp, nil 

malabarba21:04:23

Hm. And this is with a repl running?

malabarba21:04:42

I mean, it's after Jack in?

aaelony22:04:09

so that's likely an issue

malabarba22:04:11

OK. Then I think you don't have the midddleware

malabarba22:04:19

Try upgrading your leiningen

malabarba22:04:31

I think you're a couple of minor versions behind

aaelony22:04:40

$  lein version
Leiningen 2.6.1 on Java 1.8.0_20 Java HotSpot(TM) 64-Bit Server VM 

aaelony22:04:51

is that not current?

aaelony22:04:25

I'm on mac os x with a brew installed lein. Brew refuses to upgrade further... I suppose I could grab something from github though if I override it

malabarba22:04:26

I thought the most recent was 2.6.3

malabarba22:04:29

but you're on the most recent

aaelony22:04:52

ok, good to know