Fork me on GitHub
#emacs
<
2023-11-23
>
Amin12:11:16

hello, I have a small babashka script that manipulates images and I’m using it mainly from emacs through the cider repl. Is there any way to show an image in the repl? For now I open the image in another buffer with C-x f img-path, but I would like to script also that step if possible.

vemv12:11:33

See https://github.com/clojure-emacs/cider/issues/2825#issuecomment-710691762 LMK if it works for you after enabling the relevant defcustom :)

Amin12:11:51

I copied that snippet in my .emacs file, after restarting emacs and trying to print a file in the REPL, it doesn’t seem to render the image

user> ( script/img-in)
#object[java.io.File 0x64642b09 "/Users/.../notes_workspace/imgs/Pasted image 20231123122707.png"]

vemv13:11:56

(.URI. "") worked for me (it's the very first time I had tried this functionality) can you confirm whether that particular url works for you?

Amin13:11:04

This is what I get 😓, no image displayed

user> (java.net.URI. "")
#object[java.net.URI 0x209f6312 ""]

vemv13:11:50

is it a vanilla JVM repl? or a bb --nrepl connection

Amin13:11:13

I ran the repl from my babashka script with M-x cider jack-in

vemv13:11:39

Maybe it's a babashka-nrepl, which provides some drop-in replacements for cider-nrepl ops, but not all Feel free to try a vanilla clojure project

👍 1