This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-04-26
Channels
- # aleph (6)
- # announcements (1)
- # babashka (18)
- # beginners (13)
- # calva (18)
- # cider (5)
- # clojure (144)
- # clojure-europe (34)
- # clojure-nl (1)
- # clojure-norway (29)
- # clojure-uk (4)
- # emacs (9)
- # etaoin (51)
- # events (1)
- # gratitude (1)
- # hyperfiddle (9)
- # lsp (4)
- # off-topic (6)
- # pathom (61)
- # rdf (1)
- # releases (3)
- # shadow-cljs (16)
- # vrac (1)
- # yada (1)
- # yamlscript (3)
Is there a way to record/save the forms that have been evaluated with cider-eval-defun-at-point
? For context I often do live coded music performances and would like to be able to save the evaluated forms with timestamps for replaying them at a later time or for reference.
I'd look into advice-add
ing that function - in your hook you can do the persistence work
sorry, which hook?
What vemv called "your hook" is the function you would "attach" to advice-add
.
You would define your own function (let's call it my/archive-cider-eval-defun-at-point
)), to take the "form" being evaluated by cider-eval-defunt-at-point
, attach whatever metadata you want to keep next to that form (e.g., a timestamp), and save (archive) all that to the place you want to (a file, a database, wherever).
And then you would advice cider-eval-defun-at-point
, using advice-add
with my/archive-cider-eval-defun-at-point
. You'll probably be interested in using :around
(although :filter-return
may suffice for this case) with addvice-add
. So you can check if cider-eval-defun-at-point
successfully evaluated the "form", before archiving it (I'm assuming you don't want to archive forms that had evaluation errors).