reveal

Docs: https://vlaaad.github.io/reveal/ Source: https://github.com/vlaaad/reveal
motform 2021-03-09T08:39:04.036600Z

I'm experimenting a bit with the remote control capabilities for an emacs-mode that I'm making, but I'm having some trouble with the :ns key in the command map. I get that it changes the ns for anything evaluated, but it seems to mean that it is unable to find reveal-functions when I specify a namespace :cause "Unable to resolve symbol: open-view in this context".

vlaaad 2021-03-10T20:50:18.046700Z

I think it makes sense, I added it to my todo list, thanks!

motform 2021-03-09T08:40:04.036800Z

From the example:

(defn add-1 [x]
    (+ 1 x))

  {:vlaaad.reveal/command '(open-view {:fx/type vlaaad.reveal.ext/action-view
                                       :action :vlaaad.reveal.action/view:table
                                       :value (add-1 1)})
   :ns 'foo.core}

motform 2021-03-09T08:42:19.037Z

The reason for this is that I want to be able to eval a form in the editor and send the result directly to a view. I recon this could also be done by evaluating the form using regular evaluation, save the result and then pipe that result into the reveal/command map, but that would cause the original evaluation to show up in the reveal history.

motform 2021-03-09T08:42:48.037200Z

I see there is also the :env key, but that seems unwieldly when working with evaluations of unspecified depth.

vlaaad 2021-03-09T09:00:00.037400Z

Hi! open-view is a function in vlaaad.reveal.ext ns, if you are using different ns, you should use fully-qualified call to open-view

vlaaad 2021-03-09T09:00:48.037600Z

i.e. (vlaaad.reveal.ext/open-view ...)

vlaaad 2021-03-09T09:06:05.037800Z

btw right now this ns is not loaded by Reveal automatically, but when invoking Reveal command it will make sure the ns is loaded before evaluation. This means just using full form might throw exception if user didn't require that ns before. More reliable way to open the view when using different ns is requiring-resolve, i.e. ((requiring-resolve 'vlaaad.reveal.ext/open-view) ...)

motform 2021-03-09T09:13:10.038Z

That works great, thank you for the fast response!

motform 2021-03-09T09:13:27.038200Z

+ the noet about the ns-loading

motform 2021-03-09T09:14:46.038500Z

I'm really liking the remote-controlling so far! The only thing I'm missing would be a command to close the result panel

motform 2021-03-09T09:15:37.038700Z

But other than that, it's really magical to see your data come to life directly from the editor!

vlaaad 2021-03-09T12:10:44.038900Z

That's what I was aiming for :)

vlaaad 2021-03-09T12:11:24.039100Z

Re closing the result panel — do you mean latest opened panel, or all panels?

motform 2021-03-09T12:22:04.039300Z

Probaby both. I can see there being times when you want to quickly look up a view, then get back to main repl and times when you have no idea how many panels deep you are. Like macroexpand/macroexpand-1!