nonsequitur / inf-ruby

219 stars 68 forks source link

fix for duplicate prompt and long lines #175

Closed bo-tato closed 1 year ago

bo-tato commented 1 year ago

I made ruby-send-string as a public interactive function as python and clojure and lisp modes have it, I don't personally use it interactively with those languages but I sometimes bind a key to lang-send-string to send a command to restart a service or whatever other action I'm repeatedly doing.

bo-tato commented 1 year ago

I just realized both the python-mode implementation and this, have the problem that send no longer works for large regions over tramp, as it creates the temp file locally.

bo-tato commented 1 year ago

I added a check if the filename is remote, then just do the old behavior and get duplicate prompts but working. But actually it doesn't matter because inf-ruby doesn't currently support tramp to begin with? IE if you are editing a file over tramp and do run-python it will run python repl on that remote host, but if you are editing a file over tramp and do inf-ruby it spawns irb on your local computer, and I can't see an option to spawn a remote ruby and connect it with inf-ruby

bo-tato commented 1 year ago

I was confused, inf-ruby does work fine over tramp, and I was getting an error with python on tramp for a different reason, it does have logic for creating the temp file remote which I copied. So this is working over tramp now also

bo-tato commented 1 year ago

and one more small fix as it wasn't deleting the temp file over tramp cause the filename had the /ssh prefix

dgutov commented 1 year ago

Nice work! A couple notes inline.

dgutov commented 1 year ago

and has ruby read and eval and delete the temporary file rather than using comint-send-string

I think the temp file isn't ultimately deleted, though?

EDIT: Ah no, I just missed that line.

bo-tato commented 1 year ago

Thanks! I'm fairly new at emacs lisp so any improvements are more than welcome

dgutov commented 1 year ago

Thanks again!