Fork me on GitHub
#spacemacs
<
2022-01-10
>
Martynas M12:01:43

Hey. Is there a way to execute a custom clojure function in spacemacs? I'd like to execute a function and take the current namespace name as an argument.

practicalli-john14:01:14

A Clojure function can be called when using cider-refresh, for example to stop and start component service https://practical.li/spacemacs/clojure-repl/component-lifecycle.html#configure-cider-refresh-to-use-component-lifecycle I am unsure if there is a general way to call Clojure functions from Emacs lisp

Martynas M15:01:17

I have a function (from @_seancorfield) that cleans whole namespace from all of the variables so that it would be fresh again. So I wanted to call it using a key combination

practicalli-john15:01:08

It seems cider-insert-in-repl takes a string argument that contains a Clojure function, which is then run in the REPL (I haven't tried this). So you could add a elisp function to dotspacemacs/user-config that calls the Clojure function you want Asking in #cider may provided other suggestions