cider

A channel dedicated to the Clojure Interactive Development Environment that Rocks (aka CIDER). :cider:
timsgardner 2020-10-30T00:27:57.334300Z

Hey, I couldn't easily find a satisfactory solution to this googling. In emacs I'm trying to use babel to send forms to the cider repl. When I enter a clojure code block and run cider-eval-last-sexp, cider-eval-last-sexp-to-repl, cider-eval-defun-at-point, etc, nothing happens, not even an error message. These commands work as expected in a clojure file. Does anyone know how to get this working? Thanks

timsgardner 2020-10-30T07:15:53.334600Z

thanks that looks like it's working!

timsgardner 2020-10-30T07:17:00.334800Z

I wish everything in emacs didn't require hours of googling, obsolete docs, source spelunking 😕

timsgardner 2020-10-30T07:17:16.335Z

you saved me a lot of time, thanks again

👍 1
nivekuil 2020-10-30T07:37:12.335200Z

In reply to @￱￱slack￱￱￱￱￱￱t03￱￱r￱￱z￱￱g￱￱p￱￱f￱￱r=2d￱￱u3￱￱q8￱￱m￱￱m￱￱r￱￱e￱_￱x:nivekuil.comyou saved me a lot of time, thanks againover time you get an intuition for things :) is there anything you can think of that would have made the org-mode <-> cider connection requirements clearer?

timsgardner 2020-10-30T07:42:44.335400Z

Thanks for asking, I'm composing a medium doc now. The problem here was that it involved triangulating many different libraries, some of which are obsolete, the docs for each of which assume familiarity with another library. It's also completely possible there's a compact recipe for this somewhere and I didn't find it.

timsgardner 2020-10-30T07:52:55.335600Z

The org docs for ob-clojure are extremely vague about how to connect a session and get fully set up for source block evaluation. The github README for ob-clojure-literate is outdated because ob-clojure-literate was integrated into org contrib two years ago. I could not find a fully explicit account of how to get access to org contrib libraries that actually worked for me, instead I pieced together from examining package-list-packages and a stack overflow post that a package called org-plus-contrib is relevant. With some trepidation, since this sort of thing can subtly screw up emacs sometimes, I installed it, taking care to require it before using other org functions (a poster on stack overflow recommended this). The commands ran but didn't work correctly. Looking inside the ob-clojure-literate source, I found much depends on the presence of cider-connections. By trial and error I found this function has a non-null return in a clojure source file while cider is active but not in the source block buffer. After reading the ob-clojure-literate source some more I checked slack again and got your very welcome answer. Through more trial and error I pieced together that sesman-link-with-buffer expects to be given the name of sessions as provided in the top line of each entry in sesman-browser. That worked.

timsgardner 2020-10-30T07:55:24.335800Z

This sort of thing is probably inherently difficult to document because there are many moving parts

bozhidar 2020-11-01T18:34:14.340Z

I think ob-clojure didn't keep up with recent CIDER developments and this caused a lot of confusion in the end.

bozhidar 2020-11-01T18:34:32.340200Z

I don't use it myself, that's why I don't follow its development closely.

sgepigon 2020-10-30T05:51:26.334400Z

Try sesman-link-with-buffer? https://docs.cider.mx/cider/usage/managing_connections.html#context-links

Jim Newton 2020-10-30T12:09:05.336500Z

how can I re-indent all the lines in a file using cider? I've done a search/replace on some function names, now many lines are not indented correctly.

Jim Newton 2020-10-30T12:11:30.337200Z

Answering my own question. I found indent-region I was looking for reindent and not finding anything useful

Louis Kottmann 2020-10-30T17:58:28.337500Z

C-x h &lt;tab&gt; should do the trick

Eric Ihli 2020-10-30T18:02:30.339300Z

Is there something about how Cider evaluates things that would cause the following behavior? I define a function,

(ns integrant.repl)
(defn suspend []
  (println state/system)
  (when state/system (ig/suspend! state/system))
  :suspended)
If I run that from my REPL in Emacs, it works find. When I set cider-ns-refresh-after-fn to integrant.repl/suspend, I don't get that println at the REPL or to the Messages buffer

nivekuil 2020-10-30T22:47:00.339600Z

In reply to @￱￱slack￱￱￱￱￱￱t03￱￱r￱￱z￱￱g￱￱p￱￱f￱￱r=2d￱￱u010￱￱v￱￱p3￱￱u￱￱y9￱￱x:nivekuil.comhow can I re-indent all the lines in a file using cider? I've done a search/replace on some function names, now many lines are not indented correctly.there's also aggressive indent mode which automatically formats as you go