Fork me on GitHub
#reveal
<
2020-12-02
>
didibus06:12:46

Is there a way to get reveal integrated with rebel-readline ?

vlaaad07:12:08

I experimented a bit with it and got it working as a normal repl, I'll try to find some snippets...

didibus07:12:01

I think I got it with this: :main-opts ["-e" "(require,'rebel-readline.core),(require,'rebel-readline.clojure.line-reader),(require,'rebel-readline.clojure.service.local),(require,'rebel-readline.clojure.main),(require,'vlaaad.reveal)(rebel-readline.core/with-line-reader,(rebel-readline.clojure.line-reader/create,(rebel-readline.clojure.service.local/create)),(vlaaad.reveal/repl,:prompt,(fn,[]),:read,(rebel-readline.clojure.main/create-repl-read)))"]

didibus07:12:10

Seems to work at least

vlaaad08:12:07

Awesome, I’ll save the snippet and add it to the readme when I have time

didibus06:12:07

But I think we can do better, and start the Reveal repl using the rebel line reader

didibus07:12:14

Ok, here's how, add this alias

:repl {:extra-deps {com.bhauman/rebel-readline {:mvn/version "RELEASE"}
                               org.clojure/clojure {:mvn/version "RELEASE"}
                               vlaaad/reveal {:mvn/version "RELEASE"}}
                  :main-opts  ["-e" "(require,'rebel-readline.core),(require,'rebel-readline.clojure.line-reader),(require,'rebel-readline.clojure.service.local),(require,'rebel-readline.clojure.main),(require,'vlaaad.reveal)(rebel-readline.core/with-line-reader,(rebel-readline.clojure.line-reader/create,(rebel-readline.clojure.service.local/create)),(vlaaad.reveal/repl,:prompt,(fn,[]),:read,(rebel-readline.clojure.main/create-repl-read)))"]}
Trick is what I do in :main-opts "-e" code

practicalli-john13:12:00

This is nice, I'll test and add to the practicalli/clojure-deps-edn project. Thank you, this has been on my todo list for a while.. and now I can create some more videos with this setup too.

didibus07:12:38

It be nice if Ctrl+l would clear the output

vlaaad08:12:13

is that i or L? 😂

vlaaad08:12:23

anyway, the output clearing is coming!

❤️ 3
practicalli-john13:12:53

l for lima is the same as in a shell terminal (and the same for Cider buffer in Spacemacs)

vlaaad13:12:48

Yeah, I was thinking about Ctrl+L as a default

practicalli-john13:12:22

That would work, capital letter as its 'changing' the state...

didibus20:12:01

What would the non state changing lower l variant do? If it did anything, I'm just curious?

didibus07:12:25

I also noticed, when you sort some column, and then switch the sort back to no sort, it doesn't restore the original order

vlaaad08:12:10

that’s JavaFX behavior, not much I can do about it except rewriting the table component altogether…

didibus20:12:15

Ah ok, well I can live without.

didibus07:12:12

But before I continue, let me say: Reveal is great! Really awesome work! I'm going to make it an integral part of my workflow, and I'm sure it'll be super handy

😊 3
seancorfield20:12:31

For anyone using my dot-clojure repo, I just pushed an update that adds a :dev alias that mimics what we have at work for starting REBL or Reveal or Rebel Readline or a plain REPL (depending on what's on your classpath) as well as a Socket REPL (saved to .socket-repl-port so you get the same port number next time you start it in that directory); if it starts Reveal, it also adds in the auto-table-view stuff that I use at work. If adds a dev.clj file in ~/.clojure which is loaded via -e using (System/getProperty "user.home")

9
seancorfield20:12:53

@didibus That's some interesting stuff... Maybe I'll update my dev.clj file to start things like that if you have both Reveal and Rebel Readline on the classpath... I'll create a ticket since I don't have time right now 🙂

didibus20:12:25

FYI: Apparently its better to do it like this:

:main-opts  ["-e" "(require,'rebel-readline.core),(require,'rebel-readline.clojure.line-reader),(require,'rebel-readline.clojure.service.local),(require,'rebel-readline.clojure.main),(require,'vlaaad.reveal)(rebel-readline.core/with-line-reader,(rebel-readline.clojure.line-reader/create,(rebel-readline.clojure.service.local/create)),(vlaaad.reveal/repl,:prompt,(fn,[]),:read,(rebel-readline.clojure.main/create-repl-read)))"]
I've updated the prior snippet as well. But this way allows someone to still use in, where the other way didn't, since it took it over to hook up rebel readline.

seancorfield20:12:54

Updated the issue to include that. It may be a few days before I get a chance to try that out. I don't use Rebel Readline myself.

didibus20:12:48

Its really nice. Actually, this combo of Rebel + Reveal, it turns the command line repl almost into a full blown IDE lol

didibus20:12:58

You get multi-line, color highlight, auto-format, inline doc, auto-complete, in-line parameter lists, with Reveal to inspect results, its pretty God like in my opinion 😛

didibus20:12:57

Now I wonder if I can also add this: https://github.com/jpmonettas/flow-storm-debugger (which I haven't tried yet) and get a full blown debugger in my command line repl lol

vlaaad21:12:14

heh, I had thoughts of trying to integrate flow-storm into reveal so you don't have to run it separately

vlaaad21:12:15

I think it might be pretty cool, but right now I'm busy with various UI improvements, and then there will be remote control...

didibus00:12:19

Remote Control?

vlaaad06:12:28

So you don't have to leave your emacs to navigate around Reveal :)

bananadance 6
didibus18:12:39

Oh awesome lol

didibus23:12:13

I was thinking, I don't know exactly what you plan for remote control. But I was going to change my Emacs so there is a shortcut that switches focus to the Reveal Window. And then I was thinking it be nice if in Reveal, if I pressed Esc when no pop-up is up, if it changed focus back to the app that had it before it acquired focus (or some other shortcut)

didibus23:12:43

So then I could easily go back and forth

vlaaad09:12:12

> or some other shortcut Like alt+tab? :)

didibus19:12:28

Nah, cause Alt+Tab switches to whatever

didibus19:12:02

Its what I do now, but if I say was in the browser, then go back to Emacs, and Alt+Tab, it goes to the browser

didibus19:12:14

So really what I plan to do is have winmove that when I winmove right and there is no more right in emacs, it switches focus to Reveal. And then it be nice if in Reveal, I could similarly assign a shortcut to switch back to Emacs

didibus19:12:44

So I'd probably have it S+right<most> goes to Reveal, and then S+left from Reveal goes back to Emacs

didibus19:12:03

Or maybe I'd find a switch shortcut more convenient, anyways haha. Remote Control sounds nice, in the meantime, having a shortcut in Reveal that I can configure where I can say: Here's the window name I want it to switch focus too, and here's the keyboard shortcut I want for it. Would probably satisfy me.

didibus19:12:43

But, to be honest, I'm not sure how trivial it is to ask the OS to switch window focus. I'm thinking each OS has its own mechanism for it, don't know if Java has a nice wrapper API that works with them all. So your idea of Remote Control might be better