Fork me on GitHub
#cider
<
2016-03-22
>
zzamboni00:03:20

oh well, that sure derailed my daily Clojure session. Time to sleep now, I’ll keep looking into it tomorrow. @malabarba Thanks for your help!

sanjayl00:03:30

@malabarba: yeah, I get the same thing when refactor-nrepl is in my :plugins vector

sanjayl00:03:40

and it goes away if I remove that plugin

sanjayl00:03:43

error persists when I specify the refactor-nrepl plugin version specifically instead of just the snapshot, tried back to the 20160228 release

zzamboni00:03:50

@sanjayl: I don’t even have a ~/.lein/profiles.clj at the moment, and I’m still getting that prompt 😞

zzamboni00:03:53

IIUC, cider in this case automatically decides the dependencies it needs and specified them through the command used to start the repl?

sanjayl00:03:22

@zzamboni, that's right, the jack-in command automatically adds the refactor-nrepl plugin (take a look at the Messages buffer thing you pasted above)

sanjayl00:03:26

will quickly check and see if there's a way to turn that plugin off in jack in, if not, can always start the repl on the command line and then connect to the running REPL

zzamboni00:03:19

@sanjayl: after setting cider-inject-dependencies-at-jack-in to nil, the dependencies are not injected in the command anymore

zzamboni00:03:45

I set up a minimal profiles.clj with {:user {:plugins [[cider/cider-nrepl "0.11.0"]]}}, but I’m still getting the “Lisp expression” prompt

sanjayl00:03:15

@zzamboni, thanks! If you still need plugins, you can customize the cider-jack-in-lein-plugins variable

sanjayl00:03:45

The profiles.clj won't make a difference, since emacs is setting the plugins directly, not reading from profiles.clj

sanjayl00:03:09

let me give the cider-inject-dependencies-at-jack-in a try, brb

zzamboni00:03:59

I guess I still don’t understand the interactions and dependencies between the Emacs and Clojure bits

zzamboni00:03:19

This has been by far the most frustrating part of learning Clojure - getting Emacs set up just right 😞

sanjayl00:03:43

yeah, there are a lot of moving pieces. So the red txt in the REPL basically tells you that you can't use anything that the refactor-nrepl plugin provides

sanjayl00:03:36

you'll still be able to use everything else in CIDER

sanjayl00:03:09

correct, you won't be able to use the parts of refactor-nrepl that require processing by the middleware, you can still use the parts that are done directly on the emacs side

sanjayl00:03:35

i mean correction. here's what I added to my .emacs to get the REPL to work with jack-in:

sanjayl00:03:54

`(defun my-clojure-mode-hook () (setq cider-jack-in-lein-plugins '(("cider/cider-nrepl" "0.12.0-SNAPSHOT")))`

zzamboni00:03:14

still get the prompt

zzamboni00:03:56

I really need some sleep now - @sanjayl and @malabarba, thanks for the help and the pointers! I’ll keep poking tomorrow.

bozhidar05:03:25

@zzamboni: I’m guessing something’s wrong in your cider setup, as I can’t imagine where this Lisp expression prompt would come from

bozhidar05:03:42

guess you can share with us the relevant bits of your Emacs config

bozhidar06:03:43

I’m said to hear you find the setup procedure confusing

bozhidar06:03:59

any pointers to improve it (or the documentation) would be helpful

bozhidar06:03:13

cider’s really simpler than most people think

zzamboni08:03:54

@bozhidar: thanks for your message. I’ve been thinking of restarting my Clojure-related Emacs setup from zero by myself, since I jumpstarted it from @nonrecursive’s setup described in his book, which got me started very quickly and gave me a nice overview, but I think now it’s time for me to build my own so I fully understand what’s in there 😉

bozhidar08:03:04

note that the setup there is outdated

bozhidar08:03:20

I think it’s based on CIDER 0.8 which is kind of ancient by now

bozhidar08:03:43

this was released 1.5 years ago

benedek10:03:58

@zzamboni: @sanjayl if you want to stop clj-refactor specifically to inject its dependencies set cljr-inject-dependencies-at-jack-in to nil. but superficially reading the chatlog that might not be the problem

benedek10:03:36

the point is with this autoinject feature that you don’t need to edit your profiles.clj anymore. @sanjayl you should not need any additional stuff in your emacs init scripts either. if cider-inject-dependencies-at-jack-in is *not* set to nil cider should take care of that

benedek10:03:22

@zzamboni: you probably checked already but you need at least leiningen 2.5.3 as well (if memory serves…)

benedek10:03:36

but best to have 2.6+ really

zzamboni10:03:31

@benedek: thanks, I have lein 2.6.1

otfrom11:03:14

bozhidar: for all the squiggly and clj-refactor injections do I need cider 0.11.0 or 0.12.0-SNAPSHOT ?

benedek11:03:57

you need cider 0.11 or above

benedek11:03:27

for clj-refactor you need 2.2.0 snapshot or above tho

benedek11:03:42

just releasing 2.2.0 actually if you prefer stable

otfrom11:03:24

benedek: how does the injection work for 2.2.0? Just get the latest clj-refactor.el and add it to the clojure-mode-hook?

otfrom11:03:40

mostly trying to keep my ~/.lein/profiles.clj clean

benedek11:03:42

not yet released tho!

benedek11:03:54

takes a bit of time until melpa-stable picks it up

otfrom11:03:02

ok, but when it is available on melpa-stable that would be the way to do it?

benedek11:03:30

you install 2.2.0 of clj-refactor using packages. that’s it

otfrom11:03:41

(this is all very cool btw. The emacs support for clojure keeps getting better and better)

benedek11:03:42

when you jack-in with cider clj-refactor should add its own deps

benedek11:03:49

no need to add anything to your profiles.clj anymore. in fact better if you get rid of cider/refactor stuff in there

benedek11:03:08

checking squiggly it seems that this autoinject deps was added at 24th feb so it should be there in their snapshot. if I understand their gitlog right 😉

zilvinasu11:03:56

Hey, I am curious if the following confs in ~/.lein/profiles.clj is still relevant with recent Cider snapshot versions

{:user  {:plugins [[cider/cider-nrepl "0.12.0-SNAPSHOT"]
                   [refactor-nrepl  "2.0.0"]]
         :dependencies [[cider/cider-nrepl "0.12.0-SNAPSHOT"]
                        [org.clojure/tools.nrepl "0.2.12"]
                        [com.cemerick/piggieback "0.2.1"]]
         :repl-options {:nrepl-middleware
                        [cemerick.piggieback/wrap-cljs-repl
                         cider.nrepl.middleware.apropos/wrap-apropos
                         cider.nrepl.middleware.classpath/wrap-classpath
                         cider.nrepl.middleware.complete/wrap-complete
                         cider.nrepl.middleware.debug/wrap-debug
                         cider.nrepl.middleware.format/wrap-format
                         
                         cider.nrepl.middleware.inspect/wrap-inspect
                         cider.nrepl.middleware.macroexpand/wrap-macroexpand
                         cider.nrepl.middleware.ns/wrap-ns
                         cider.nrepl.middleware.pprint/wrap-pprint
                         cider.nrepl.middleware.refresh/wrap-refresh
                         cider.nrepl.middleware.resource/wrap-resource
                         cider.nrepl.middleware.stacktrace/wrap-stacktrace
                         cider.nrepl.middleware.test/wrap-test
                         cider.nrepl.middleware.trace/wrap-trace
                         cider.nrepl.middleware.out/wrap-out
                         cider.nrepl.middleware.undef/wrap-undef]}}}

benedek11:03:17

you don’t need the cider related stuff anymore. including the tools.nrepl dependency. however if you are on clj-refactor 2.0.0 you still need the [refactor-nrepl "2.0.0”] bit.

benedek11:03:55

alternatively you can upgrade to clj-refactor 2.2.0-SNAPSHOT of clj-refactor or 2.2.0 stable in few hours (just releasing see above)

benedek12:03:49

no worries simple_smile

malabarba13:03:53

@zzamboni the latest version of cider is supposed to work with 0 setup

malabarba13:03:05

Try removing all your configuration

malabarba13:03:22

Then just install cider from scratch and try jacking in.

malabarba13:03:42

If that works it means there was a problem in yourself configs

nonrecursive13:03:44

@zzamboni @bozhidar yeah, I need to include clear instructions for updating very badly. my plan is to do a screencast showing how

nonrecursive13:03:14

@bozhidar another way of looking at it is that your work is so great, it’s timeless 😄

bozhidar13:03:29

@nonrecursive: btw, I’m guessing it would be beneficial to update the web version of the book

bozhidar13:03:18

I’m guessing plenty of people come across it every day

bozhidar13:03:03

and maybe add a note there that by the time someone is reading this the exact setup for the latest version might be different

bozhidar13:03:17

so people should consult cider’s docs as well to be on the safe side

reefersleep13:03:56

@turbopape @rmuslimov @malabarba: Pressing enter on #dbg or deleting it and reevaluating the function removes the breakpoint just fine. @malabarba nice update, though simple_smile

benedek14:03:07

clj-refactor 2.2.0 is out and on melpa-stable 🎉 enjoy simple_smile

sanjayl14:03:16

@zzamboni: I just did an fresh out of the box install of cider and clj-refactor. No customizations, profile.clj, etc and everything worked perfectly without the issue we were running into yesterday. Will try again in my typical setup and let you know if I find anything.

sanjayl14:03:49

everything back to normal in my stock setup too...well that was weird

zzamboni14:03:38

@sanjayl, @malabarba thanks again! I will try this later today

pbostrom17:03:58

I just had a thought: enable the \scratch\ buffer for Clojure/cider mode...does anyone else do this?

bozhidar17:03:30

there’s a cider scratch mode, btw

bozhidar17:03:56

I think using it is a better idea than repurposing the standard scratch buffer

base69820:03:29

holy crap, how did I not know that was there

rmuslimov20:03:03

scratch is cool, thanks

zzamboni22:03:21

@sanjayl, @malabarba: I have started from a clean Emacs config, and cider-jack-in works fine. Something I had in my previous setup.

zzamboni22:03:42

I’m also using the opportunity to re-create my emacs config from scratch, with use-package this time 😉

sanjayl22:03:04

yeah that was really bizarre, i don't know how to explain it

sanjayl22:03:25

ha! silver lining

zzamboni22:03:06

indeed! It’s something I’d been thinking of doing for some time, and this is the perfect excuse. Here go the next few hours 😉

otfrom22:03:29

Thx benedek

otfrom22:03:15

And I'll switch to ordinary melpa for flycheck and squiggly