Replies: 2 comments 4 replies
-
This is interesting, but needs to be very well thought out to be effective. When the error stems from the REPL itself, you already get a kind of indication (in the prompt) that you're inside the "context" of an error. This is much like in any lisp's "raw" REPL, SBCL and so. But, jus tlike in those REPL's evaluation does not happen in the frame of the error It's just code run by the Also, I'm not sure all Lisps support evaluating in a particular frame. But let's get down to business. Maybe we could enhance that interface, the error-from-the-REPL interface so that evaluations are done in the top-level frame where the debugger was invoked. Maybe this would be an interesting, useful and "clean" first step? You want to prototype it? At any rate it would need a clear indication that one is in this "mode". But that would leave all the other errors that stem asynchronously from other parts of the Lisp. Maybe spawn a REPL for those? What about evaluating things in other non-top frames? Is that ever useful? |
Beta Was this translation helpful? Give feedback.
-
Oh hello, I had the same desire so I went ahead and made a plugin myself, I did not notice this thread until after I made the announcement thread. I hope it's good enough. It even prints stuff like local variables to the repl as buttons that you can press. I mostly just copy pasted stuff i saw from sly code, iirc works just by storing the name of the debugger buffer and executing eval-in-frame in that buffer, and it works well enough for me I haven't got it to crash or anything yet. The repl is does not close after the debugger window closes and stays 'sticky'. If it is closed with kill-buffer it regenerates itself when needed. There is one eval-in-frame repl per unique debugger window name, so it works if there are multiple debugger windows even latched onto the same lisp instance, but it is sticky so if for example the debugger is closed and another exception pops up with the same name then the listings of variables etc. will be stale but will still work and you can still just press Z to print out the new listings again. It auto-detects if the debugger it is meant to send commands to is gone and will just print a notification until the debugger is available again. |
Beta Was this translation helpful? Give feedback.
-
When I'm trying to evaluate expressions in debug frames, I've often been annoyed that I have to type my expressions into the minibuffer (where some of the minor modes / keybinds I like are disabled). A related annoyance is that larger output from eval-in-frame gets shunted off to another buffer/window which, depending on where emacs decides to drop it, might replace an important buffer on my screen.
Personally, I would really like the option to spawn some sort of "debug repl" buffer, which functioned more or less like an ordinary sly-mrepl-mode buffer except that all expressions happen to be evaluated in the spawning debug frame. Ideally the buffer would be automatically killed upon debug frame cleanup too.
Is there any scope in sly for a feature like this (perhaps even some option/command I've overlooked)?
Beta Was this translation helpful? Give feedback.
All reactions