Fork me on GitHub
#emacs
<
2023-09-05
>
lilactown21:09:26

is there any fool who has tried to use Emacs as a library inside of a Clojure app?

🤯 6
hiredman23:09:57

there was a guy years ago trying to rewrite the c core of emacs in clojure, but of course googling "rewrite clojure in emacs" is all stuff not about that

lread05:09:24

I think work stopped on deuce because of https://github.com/hraberg/deuce/issues/20?

practicalli-johnny07:09:45

Emacs can be used to run Elisp scripts rather than running it as an Editor, so could be used with Clojure tools.build or babashka, using their exec function that creates a shell out to the command line. Could be useful for batch processing of text from Clojure.

solf07:09:06

I think this kind of fits the target? https://github.com/borkdude/clj2el

🤯 2
lilactown17:09:06

what I really want is to be able to use org-element.el in Clojure

solf17:09:21

Clj2el would work for that I guess. You write org-element code in clojure, transpile it to elisp and call Emacs in batch mode (either new instance or daemon). I don't think we can skip that last step anyway, any way you find you'll have to start/use an emacs instance.

lilactown18:09:27

I want to have a Clojure service that parses org files and serves them over a webserver. I'm using https://github.com/200ok-ch/org-parser/ right now, but it's not complete

👀 2
lilactown18:09:19

looks like the org-java repo is GPLv3 with no classpath exception, and I'm not sure I want to open source my code yet

iarenaza08:09:08

IANAL, but I'm rather sure the GPL (not to be confused with the AGPL!) doesn't trigger the most of the license provisions if you don't distribute the code. Not even GPLv3. And running the code in your own server doesn't qualify as distribution from the GPL point of view (hence all the troubles in the past with service/cloud providers doing this kind of thin, and the eventual creation of the AGPL).

Benjamin11:09:52

you can run emacs as a script. Yes I have done this from other programs. Here is a large build build script for my blog: https://github.com/benjamin-asdf/faster-than-light-memes/blob/main/build-site.el runs with a bb task

(shell "emacs" "-Q" "--script" "build-site.el")
reference: https://www.emacswiki.org/emacs/EmacsScripts