nonsequitur / inf-ruby

218 stars 69 forks source link

Implement ruby-send-exit #185

Closed x3qt closed 7 months ago

x3qt commented 7 months ago

Hello!

I propose to implement ruby-send-exit to enable frictionless workflow with multiple breakpoints as discussed in #184.

Regarding keybindings, I am using , s e myself, so maybe C-c C-e would make sense semantically.

Please let me know if any changes are needed to this PR.

Thanks!

dgutov commented 7 months ago

C-c C-e stomps over the binding on the previous line, which is modeled after C-x C-e (eval-last-sexp in Emacs Lisp mode), so we'll need some other combination.

Or possibly none - it's not a problem to add a command without a default binding.

dgutov commented 7 months ago

Ah no, it actually doesn't - one uses C-x and another C-c.

This still might be confusing: someone might be trying to guess a binding, or press a key very close to an existing one - and the session is killed as a result. Perhaps it would be a good idea to choose a combination that's less likely to be hit.

x3qt commented 7 months ago

What about C-c C-q? It could make sense semantically as in "quit", which is similar to "exit". If it sounds good, then we probably could rename ruby-send-exit to ruby-quit as well.

dgutov commented 7 months ago

Yep, apparently there is prior art for this command and binding:

https://github.com/clojure-emacs/inf-clojure/blob/master/inf-clojure.el#L773-L782 https://github.com/clojure-emacs/inf-clojure/blob/master/inf-clojure.el#L420

We probably wouldn't want to kill the buffer, though.

dgutov commented 7 months ago

See the addition in 6c4367a - now it should switch back to the compilation mode as well (with appropriate highlighting for test failures and stuff).

x3qt commented 7 months ago

Great additions, thanks a lot!