calva

Wednesdays you might find @U0ETXRFEW in the Gather Calva space. Invite is https://gather.town/invite?token=GZqrm7CR and the password is `Be kind`.
flowthing 2021-04-21T07:02:47.118300Z

Does Calva have a scratch buffer (https://docs.cider.mx/cider/usage/misc_features.html#using-a-scratchpad) like CIDER? Can't seem to find it if it does.

pez 2021-04-21T07:41:45.125600Z

I’m not completely sure what the scratch buffer brings. But let me try to describe what VS Code and Calva has that I think is relevant given the description on the link. In VS Code you can easily create an unnamed editor (`cmd+n` on mac). An editor is about the same as what Emacs calls buffer. Then you can easily switch the language of that editor to Clojure, either by the command Change Language Mode, the language button in the status bar, or pasting something from another Clojure editor there. This editor then defaults to the user namespace when you evaluate code in it, and just generally get the same treatment as any Calva editor. If it is a ClojureScript project you can use the command Toggle the REPL Connection (clj or cljs) used for CLJC Files to switch this file between the Clojure and the ClojureScript REPL (just as with cljc files and the output window).

pez 2021-04-21T07:42:01.126Z

Does that seem to cover the use case you are looking for?

pez 2021-04-21T07:44:38.128200Z

Forgot: The way to “bless” the editor with another namespace than user is to add an ns form to it. (At the moment Calva reads the first ns form it finds. I have been planning to change that so that it is rather the last one that rules.)

flowthing 2021-04-21T07:49:54.131500Z

Thanks, that's useful to know, and it does cover the use case. :thumbsup::skin-tone-2: In the context of Calva, implementing a scratch buffer (or editor) type of thing would probably mean just a convenience command that opens a new editor, assigns it the correct syntax, and possibly configures it such that the tab doesn't show the dirty indicator.

pez 2021-04-21T07:51:05.133100Z

> possibly configures it such that the tab doesn’t show the dirty indicator I don’t think that’s possible. But I could be wrong.

flowthing 2021-04-21T07:52:15.134600Z

Ok, well, not super-critical. :man-shrugging::skin-tone-2:

pez 2021-04-21T07:54:47.137200Z

What I’ve been planning to do, which is a bit similar to these unnamed editors, is to have a command that creates a repl/fiddle file for the current “real” Clojure file. That would then “live” side by side with the real file and can be commited or git-ignored as the user sees fit. And it can be saved then to get rid of the dirty marker. You can always do this manually, of course, but I think it makes sense to make it fewer steps.

👍 2
1
🙌 1