Restart the current process
I run ruby on a remote host using ssh so my process dies all the time.
I want to be able to restart the current buffer's process (without wiping out the previous buffer content!)
How do I do that?
I suppose (run-ruby inf-ruby-buffer-command) could do the trick? It creates a new buffer, though.
New buffer is precisely what I want to avoid.
I think it's either create a new buffer, or keep the old contents. You could try to copy them over to the new buffer, though, but implementing that is up to you. The minimal solution is this:
(defun inf-ruby-restart-process ()
(interactive)
(let ((command inf-ruby-buffer-command)
(name inf-ruby-buffer-impl-name)
kill-buffer-query-functions)
;; Copy the current contents.
(kill-buffer (current-buffer))
(run-ruby command name)
;; Insert them here somehow.
))
Looks like this was implemented as part of #145 (the user option is inf-ruby-reuse-older-buffers, on by default).