emacs

Drew Verlee 2025-01-17T06:41:51.872739Z

How would I require a clojure namespace into an org block? I have been searching through google and asking chatgpt and found nothing, i can't imagine this is a rare thing, if it is, what do people do? Just not do literate programming 🙂 use clerk?

a13 2025-01-17T12:20:16.236479Z

@ag was working on a similar problem not too long ago, I can't find the thread now, though

👍 1
Drew Verlee 2025-01-17T22:36:54.340849Z

im guessing this is ags work here: https://github.com/ag91/ob-clojure-literate-extras im using figwheel, but what he has done is a great place to start.

Ellis 2025-01-17T06:46:00.207519Z

You could use :session to get a backed REPL that should let you include things if the babel backend supports sessions

Drew Verlee 2025-01-17T07:17:23.130639Z

What would the value of session be?

Drew Verlee 2025-01-17T07:22:54.249719Z

Hmm, i guess do this in reverse typically, they tangle all the files from their org file into other files. maybe thats why this talked about as much? I guess in my case maybe clerk a bit better? everything feels like a distraction.

Ellis 2025-01-17T07:24:52.256129Z

The value is the name of the session you want, which maps to the buffer name of the REPL https://orgmode.org/worg/org-contrib/babel/intro.html#org2da6b65 Clerk is maybe better depending on what you're trying to do

Drew Verlee 2025-01-17T07:32:15.333149Z

I'm guessing i still dont' know how to supply the session correctly. Here is a picture of emacs where the top window is the clojure namespace i want to import (ns core) then the next window down is what i believe to be the 'repl buffer'. if i run 'copy-buffer-name' I get cider-repl clojure/play:localhost:38299(clj) Which is what i pass to :session in the third block and the result of running that block is a class exception.

Ellis 2025-01-17T07:38:05.565169Z

Drew Verlee 2025-01-17T07:39:14.649429Z

why is session set to demo?

Ellis 2025-01-17T07:39:27.729279Z

Because it's a demo 😛

Ellis 2025-01-17T07:39:45.725629Z

You can have as many sessions as you want in a document

Drew Verlee 2025-01-17T07:40:31.663289Z

oh, you defined hello in the block above. I thought you were requiring it from a clojure namespace defined in a clj file, thats what i'm trying to do.

Drew Verlee 2025-01-17T07:41:48.285169Z

there is a clojure deps.edn project, with the accompanying src dir that has .clj files, i want to require them into my org file and run them. Which is why my picture has (require 'core)

Drew Verlee 2025-01-17T07:42:31.495969Z

sigh, its me. i wrapped the foo in parens.

Drew Verlee 2025-01-17T07:42:35.100339Z

lol

Ellis 2025-01-17T07:43:09.109779Z

You also didn't include a picture 😛 also worth looking at the manual https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-clojure.html

Drew Verlee 2025-01-17T07:43:28.563199Z

🙌 1
Drew Verlee 2025-01-17T07:44:11.153379Z

that manual is a bit odd, it links to a github repo that is a 404. I was worried it was out-of-date.

Drew Verlee 2025-01-17T07:44:48.342039Z

ill take a closer look though, i appreciate the help @elken!!!!

🙌 1
Ellis 2025-01-17T07:45:20.419839Z

Nah worg is as up to date as the docs can be, everything is hosted on Savannah. If you spot anything wrong please do let them know 🙂

👍 1
Drew Verlee 2025-01-17T07:47:56.474939Z

ah, thats a different site then i thought at first, i was thinking of this link: https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-clojure-literate.html the release history at the bottom has a link results in a 404 for a project i couldn't find.

Ellis 2025-01-17T07:49:29.439149Z

Ah yeah looks like they deleted their repo without updating the link. Worth letting the org folks know 😄

👍 1
Drew Verlee 2025-01-17T07:55:20.205909Z

I'll try to -_-. I got it to work with clojure. 🎆 any idea if the whole org to clojurescript with figwheel will work too? I want to try org-moding all the things and see if that helps.

ag 2025-01-19T06:53:45.444409Z

Different Ag. I'm the original one with no numbers attached. With all the flaws still intact. That one is a ninety-first attempt to improve upon :)

😄 2
ag 2025-01-19T06:57:42.035949Z

This is the thread mentioned earlier https://clojurians.slack.com/archives/C099W16KZ/p1734629348782949?thread_ts=1734629348.782949&cid=C099W16KZ I'm not sure if it is still relevant for what you're looking for.

👀 1